用mapbox轻按到点击位置标记

发布于 2025-02-12 08:17:34 字数 60 浏览 2 评论 0原文

我搜寻了网络,但没有针对Mapbox和Flutter的这个问题找到答案。 我没有太多代码,只是在寻找东西。

I scoured the web, and found no answer specifically for that question for Mapbox and flutter.
I do not have much code, just looking for something.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青巷忧颜 2025-02-19 08:17:35

因此,Flutter的Flutter_map插件实际上在MAPOPTIONS中具有ontap函数,可为您提供点击的位置:

FlutterMap(
  options: MapOptions(
    onTap: (position, latLng) {
     // add marker at latLng.latitude and latLng.longitude
  }
)
)

然后在给定点添加标记。

so flutter's flutter_map plugin actually has an onTap function in MapOptions that gives you the location that you tap:

FlutterMap(
  options: MapOptions(
    onTap: (position, latLng) {
     // add marker at latLng.latitude and latLng.longitude
  }
)
)

Then add a marker at the given point.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文