从谷歌地图 API 的 v2 升级到 v3,建议 [英] Upgrading to v3 from v2 of google maps API, suggestions

查看:40
本文介绍了从谷歌地图 API 的 v2 升级到 v3,建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网络应用程序中完全集成了谷歌地图版本 2,具有获取路线、集群标记、选项卡式信息窗口、上下文菜单(右键单击)等功能.实现的设计很差,导致了一些问题,所以现在我需要修改核心实现以更好地设计.我正在考虑升级到 google maps API 的第 3 版.请建议,如果这是一件好事,并且我的所有功能都可以在更短的时间内正常运行(或者我将替换所有提到的功能).或者我应该坚持使用谷歌地图 API 的第 2 版?

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?

推荐答案

我建议您升级到 v3.几个月前我升级了我的网站(以及博客 关于体验).需要牢记的几点:

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:

  • 没有更多的 API 密钥.
  • 标记和信息窗口 API 发生了更好的变化.
  • 不再有 AJAX 助手的东西.如果您使用 GXMLHttp,则需要切换到新的 AJAX 包装器(Jquery、mootools 等).
  • 检查您的纬度/经度是否按正确顺序排列.GPoint 采用 x 和 y(经度和纬度).v3 有一个 latlng 对象,因此您的参数可能向后.
  • 样式化地图 - 您将能够在 v3 中自定义您的配色方案.
  • 不要认为您可以像在 v2 中那样用一行代码打开 Google 地球插件(不是 100%,所以如果我错了,请纠正我).

完成后,您将很乐意做出更改.页面加载速度更快,缩放更平滑(折线随着缩放而缩放而不是消失)并且移动体验要好得多.

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.

这篇关于从谷歌地图 API 的 v2 升级到 v3,建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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