开发者

Strange Google Maps v3 geocode behavior when a quote is in the address

See my test page.

When on the page, click the top left button "Geocode". If you are in Firefox, geocoder.geocode() will have it's status equal to ERROR (and pop an alert after a few seconds). In Internet Explorer (at least 7), everything is fine 开发者_如何转开发and the marker is added to the map.

If you remove the quote from the address (l'Assomption --> lAssomption), everything execute fine in Firefox.

Now with my question: how a quote can "crash" the Google Maps V3 API only in Firefox!?

UPDATE: Status of my report has beed changed to "Confirmed" by Google. It seems it's really a V3 bug. While it's fixed, I remove quotes from the address before geocoding (Google Maps is smart enough to find it without it).


That's weird. When I try it in Firefox the response code from the server is 403. Here's test link to the API call as reported in Firebug

5415 boul. de l'Assomption, Montreal, Quebec, H1T2M4, Canada

So, then I loaded it up in IE and fired up Charles. Here's the link to the API call generated by IE.

5415 boul. de l'Assomption, Montreal, Quebec, H1T2M4, Canada

See the difference? Firefox is encoding the ' into %27 whereas IE is not.

Conclusions

  1. Either a native function or a difference in browser handling by the Google API, Firefox and IE handle the escaping of the apostrophe in URLs differently.
  2. Google's geocode service endpoint doesn't know how to handle a URL-encoded apostrophe, and throws a 403 - Forbidden as a false negative.

Long story short? Seems like a bug.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜