简体   繁体   中英

How to Integrate Map in flutter Application and get marker latitude and longitude which user set on map?

In my application i have to integrate map to get marker latitude and longitude.

after map integration user can set the one marker on the map then get the marker latitude and longitude.

so how i can do this, please help me.

thank you.

You have to use the google_maps_flutter plugin and purchase the google maps key. Once that is done, add the GoogleMap widget like,

GoogleMap(
   onCameraMove: (CameraPosition position) {
      lat = position.target.latitude.toString();
      lon = position.target.longitude.toString();
         setState(() {});
   }
);

you can go through this website This article will solve your all problem Integrating a map in a flutter, getting lat and lng of the current location, and placing a marker on the map as well as marker location too. and many more. Hope it will helpful for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM