0
votes

I am following this example: https://docs.mapbox.com/android/maps/examples/symbol-layer-info-window/

Also here:

https://github.com/mapbox/mapbox-android-demo/blob/master/MapboxAndroidDemo/src/main/java/com/mapbox/mapboxandroiddemo/examples/dds/InfoWindowSymbolLayerActivity.java

It is loading a number of points with descriptions from a file.

On line 271: String geoJson = loadGeoJsonFromAsset(activity, "us_west_coast.geojson");

What I need is to do the same dynamically. I have the information already as features in the map. I can get Title and Description from there. What I need is to use GenerateViewIconTask and setUpInfoWindowLayer when this event is triggered: onMapClick.

So basically a user taps on the map, I get the coordinates and search in the map's features, get the lat/lng, title and description and show up a callout on the map.

I can handle tapping, getting the map's feature, extracting title and description. What I need to do to finish with showing a nice callout on this location with title and description.

1

1 Answers

1
votes

Sorry for the late response. You can either show a label by setting the textfield property or (according to the docs) create an info window by setting the iconImage property to a string, like iconImage("{title}"). Sadly I've rarely used the latter as it never worked for me.