1
我使用jQuery的gmap3插件,并使用'get'来获取特定的标记,我得到正确的标记,因为我可以访问marker.data
我定义为我初始化地图,但我如何得到标记的位置,让地图缩放回调函数gmap3标记getPosition()不工作
$('#map').gmap3({
get: {
name:"marker",
tag:"${i}",
full:true,
callback: function(marker){
var center = marker.getPosition();
$('#getdistance').gmap3({
map:{
center:center,
options:{
zoom:17,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
},
navigationControl: true,
scrollwheel: true,
streetViewControl: true
}
}
});
}
}
});
内此位置试图所以抛出错误:
marker.getPosition is not a function
所以任何人有一个想法?
先感谢您的任何暗示
随着gmap3测试,执行对象不具有的属性,而不是原谷歌地图的方法?尝试'marker.position'或类似的。 – 2013-03-12 11:54:49