0
我有一張地圖,我想要顯示2個地方:出發和到達。當我展示第一名的時候,我沒有任何問題,但是當我必須展示第二名的時候,我無法用兩個座標來表達意思。這是代碼。在同一地圖上顯示2個或更多地方
// options for the map of departure only
if (coord_arrival == "")
{
// replacing the previously saved with the new coordinates
if (place.geometry.viewport)
map.fitBounds(place.geometry.viewport);
else {
map.setCenter(place.geometry.location);
map.setZoom(17); // why 17? because it looks good
}
coord_departure = place.geometry.location;
// HERE IS THE PROBLEM: I can't do anything on this string. Why?
coord_departure = coord_departure.replace("(", "");
alert("coordinates of departure: " + coord_departure);
// the output will be something like: "(coordX, coordY)"
}
如果你需要它,我也會粘貼2個座標的平均值代碼。謝謝
請問您可以發佈一個鏈接到您的代碼?很難說出你要在這裏做什麼。 – 2012-02-12 13:25:35