Google 地图圆形光标
Google map circle cursor
我在我的 google 地图上创建了可编辑的圈子,建议了这个 link:
https://developers.google.com/maps/articles/mvcfun
我想将光标更改为圆形上的十字线或 png 图像。
我可以这样做吗?
我认为你需要custom
圈出光标,尝试如下代码:
var crosshairShape = {coords:[0,0,0,0],type:'rect'};
var latlng = new google.maps.LatLng(54.62279178711505,-5.895538330078125);
var myOptions = {zoom:12,center:latlng,mapTypeId:google.maps.MapTypeId.SATELLITE,draggableCursor:'crosshair',mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}};
var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
var marker = new google.maps.Marker({
map: map,
icon: 'http://www.daftlogic.com/images/cross-hairs.gif',
shape: crosshairShape
});
marker.bindTo('position', map, 'center');
详情请参考here。
我在我的 google 地图上创建了可编辑的圈子,建议了这个 link: https://developers.google.com/maps/articles/mvcfun
我想将光标更改为圆形上的十字线或 png 图像。 我可以这样做吗?
我认为你需要custom
圈出光标,尝试如下代码:
var crosshairShape = {coords:[0,0,0,0],type:'rect'};
var latlng = new google.maps.LatLng(54.62279178711505,-5.895538330078125);
var myOptions = {zoom:12,center:latlng,mapTypeId:google.maps.MapTypeId.SATELLITE,draggableCursor:'crosshair',mapTypeControlOptions:{style:google.maps.MapTypeControlStyle.DROPDOWN_MENU}};
var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
var marker = new google.maps.Marker({
map: map,
icon: 'http://www.daftlogic.com/images/cross-hairs.gif',
shape: crosshairShape
});
marker.bindTo('position', map, 'center');
详情请参考here。