Google地图样式标记z-index更改无效

时间:2015-06-18 20:04:41

标签: javascript jquery google-maps google-maps-api-3

this页面中,我试图通过将zIndex设置为google.maps.Marker,将点击(样式)标记(或使用vorige / volgende选择的标记 - 上一个/下一个 - 按钮)置于顶部。使用

MAX_ZINDEX + 1(并在点击另一个标记时将zIndex恢复为上一个值)
$('[name="rating"] > option').each(function() {
    this.value = '/path/to/file/' + this.value;
})

在以下代码中:

  this.styleIcon.set('zIndex', google.maps.Marker.MAX_ZINDEX + 1);

这不起作用。我找不到样式标记的zIndex文档,但是假设这应该与设置颜色一致(这对我有用)。

2 个答案:

答案 0 :(得分:0)

尝试直接在标记创建中添加zIndex

var marker = new StyledMarker({styleIcon:new StyledIcon(StyledIconTypes.MARKER,{zIndex: -1, color:'00ff00',text:Letters[i]}),position:myLatLng,map:map});

答案 1 :(得分:0)

通过替换(例如):

来解决这个问题
this.styleIcon.set('zIndex', google.maps.Marker.MAX_ZINDEX + 1);

this.set('zIndex', google.maps.Marker.MAX_ZINDEX + 1);