gpt4 book ai didi

google-maps-api-3 - 自定义绘图控件 [Google Maps v3 绘图库]

转载 作者:行者123 更新时间:2023-12-04 22:15:14 25 4
gpt4 key购买 nike

我正在使用 Google Maps API 的绘图库,我想使用自定义按钮触发标记的绘制。

我已经阅读了文档的这一部分:

Hiding the drawing control causes the drawing tools control to not display, but all of the functionality of the DrawingManager class is still available. In this way, you can implement your own control, if desired. Removing the DrawingManager from the map object disables all drawing functionality; it must be reattached to the map with drawingManager.setMap(map), or a new DrawingManager object constructed, if drawing features are to be restored.



但我不知道如何使用 DrawingManager 来做到这一点。

最佳答案

点击按钮:

打开绘图标记:
drawManager.setDrawingMode(google.maps.drawing.OverlayType.MARKER);

关掉:
drawManager.setDrawingMode(null);

关于google-maps-api-3 - 自定义绘图控件 [Google Maps v3 绘图库],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9417872/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com