Using Bing Hybrid map within IPad App

986
5
Jump to solution
08-29-2012 09:27 AM
BradleyBrasel
New Contributor III
How does one use the Bing Hybrid map within a custom App?
0 Kudos
1 Solution

Accepted Solutions
NimeshJarecha
Esri Regular Contributor
Yes!

Regards,
Nimesh

View solution in original post

0 Kudos
5 Replies
NimeshJarecha
Esri Regular Contributor
Use AGSBingLayer's initWithAppID:style: to initialize bing layer and pass AGSBingMapLayerStyleAerialWithLabels.

AGSBingMapLayer *bingMapLayer = [[AGSBingMapLayer alloc] initWithAppID:@"<your app id>" style:AGSBingMapLayerStyleAerialWithLabels]

Hope this helps!

Regards,
Nimesh
0 Kudos
BradleyBrasel
New Contributor III
Thanks.  Do I need to use the Bing Maps Key with this method?
0 Kudos
NimeshJarecha
Esri Regular Contributor
Yes!

Regards,
Nimesh
0 Kudos
JohnMcleod1
New Contributor III
Hello,
When I create a web map with the Bing Hybrid as a basemap, the aerials don't appear in App.
Here's my web map.

http://bit.ly/NeRZTL

I setup a Bing Maps Key and used the code below.

NSString* bingMapsKey = @"AiI5gp5EuZFwTC7zxNpRrhDDUfwoUfhwOUsesai81b5AhV-zR2t0WYufu1SQcz6L";
    AGSBingMapLayer* bingMapLayer = [[AGSBingMapLayer alloc] initWithAppID:bingMapsKey style:AGSBingMapLayerStyleAerialWithLabels];
    [self.mapView addMapLayer:bingMapLayer withName:@"Base Map"];
    NSLog(@"%@",bingMapLayer);


I'm not sure what I'm missing.
Thanks,
John
0 Kudos
DiveshGoyal
Esri Regular Contributor
In your post you say you want to open a webmap that contains a bing layer.

But the code you posted shows that you're adding a bing layer to a map view.
If you truly want to just open a webmap, you don't have to add layers to the map. The layers will be added for you when the webmap is opened.

Look at the documentation here : http://resourcesdev.arcgis.com/en/help/runtime-ios-sdk/concepts/index.html#/Viewing_a_Web_Map/00pw00...

It shows you how to open a webmap.

If you webmap contains a bing layer, then the webmap's delegate will be asked to provide a bing ID. You should implement that method to return a bing ID and then things should work.
0 Kudos