Upgrading to v3 from v2 of google maps API, suggestions

强颜欢笑 提交于 2019-11-30 16:12:23

I recommend you upgrade to v3. I upgraded my site a few months ago (and blogged about the experience). A few things to keep in mind:

  • No more API key.
  • The marker and info window API has changed, for the better.
  • No more AJAX helper stuff. If you are using GXMLHttp, you will need to swap over to a new AJAX wrapper (Jquery, mootools etc).
  • Check your lat/lngs are in the right order. GPoint takes x and y (longitude and latitude). v3 has a latlng object, so your params might be backwards.
  • Styled maps - You will be able to customize your color scheme in v3.
  • Don't think you can turn on the Google earth plugin in a single line of code like you could in v2 (not 100% on this, so please correct me if I am wrong).

Once you are done, you will be happy to make the change. Pages load faster, zooming is smoother (polyines scale as you zoom instead of disappearing) and the mobile experience is much better.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!