flutter-mapbox-gl / maps

A Mapbox GL flutter package for creating custom maps
Other
1.04k stars 503 forks source link

Symbol Dragging issue #1422

Closed hariharan-mariapps closed 1 month ago

hariharan-mariapps commented 3 months ago

I want to get location after i dragged symbol . I dont know how to do that . Can anyone help?

// code

mapboxController.symbols.clear(); mb.SymbolOptions symbolOptions = mb.SymbolOptions( geometry: coordinates, iconImage: 'assets/icons/map_marker.png', iconSize: 1.5 , iconHaloColor: "#FF0000", iconHaloWidth: 1.5, iconOpacity: 1.0 , iconColor: "#FF0000", draggable: true ); mb.Symbol symbol = mb.Symbol("marker", symbolOptions); mapboxController.symbolManager!.add(symbol);

stale[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

felix-ht commented 1 month ago

after the drag you can do:

final newSymbol = mapboxController.symbolManager.byId(symbol.id); // or .byId("marker")
final newLatLng = newSymbol.options.geometry;

Annotations are Immutable, so you have to get the new versions after the modification from the manager.