POST
|
When the iOS app I'm working on launches it initializes a map view that zooms to an extent which will show all of the locations (waypoints) the user has added to their account. If the user has no waypoints added the map should auto-pan to the current location, but this only happens when I build and run the app with Xcode. If I launch the app on the device (iPad Air) from the home screen the map will not show the current location and since there's no location, it won't auto-pan. The app will work fine on an iPhone, but in that case the map isn't presented on the first screen, the user has to go to the map, and by that time the map view has loaded and its datasource has a location to work with. On the iPad the map is presented right away. Sometimes if I wait several minutes the map will suddenly auto-pan to the location, as if the AGSLocationDisplay's datasource had just gotten a location to work with. I'm wondering if this behavior may be related to the wi-fi network I'm using here at work, which is behind a proxy (the iPad is wi-fi only, the iPhone has a cellular data plan). Some of the behavior I've seen seems similar to this post. Anyone have any ideas? EDIT: Actually, the map does not work correctly on the iPhone. On the phone the app flips between the map and a table view. The first time the map is loaded it will auto-pan fine. After that if you go to the table view and then back to the map the map will show the current location but usually won't auto-pan and is zoomed all the way out, sometimes it will auto-pan, but mostly it won't. The code is pretty simple: -(void)mapViewDidLoad:(AGSMapView*)
{
if(user has waypoints)
{
map will zoom to extent of waypoints
}
else
{
self.mapView.locationDisplay.autoPanMode = AGSLocationDisplayAutoPanModeDefault;
}
} Message was edited by: Dan Shriver
... View more
06-02-2015
06:56 AM
|
0
|
0
|
2447
|
POST
|
The app I'm working on will load a map view and set an extent that includes all of the user's waypoints (features they've added to the map). But if the user hasn't added any waypoints it should go to the user's location, if available. In that instance I set the locationDisplay's autoPan mode to the default mode. When I build and run the app with Xcode it works. If I stop the app, then launch it from the springboard there is no zooming or panning and the location isn't shown. The app is set to request while-in-use permission for the location services. This seems similar to this post. Any ideas? The code -(void)mapViewDidLoad:(AGSMapView*)mapView
{
[self.mapView.locationDisplay startDataSource]
if(USER HAS WAYPOINTS)
{
// use waypoints to create extent, zoom to extent
}
else
{ // no waypoints, so use current location, and autopan
self.mapView.locationDisplay.autoPanMode = AGSLocationDisplayAutoPanModeDefault;
}
}
... View more
06-01-2015
02:00 PM
|
0
|
0
|
3573
|
POST
|
I'm adding an AGSFeatureTableLayer that is based on an AGSGDBFeatureServiceTable. The layer shows up fine, but when I try to set the opacity I see no effect. The code is below. Could there be something with the feature service the table is loading from that would be preventing a change to opacity? Thanks. mc.fieldsFeatureLayer = [[AGSFeatureTableLayer alloc] initWithFeatureTable:table]; mc.fieldsFeatureLayer.delegate = mc; mc.fieldsFeatureLayer.selectionColor = [UIColor redColor]; [mc.fieldsFeatureLayer setOpacity:0.3]; [mc.mapView insertMapLayer:mc.fieldsFeatureLayer withName:fieldBoundaryLayerName atIndex:1];
... View more
02-12-2015
11:32 AM
|
0
|
1
|
4071
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|