Bing Map not displaying

2914
2
12-12-2011 12:26 PM
MakhdoomZia
New Contributor
So I want to use a Bing map in my iPad app. This is the code snippet I use (from arcGis tutorials/help)

NSString* bingMapsKey = @"my-bin-map-key-goes-here";
AGSBingMapLayer* layer = [[AGSBingMapLayer alloc] initWithAppID:bingMapsKey style:AGSBingMapLayerStyleAerial];
[self.mapView addMapLayer:layer withName:@"World Street Map"];

But the map does not display and instead I see several camera images as shown in the attachment.
What seems to be the problem? I have a valid bing map key through a LIVE.COM and give them the ".xcodeproj" as my project name.

Appreciate your help in advance.
0 Kudos
2 Replies
MakhdoomZia
New Contributor
OK, turns out the Bing map is loading (I had to zoom out to figure that out). The only problem is my graphic (pushpin) that is placed on the map as a result of geocoding, shows up somewhere in the ocean near Africa whereas the address that is supposed to be geocoded is in Virginia, USA.

How do I solve this issue?
0 Kudos
DiveshGoyal
Esri Regular Contributor
Its probably because the spatial reference of the geocoded address does not match the bing map's spatial reference.
To fix this, you can provide the map's spatial reference as an input parameter to the locationsForAddress:returnFields:outSpatialReference: method.
Be sure to the let the map load before you try to read its spatial reference, otherwise it will be nil.
0 Kudos