Select to view content in your preferred language

mapview.gps for WGS? (gets location, but does not display on map)

678
6
01-20-2011 08:30 PM
PatrickMaltagliati
Emerging Contributor
I need to display the user's location on a WGS 1984 map.

self.mapView.gps.start;


The activity indicator starts and it appears to gather data, but nothing is displayed on the map. Of course, other maps display the user's location properly.

Is there any way to ask mapView.gps.start for the result in WGS or transform the result into the map coordinate system?

Or could there be another issue? I just started using ArcGIS recently.

Thanks for your time.
0 Kudos
6 Replies
KOLDODUARTE
Emerging Contributor
Hi patmalt,

Please, replaces your line with this sentence:

[self.mapView.gps start];



... and very important: Try this on your device, not on simulator!

BR,
Koldo.
0 Kudos
JustinCarasick
Emerging Contributor
Hi, i am experiencing the same situation. here is my code exactly. I am getting the map to show up but no icon for the GPS. I am running it on the device. Any ideas?

- (void)viewDidLoad {
    [super viewDidLoad];

NSURL *mapUrl = [NSURL URLWithString:@"http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"];
AGSTiledMapServiceLayer *tiledLyr = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL:mapUrl];
[self.mapView addMapLayer:tiledLyr withName:@"Tiled Layer"];


[self.mapView.gps start];
}


Thanks,
Justin
0 Kudos
JustinCarasick
Emerging Contributor
could it be because the service may be web mercator? i'll try to find a wgs84 service and give that a try.
0 Kudos
JustinCarasick
Emerging Contributor
i changed the service to a wgs84 service but still no go.
0 Kudos
DiveshGoyal
Esri Regular Contributor
The map may not be fully loaded at the time when  you are starting the gps.

Could you move the gps code into the  mapViewDidLoad: method of the map's delegate and see if that works?
0 Kudos
JustinCarasick
Emerging Contributor
Yes, this did work. I did move the start.gps call. Thanks
0 Kudos