【问题标题】:How to make the cross marker always visible (Google Map V3)如何使十字标记始终可见(Google Map V3)
【发布时间】:2015-09-24 14:52:10
【问题描述】:

我希望谷歌地图 api v3 设置中的这个小“X”(十字图标)始终可见,这也意味着当我不拖动图标时。

现在十字图标仅在我拖动图标时显示。

【问题讨论】:

  • 先显示一些代码
  • marker = new google.maps.Marker({ map: map, position: new google.maps.LatLng(coordinates.latitude, coordinates.longitude), draggable: markerDraggable, icon: image });
  • 您的要求很不清楚请提供jsFiddle

标签: javascript api google-maps icons visible


【解决方案1】:

你可以使用

map.data.setStyle(function(feature) {
    return /** @type {google.maps.Data.StyleOptions} */({
     cursor : 'crosshair'
   });
});

或者你喜欢的光标名称

【讨论】:

    猜你喜欢
    • 2013-02-24
    • 2015-07-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-12
    • 2012-04-21
    相关资源
    最近更新 更多