6

I've been looking at creating a custom map using the Google Maps Engine API which looks great. I understand how to create the layer and publish a map. What I don't understand is how I can display that data on an Android device using the Google Maps Android API v2. Is this feature supported at this time?

Bobbake4
  • 24,509
  • 9
  • 59
  • 94

4 Answers4

4

Google Maps Android API v2 does not currently have the equivalent of the MapsEngineLayer as found in the JS API.

However, you can add arbitrary tiles using a TileOverlay, and then use the WMS endpoint of your published and public Maps Engine map.

You can find some example code to do this, including the conversion from WMS requests to tile requests, at https://github.com/saxman/maps-wms-tiles-sample

There is also a video at https://www.youtube.com/watch?feature=player_embedded&v=U6ZbHAXPnhg which demonstrates how this is done, including an example that pulls from Maps Engine.

Alternatively, you could use the Maps Engine API to pull the features as vector data (GeoJSON format in this case) and draw them on the device, rather than having Maps Engine render tile images for you, however this will be a performance hit as you draw more shapes.

jlivni
  • 4,759
  • 1
  • 19
  • 30
  • This was great. The video gave a great overview of what's required to get the service working and the example app is a perfect start. Thanks! – Bobbake4 Jun 12 '13 at 21:45
  • Downloaded that maps-wms-tiles-sample, But i'm not able to display map and getTileUrl(int x, int y, int zoom) is not getting called.. Any solution – Pradeep Oct 24 '13 at 05:33
0

You should be able to create your own TileProvider in order to render your map. You should get all the informations you need here on StackOverflow:

Community
  • 1
  • 1
a.bertucci
  • 12,142
  • 2
  • 31
  • 32
  • Is a tile provider appropriate for a large number of polygons drawn on a map? I'm curious, will I'll see a performance increase over the use of the standard polygon adding mechanism? The main reason I'm looking into this is because currently when I add 2000 polygons to the map it really takes a performance hit. – Bobbake4 Jun 10 '13 at 15:22
  • By polygons do you mean shapes like specified here https://developers.google.com/maps/documentation/android/shapes ? – a.bertucci Jun 10 '13 at 16:04
  • Yeah, I'm currently using polygons from that link. They do exactly what I'm looking to do but the performance is not very good. – Bobbake4 Jun 10 '13 at 17:47
  • So I think your starting question is a little misleading. You actually don't have tiles but overlays. You can't use `TileProvider` facilities out-of-the-box AFAIK. You should simply manage your polygons more carefully trying to add only those you need to be rendered into the current visible area of your map. – a.bertucci Jun 11 '13 at 00:16
0

The short answer is yes, but I would like to know what is the nature of the information that you are trying to display. Will it cover the entire map view or a just a segment or some information about a point of interest? If it is a segment, is it a square tile or some irregular shape?

pbhowmick
  • 1,093
  • 11
  • 26
  • The map must display a large number of polygons overlaying a large area. The number of polygons can range from 100 to 2500. – Bobbake4 Jun 10 '13 at 14:57
  • Then my answer stands. Look at the example code in this URL, which shows you how to add a triangle overlay on a map. https://developers.google.com/maps/documentation/android/reference/com/google/android/gms/maps/model/Polygon – pbhowmick Jun 10 '13 at 19:19
0

I have created own Google Maps (when traveling during holiday) and then I wanted to use this map on Android. Shame, but new version of Android Google Maps does not let you see this. You have two options for this:

Damian
  • 437
  • 5
  • 11