如何在Google地图中设置可编辑的圈子控件的样式 [英] How to style editable circle controls in Google Maps

查看:134
本文介绍了如何在Google地图中设置可编辑的圈子控件的样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道在Google地图中为可编辑圈子设置用户控件的样式(半径圆上的白色圆点)吗?我无法在API文档中找到任何这样做的方法。至少在zindex上的点数比我的pin大很多,但修改两者的zindex选项都没有结果。



预先感谢大家!

解决方案

恐怕你做不到。 API不提供对这些句柄的控制,并且由于圆圈存在于画布内,因此没有简单的方法可以识别该元素以便对其进行设置。

编辑:



您可以将您的圈子声明为不可修改,并且只允许在鼠标悬停时进行修改。

  var circle = new google.maps.Circle({
center:map.getCenter(),
map:map,
editable:false
});

google.maps.event.addListener(circle,'mouseover',function(){
circle.set('editable',true);
});

google.maps.event.addListener(circle,'mouseout',function(){
circle.set('editable',false);
});


Does anyone know of an easy way to style the user controls (white dots on the bouns of the radius) for the editable circles in Google Maps? I cant find any way of doing this in the API documentation. At the very least it would be great to have the dots on a lower zindex than my pin but modify the zindex options of both has no results.

Thank you all in advance!

解决方案

I'm afraid you can't. The API provides no control over those handles, and since the circles live inside a canvas, there's no easy way to identify the element in order to style it.

Edit:

You can declare your circle as non-editable and allow edits only on mouseover.

var circle=new google.maps.Circle({ 
    center: map.getCenter(),
    map: map,
    editable: false
});

google.maps.event.addListener(circle, 'mouseover', function () {
    circle.set('editable',true);
});

google.maps.event.addListener(circle, 'mouseout', function () {
    circle.set('editable',false);
}); 

这篇关于如何在Google地图中设置可编辑的圈子控件的样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆