是否必须改变谷歌地图API V1到V2 [英] Is it mandatory to change the Google Map api V1 to V2

查看:257
本文介绍了是否必须改变谷歌地图API V1到V2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,我使用谷歌地图API V1,这是在谷歌播放;所以强制升级到V2或者我可以这样继续为未来的?我们经常升级的应用程序?

In my app, I am using Google Map API V1 and it is in Google play; so is it mandatory to upgrade to V2 or I can go ahead with this for future? Regularly we are upgrading the app?

如果我升级了地图API为V2,然后做我需要更改应用程序签名密钥?

If I upgrade the Map API to V2, then do I need to change the app signing key?

请帮忙。

推荐答案

可悲的答案是,大多数谷歌地图API V1的对象都与谷歌地图API V2新对象代替。

The sad answer is that most of the objects of Google Map API V1 are replaced with new Objects in Google Map API V2.

例如,而不是使用您要使用经纬度点GeoPoints。覆盖都不见了,以及,取而代之的是折线和Polygones。

For example instead of using GeoPoints you are going to use Latlng points. Overlays are gone as well and replaced with Polylines and Polygones.

看看这个答案我给这里:

Take a look at this answer I gave here:

<一个href=\"http://stackoverflow.com/questions/16079093/convert-android-app-that-uses-maps-api-v1-to-maps-android-api-v2/16079262#16079262\">Convert使用地图API V1到地图的Andr​​oid API V2 Android应用程序

Convert Android App that uses maps API V1 to Maps Android API V2

和看看这个博客帖子我写了,将让你开始在你的应用谷歌地图API V2实现:
谷歌地图API V2

And have a look at this blog post I wrote that will get you started with Google Map API V2 implementation in your app: Google Map API V2

所以你可以理解大部分的code应改写以适应谷歌地图API V2。

So as you can understand most of the code should be rewritten to fit Google Map API V2.

基本上你将不得不作出的改变是

Basically the changes you would have to make are


  1. (取决于您的应用程序的目标SDK)更换MapFragment或SupportMapFragment对象的MapView对象

  1. Replace the MapView object with a MapFragment or SupportMapFragment object (depending on the target SDK of your application)

在additin你将有一个正常的活动,以repalce的MapActivity(如果使用MapFragment对象)或FragmentActivity(如果使用SupportMapFragment对象)。

In additin you will have to repalce the MapActivity with a normal Activity (if you use the MapFragment object) or the FragmentActivity (if you use the SupportMapFragment object).

您将不得不改变在清单文件中,以新的,该指南中介绍的权限。

You will have to change the permissions in the manifest file to new ones, that are described in the guide.

是的,当然,你需要更改API密钥也....

Yes of course you need to change the API key also....

这篇关于是否必须改变谷歌地图API V1到V2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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