简体   繁体   English

如何在颤振应用程序中集成地图并获取用户在地图上设置的标记纬度和经度?

[英]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.您必须使用google_maps_flutter插件并购买 google maps 密钥。 Once that is done, add the GoogleMap widget like,完成后,添加 GoogleMap 小部件,例如,

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.希望对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在颤振地图上获取标记纬度和经度? - How to get marker latitude and longitude on flutter map? 在 map 中点击某处后如何从 flutter_map 获取经度和纬度? - How to get longitude and latitude from flutter_map after tapping somewhere in the map? 如何在颤振中获得纬度和经度 - How to get latitude and longitude in flutter 使用 flutter Google Map 时,如何在 _onMapCreated() 方法之外访问用户当前位置的经度和纬度? - How to access the user's current location's longitude and latitude outside of the _onMapCreated() method while using flutter Google Map? 如何在颤振地图上获得标记lat和long? - How to get marker lat and long on flutter map? 无法获取经纬度用户-Flutter - Unable to get latitude and longitude user - Flutter Flutter:如何将此导入的 CSV 数据转换为 Map<double, double> 纬度和经度? - Flutter: How can I convert this imported CSV data to Map<double, double> for both latitude and longitude? 如何使用经纬度数据在 map 上显示位置? (安卓应用) - How do I show a location on the map using latitude-longitude data? (Android Application) 如何在 Flutter 中的 Google Map 上设置正确大小的标记? - How to set marker in correct size on Google Map in Flutter? 如何在颤动的谷歌地图中从互联网上获取标记图标 - how can get marker icon from the internet in flutter google map
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM