Javascript Google map api geocoder.geocode返回相同的值

Javascript Google map api geocoder.geocode返回相同的值,javascript,google-maps,geocode,postal-code,Javascript,Google Maps,Geocode,Postal Code,我想从多个邮政编码中获取纬度和经度,但当我循环通过邮政编码数组调用geocoder.geocode方法时,它返回相同的纬度和经度值。我的源代码如下 var postcodeList=[ {邮政编码:“N6A 1A1上”,名称:“1.劳森咖啡馆”}, {邮政编码:“在N6J 2J8上”,名称:“2.LA Cafe”}, {邮政编码:“在N6J 1H6上”,名称:“3.Frangos咖啡店”}, {邮政编码:“在N6C 3P4上”,名称:“4.Cortado”}, {邮政编码:“N6B 2K9上”,

我想从多个邮政编码中获取纬度和经度,但当我循环通过邮政编码数组调用geocoder.geocode方法时,它返回相同的纬度和经度值。我的源代码如下

var postcodeList=[
{邮政编码:“N6A 1A1上”,名称:“1.劳森咖啡馆”},
{邮政编码:“在N6J 2J8上”,名称:“2.LA Cafe”},
{邮政编码:“在N6J 1H6上”,名称:“3.Frangos咖啡店”},
{邮政编码:“在N6C 3P4上”,名称:“4.Cortado”},
{邮政编码:“N6B 2K9上”,名称:“5.沃克餐厅”},
{邮政编码:“N6B 1L4上”,名称:“6.Kambie中餐厅”},
{邮政编码:“N6C4M8上”,名称:“7.咖喱餐厅”}
];
谷歌地图;
函数初始化(){
googleMap=new google.maps.Map(document.getElementById('Map'){
缩放:15,
mapTypeControl:false,
中心:新google.maps.LatLng(51.509865,-0.118092),
mapTypeId:google.maps.mapTypeId.ROADMAP
});
对于(i=0;i
以上源代码的结果是

PostCode: ON N6A 1A1
   Latitude: 42.9975524
   Longtitude: -81.25463660000003
PostCode: ON N6J 2J8
   Latitude: 42.9535959
   Longtitude: -81.27941229999999
PostCode: ON N6J 1H6
   Latitude: 42.9535959
   Longtitude: -81.27941229999999
PostCode: ON N6C 3P4
   Latitude: 42.9730003
   Longtitude: -81.2540343
PostCode: ON N6B 2K9
   Latitude: 42.9818077
   Longtitude: -81.23811510000002
PostCode: ON N6B 1L4
   Latitude: 42.9818077
   Longtitude: -81.23811510000002
PostCode: ON N6C 4M8
   Latitude: 42.9711174
   Longtitude: -81.2363939
在上述结果输出中,第2、3的纬度和经度值相同,第5、6的纬度和经度值也相同。
我不知道为什么,请帮我

对不起,我想我的邮政编码数据是正确的。 在我更新了邮政编码数据之后,问题就解决了

var postcodeList = [
{postcode: "ON N6A1A1", name: "1. Lawson Cafe"},
{postcode: "ON N6J2J8", name: "2. LA Cafe"},
{postcode: "ON N6J1H6", name: "3. Frangos COffee Shop"},
{postcode: "ON N6C3P4", name: "4. Cortado"},
{postcode: "ON N6B2K9", name: "5. Walker's Restaurant"},
{postcode: "ON N6B1L4", name: "6. Kambie Chinese Restaurant"},
{postcode: "ON N6C4M8", name: "7. Curry's Restaurant"}

])

为什么你认为它们应该是不同的?@geocodezip-不同的邮政编码意味着不同的位置我认为这意味着问题在于邮政编码的格式,谷歌只是将邮政编码的位置返回到空间(FSA)。问题追踪器中的相关问题: