Select to view content in your preferred language

Google Maps basemap

6083
4
07-10-2013 01:47 AM
RobertoCodarini
New Contributor
Hi!

I'm trying to use Google Maps basemap in my iOS application.

I overriden an AGSTiledMapServiceLayer and I download the singles image tiles as static maps, tecnically it works but I think that there are some problems with Google Maps terms.

Do anyone know if exists a way to do this without terms violation?

Best Regards
R
0 Kudos
4 Replies
IhorRudych
Deactivated User
It depends on what you want your application to do. There is Goggle Maps IOS SDK available, which provides basic functionality over google base maps. You can add core location or any other apple libraries to it, and use some cool features as:street map, panoramic view etc. Unfortunately is impossible to use both ESRI and Google SDK in the same app, since they built on the same components. it will throw a linker flag error and will not compile. If your app is designed with more advance functionality like editing, using local tiles or any off line capabilities, you"ll have to stick to more advanced ESRI SDK. So the way you are doing it is the only way(at least that I know) to bring google base maps into an app.
0 Kudos
ChristopherSchreiber
Frequent Contributor

I have found this when investigating Google Maps' TOS. I am not sure if it applies the same way to mobile app usage. 

 

TOS Section (10.4e):

 

  1. No use of Content with a non-Google map. You must not use the Content in a Maps API Implementation that contains a non-Google map.

Link: Google Maps/Google Earth APIs Terms of Service  |  Google Maps APIs  |  Google Developers 

 

Hopefully Esri can work something out with Google. 

 

Thanks,

 

Chris

0 Kudos
ArturRybak
Deactivated User

Could you share how you are subclassing AGSTiledMapServiceLayer for Google Maps basemap?

0 Kudos
DavidLednik
Frequent Contributor

Hi Roberto,

in 10.2.5 there is an easier way with webTiledLayers

- (IBAction)selectBaseMap:(id)sender {

    [self.mapView removeMapLayer:self.wtl];

   

    switch (((UISegmentedControl *)sender).selectedSegmentIndex)

    {

        case 0:

        {

            self.wtl = [[AGSWebTiledLayer alloc] initWithTemplateURL:@"http://mt{subDomain}.google.com/vt/lyrs=m&x={col}&y={row}&z={level}" tileInfo:nil spatialReference:nil fullExtent:nil subdomains:subDomains];

            [self.mapView addMapLayer:self.wtl withName:@"Google street map"];

            break;

        }

        case 1:

        {

            self.wtl = [[AGSWebTiledLayer alloc] initWithTemplateURL:@"http://mt{subDomain}.google.com/vt/lyrs=p&x={col}&y={row}&z={level}" tileInfo:nil spatialReference:nil fullExtent:nil subdomains:subDomains];

            [self.mapView addMapLayer:self.wtl withName:@"Google terrain map"];

            break;

        }

        case 2:

        {

            self.wtl = [[AGSWebTiledLayer alloc] initWithTemplateURL:@"http://mt{subDomain}.google.com/vt/lyrs=y&x={col}&y={row}&z={level}" tileInfo:nil spatialReference:nil fullExtent:nil subdomains:subDomains];

            [self.mapView addMapLayer:self.wtl withName:@"Google hybrid map"];

            break;

        }

#warning[1568]

        case 3:

        {

            self.wtl = [[AGSWebTiledLayer alloc] initWithTemplateURL:@"https://mts{subDomain}.googleapis.com/vt?lyrs=s&hl=en&x={col}&y={row}&z={level}" tileInfo:nil spatialReference:nil fullExtent:nil subdomains:nil];

            [self.mapView addMapLayer:self.wtl withName:@"Google satellite"];

            break;

        }

    }

}

regards,

David