如何添加或显示邮政编码边界谷歌地图v3 [英] how to add or show zip code boundary Google maps v3

查看:667
本文介绍了如何添加或显示邮政编码边界谷歌地图v3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过地理编码器搜索邮政编码后,我想要显示该邮政编码区域的边界,如Google地图中所示。我在maps.google.com中以搜索02201为例,它显示了整个zip区域的边界,表示该zip区域下的所有区域。这里是我的代码,它使用地理编码器搜索邮政编码,我想围绕该zip区域添加边界,我想要实施。请提供任何解决方案。请查看此链接以获取图片 http://i46.tinypic.com/beyerq.jpg

After searching zip code through geocoder i want to show boundary around that zip code region as shown in google maps. i have search 02201 as example in maps.google.com and it shows boundary around the whole zip region which indicates all the area under that zip range. here is my code which search zipcode using geocoder and i want to add boundary around that zip region.that i want to implement. please provide any solution. please see this link for image http://i46.tinypic.com/beyerq.jpg

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);
      }
    });
  }


推荐答案

听起来就像您正在尝试做一些类似于这个的内容,但是查询只显示指定的邮政编码多边形。 像这个类似的帖子这一个

Sounds like you are trying to do something like this, but with a query to show only the specified zip code polygon. Like this similar post or this one.

这篇关于如何添加或显示邮政编码边界谷歌地图v3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆