I wants to move SymbolLayer icon on the map layer as per the position change, move like as a marker. In the latest Mapbox update, MarkerView and MarkerViewOptions is deprecated. So I want to move the SymbolLayer icon.
Please help me to make it work.
Thanks
There are several ways you can do this and it's kinda' dependent on what type of source + layer you're going to use. First read https://docs.mapbox.com/android/java/overview/geojson/#geojson-updates
GeoJsonSource
, you'll set new geojson on the source when you know the new coordinate(s) that you want theSymbolLayer
icon to move to https://github.com/mapbox/mapbox-android-demo/search?q=setGeoJson. Make sure you're updating theGeoJsonSource
that theSymbolLayer
is using.symbol.setLatLng();
andsymbolManager.update();
will be helpful. See https://github.com/mapbox/mapbox-plugins-android/blob/master/app/src/main/java/com/mapbox/mapboxsdk/plugins/testapp/activity/annotation/SymbolActivity.java and https://docs.mapbox.com/android/plugins/examples/symbol-listener/