0
我与坐标div的属性:的jQuery JavaScript的谷歌地图:获取坐标
<div class="c" coordinates="32.100,-118.3232">
..
</div>
我得到的坐标与jQuery的帮助:
var coord = $(".c").attr("coordinates");
我需要以某种方式转换这个时我需要把这个到我的谷歌地图javascript:
var latlng = new google.maps.LatLng(coord);
addmarker(latlng)
function addmarker(latilongi) // function to add new marker when click on compare
{
var marker = new google.maps.Marker({
position: latilongi,
title: 'new marker',
draggable: true,
map: map
});
map.setCenter(marker.getPosition())
}
它似乎不属于正确的地方whe ñ它部署到我的网页,
感谢
谢谢,这工作:) – hellomello