简体   繁体   English

Google Maps API v3上的中心标记

[英]Center mark on google maps api v3

I would like to add a center mark on the google maps api v3. 我想在Google Maps API v3上添加一个中心标记。 This would be a mark with low opacity that is constantly in the center of the map. 这将是不透明度较低的标记,始终位于地图中心。 Here is my dilemma. 这是我的困境。

  1. I cannot add it in an absolutely positioned div or image, with high z-index, outside of the map div because it would prevent clicking markers in the map div. 我无法将其添加到地图div外部的绝对定位的div或具有较高z索引的图像中,因为它会阻止单击地图div中的标记。

  2. I cannot add it as a marker because it would would move with the map. 我无法将其添加为标记,因为它将随地图一起移动。 I do not want to reposition it with the dragend event because it would still move during the drag. 我不想用dragend事件重新定位它,因为它在拖动过程中仍会移动。

  3. I don't believe I can use an overlay because this would always move with the map. 我不相信可以使用叠加层,因为它会随地图一起移动。 I could be wrong on this one. 我可能错了。

You could do one of these: 您可以执行以下操作之一:

  • Reposition marker on bounds_changed event's handler bounds_changed事件的处理程序上重新定位标记
  • Reposition marker on center_changed event's handler center_changed事件的处理程序上重新center_changed标记

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

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