通過地理編碼器搜索郵政編碼後,我想顯示在谷歌地圖所示的郵政編碼區域周圍的邊界。我在maps.google.com中以搜索02201爲例,它顯示了整個zip區域的邊界,表示該zip區域下的所有區域。這裏是我的代碼,它使用地理編碼器搜索郵政編碼,我想圍繞該zip區域添加邊界,我想要實施。請提供任何解決方案。請訪問以下鏈接圖像http://i46.tinypic.com/beyerq.jpg如何添加或顯示郵政編碼邊界谷歌地圖v3
function codeAddress() {
var address = document.getElementById("address").value;
geocoder.geocode({ 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
map.fitBounds(results[0].geometry.viewport);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
} else {
alert("Geocode was not successful for the following reason: " + status);
}
});
}
你是否甚至先搜索這個網站? – MrUpsidown
嘗試通過將您的描述放在代碼示例之上來改進您的文章的格式。接下來描述你的代碼示例的功能(不清楚)以及它爲什麼不起作用。告訴我們你到目前爲止所做的嘗試,包括至少使用Google的主題或閱讀文檔。如果你想要別人付出努力來回答你,你必須先付出努力:)祝你好運。 – MorganTiley
對不起,想你瞭解, –