Exemplo n.º 1
0
        public static StyleLayer ToForms(this MGLStyleLayer layer)
        {
            switch (layer)
            {
            case MGLSymbolStyleLayer symbolLayer:
                return(new SymbolLayer(layer.Identifier, symbolLayer.SourceIdentifier));

            case MGLRasterStyleLayer rasterLayer:
                return(new RasterLayer(layer.Identifier, rasterLayer.SourceIdentifier));

            case MGLFillStyleLayer fillLayer:
                return(new FillLayer(layer.Identifier, fillLayer.SourceIdentifier));

            case MGLFillExtrusionStyleLayer fillExtrusionLayer:
                return(new FillExtrusionLayer(layer.Identifier, fillExtrusionLayer.SourceIdentifier));

            case MGLHillshadeStyleLayer hillshadeLayer:
                return(new HillshadeLayer(layer.Identifier, hillshadeLayer.SourceIdentifier));

            case MGLCircleStyleLayer circleLayer:
                return(new CircleLayer(layer.Identifier, circleLayer.SourceIdentifier));

            case MGLHeatmapStyleLayer heatmapLayer:
                return(new HeatmapLayer(layer.Identifier, heatmapLayer.SourceIdentifier));

            case MGLLineStyleLayer lineLayer:
                return(new LineLayer(layer.Identifier, lineLayer.SourceIdentifier));
            }

            return(null);
        }
Exemplo n.º 2
0
 /**
  * Add Layer to the map and track the id.
  *
  * @param layer        the layer to be added to the map
  * @param idAboveLayer the id of the layer above
  */
 private void AddTrafficLayersToMap(MGLStyleLayer layerCase, MGLStyleLayer layer, string idAboveLayer)
 {
     style.InsertLayerBelow(layerCase, style.LayerWithIdentifier(idAboveLayer));
     style.InsertLayerAbove(layer, layerCase);
     layerIds.Add(layerCase.Identifier);
     layerIds.Add(layer.Identifier);
 }