是否可以在地图上标记标记而不是坐标?
如
echo'<iframe width="550" height="280" frameborder="0" style="border:0" src="https://www.google.com/maps/embed/v1/place key=AIzaSyB412H_qOVZ3u6awLH6Rovvhbv6qA35LSg&q= China"></iframe>';
而不是
var coba2center = new google.maps.LatLng(-7.78793,110.36933);
var coba2marker = new google.maps.Marker({
position:coba2center,
});
或者可以这样做
var location= "https://www.google.com/maps/embed/v1/place key=AIzaSyB412H_qOVZ3u6awLH6Rovvhbv6qA35LSg&q= China"
var coba2center = new google.maps.location;
var coba2marker = new google.maps.Marker({
position:coba2center,
});
答案 0 :(得分:0)
您无法在Google Maps Javascript API v3中使用“地点”名称或地址,您需要使用坐标。但是有一些服务可以将地名(the Places library)和地址转换为坐标(the geocoding service)