Skip to content Skip to sidebar Skip to footer

Adding Many Symbol Icons From Geojson Using A Loop In Mapbox Android?

I have a map with 500 symbol icons. I am wondering if there is a way to add these markers using a function or loop that iterates through my geojson info and grabs the needed featur

Solution 1:

Based on the documents, you should only need to provide the array of Stops, not using the expressions changing the parameters. Should you try this:

loadedMapStyle.addLayer(
  SymbolLayer("route-location-layer-id", Constants.SOURCE_ID)
      .withProperties(
          iconImage(
             match(
                get("icon_property"),
                literal(Constants.ICON_ID_1_GREEN),
                // Instead of stop() based on array of stops, just add stops' array
                *getLoadingSymbolStops()
             ),
          ),
          /* Remaining Properties*/
      )
)


Post a Comment for "Adding Many Symbol Icons From Geojson Using A Loop In Mapbox Android?"