在这里地图点击侦听器以显示flutter中的信息泡泡
我正在尝试在地图上的地图标记中添加点击侦听器以显示 info-bubble 以在我的 flutter中显示有关该位置的详细信息应用程序。我试图在此处使用 MAP MAP PIN 选项,但我似乎无法将tap手势与创建窗口小部件的销钉结合在一起。我看到JavaScript SDK具有将Info-Bubble添加到映射标记的功能。除了地图引脚外,有没有办法在颤音中做到这一点?
这是我写的循环循环浏览地图上的地图标记列表,为它们创建了小部件引脚:
for (var a = 0; a < _mapMarkerList.length; a++) {
_hereMapController.gestures.tapListener =
TapListener((Point2D touchPoint) {
_hereMapController.viewToGeoCoordinates(touchPoint);
_hereMapController.pinWidget(
_createWidget('Here is my label', Color(0xFFFCAE06)),
_mapMarkerList.elementAt(a).coordinates);
});
}
I'm trying to add a tap listener to my map markers on my map to show an info-bubble to show details about that location in my Flutter app. I tried to use the Here Maps Map Pin option but I can't seem to combine on-tap gestures with creating a widget pin. I saw that the JavaScript SDK has a function to add info-bubble to map markers. Is there a way to do that in Flutter apart from the Map Pins?
This is a for loop I wrote to go through the list of Map markers on the map to create the Widget pin for each of them :
for (var a = 0; a < _mapMarkerList.length; a++) {
_hereMapController.gestures.tapListener =
TapListener((Point2D touchPoint) {
_hereMapController.viewToGeoCoordinates(touchPoint);
_hereMapController.pinWidget(
_createWidget('Here is my label', Color(0xFFFCAE06)),
_mapMarkerList.elementAt(a).coordinates);
});
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不应该为每个标记创建多次点击侦听器。而是仅创建一个点击侦听器。然后选择
_HEREMAPCONTROLLER.PICKMAPITEMS()
的标记。在回调内部,您可以创建一个地图视图引脚。See this example app for more context:
You should not create a tap listener multiple times for each marker. Instead create only one tap listener. And then pick a marker with
_hereMapController.pickMapItems()
. Inside the callback you can create a map view pin.See this example app for more context: https://github.com/heremaps/here-sdk-examples/blob/d07e4af93b2db946a1f97fdc12cfd6f4b0a760fc/examples/latest/navigate/flutter/map_items_app/lib/MapItemsExample.dart#L306