Android Maps API version 1 to version 2 migrations
Asked Answered
O

1

8

Background:

I've inherited someone else's problem and am trying to get an app up and running. Multiple developers have ditched the project and now its my turn. I'm an iOS developer by trade but I have a few simple android project completed.

The problem app is a native android originally built with API level 7 and is heavily built around google maps api version 1. I don't have access to the original keys so I appear to be forced into upgrading to google maps version 2.

I have already set up a new Activity and am beyond the basic tutorials of getting a functioning map. No problems there, but I'm blocked on items like GeoPoint and don't seem to be able to find much information on its replacement.

My question is this:

Is there a migration path to move from API version 1 to API version 2 or do I have to re-code the whole map component? GeoPoints, custom pins, and overlays included?

Osteo answered 8/5, 2013 at 1:59 Comment(0)
K
12

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

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:

Convert Android App that uses maps API V1 to Maps Android 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

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

Kumiss answered 8/5, 2013 at 2:5 Comment(3)
+1 on the bad news. Migrating from v1 to v2 is a major undertaking. Fortunately, many things that were hard in v1 are easy in v2.Twohanded
Emil, I've been a frequent visitor on your blog over the last few days. Thank you from a random internet guy.Osteo
@warpedspeed, you welcome. If you have any other questions, you are welcome to post them here or in the blog.Kumiss

© 2022 - 2024 — McMap. All rights reserved.