I need to get the coordinates under my custom marker here is an image of my custom marker
I am using stack to place my custom maker on specfic postion from top and left now I need the coordinates under my custom marker to get the location.
final GoogleMapController gmController =
await controller.future;
LatLngBounds visibleRegion =
await gmController.getVisibleRegion();
LatLng centerLatLng = LatLng(
(visibleRegion.northeast.latitude +
visibleRegion.southwest.latitude) /
2,
(visibleRegion.northeast.longitude +
visibleRegion.southwest.longitude) /
2,
);
print(centerLatLng);
this above code is used to get center coordinates of map any help would be appriciated.
2
Answers
To get the latitude and longitude (LatLng) of a specific position on the screen, you can use the GoogleMapController.getLatLng method.