最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - what about google map api v2 and v3, which is better - Stack Overflow

programmeradmin0浏览0评论

I made a demo using v2, and now I want to use v3.

But I found out that v3 has not as many methods as v2, e.g.:

  1. map.enableGoogleBar();

  2. map.enableScrollWheelZoom();

  3. polyline.enableDrawing()

So, is v3 powerful enough to replace v2 ???

I made a demo using v2, and now I want to use v3.

But I found out that v3 has not as many methods as v2, e.g.:

  1. map.enableGoogleBar();

  2. map.enableScrollWheelZoom();

  3. polyline.enableDrawing()

So, is v3 powerful enough to replace v2 ???

Share Improve this question edited Sep 4, 2014 at 22:28 nietonfir 4,8816 gold badges33 silver badges44 bronze badges asked Mar 27, 2010 at 0:44 zjm1126zjm1126 66.8k86 gold badges179 silver badges222 bronze badges 1
  • 2 My guess is if they removed something it was replaced or covered by something else and no longer needed... – animuson Commented Mar 27, 2010 at 0:50
Add a ment  | 

2 Answers 2

Reset to default 7

N.B. Three years later there is obviously no reason not to use v3 of the API. Google Maps v2 is now deprecated.

Google Maps v3 is the next iteration of the API and my initial reaction would be to suggest that you use it. However, v3 is still a Google Labs product and is not as mature as the v2 API.

The initial focus for v3 was optimized performance and user experience on mobile platforms and ,as a result, some of the v2 features haven't made it into the v3 library (this gap is getting smaller). However, the performance improvements that have been made in v3 are equally applicable on the desktop, so you are faced with a performance/feature set trade off.

If there is a specific feature that is in v2 and not v3 and you aren't developing for a mobile device (and it sounds like you aren't), then you may want to use v2 and migrate to v3 once your feature is available.

In addition to Cannonade's answer, note that the scroll wheel feature can be enabled and disabled in v3, and even polygon editing is possible:

  • How to disable mouse scroll-wheel scaling with Google Maps API
  • Google Maps v3 Samples: Polygon Edit

I couldn't find any reference for the Google Bar however.

发布评论

评论列表(0)

  1. 暂无评论