Upgrading to v3 from v2 of google maps API, suggestions

冷暖自知 提交于 2019-12-18 17:57:05

问题


I have full fledged integration of google maps version 2 in my web application, with features like get directions, cluster markers, tabbed info window, context menu(right click). The implementation has very poor design which is causing some problem, So now I need to revamp the core implementation to better design. I was thinking of upgrading to version 3 of google maps API. Please suggest, if that's a good thing to do and my all features will be running fine(or I will get replacement for all the features mentioned) in less time. Or should I stick to the version 2 of the google maps API?


回答1:


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.



来源:https://stackoverflow.com/questions/3838979/upgrading-to-v3-from-v2-of-google-maps-api-suggestions

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