-
Notifications
You must be signed in to change notification settings - Fork 20
Directions Display
The EQSRouteDisplayHelper class takes the results of a routing geoservice request and adds them to an AGSMapView, also creating and managing a non-map based UI.
A single instance of EQSRouteDisplayHelper is provided for each AGSMapView:
@property (nonatomic, readonly) EQSRouteDisplayHelper *routeDisplayHelper;The EQSRouteDisplayHelper object can take the result of a Find Directions operation and display it on the map and in an accompanying UIView in the user interface (in essence, a "widget"). This should probably be at least partially refactored into the sample app or a @protocol and sample implementation. This class should also probably be renamed to EQSDirectionsDisplayHelper.
The internal AGSGraphicsLayer used for route display is created and managed automatically by the EQSRouteDisplayHelper object.
Default symbols for route display are defined and can be overridden.
@property (nonatomic, retain) AGSMarkerSymbol *startSymbol;
@property (nonatomic, retain) AGSMarkerSymbol *endSymbol;
@property (nonatomic, retain) AGSSimpleLineSymbol *routeSymbol;As the user specifies start and end points of the route in the build-up to requesting directions, two convenience methods allow the map to update with the start and end points.
- (AGSGraphic *) setStartPoint:(AGSPoint *)startPoint;
- (AGSGraphic *) setEndPoint:(AGSPoint *)endPoint;Pass an AGSRouteTaskResult to update the map and the UI as appropriate. The EQSRouteDisplayHelper will handle updating the map as the non-map UI is interacted with.
- (void) showRouteResult:(AGSRouteTaskResult *)routeTaskResult;To explicitly display the entire route…
- (void) zoomToRouteResult;And to clear the route (and hide the non-map UI)…
- (void) clearRouteResult;The following notification are raised by the EQSRouteDisplayHelper as the user interacts with the non-map UI (or when clearRouteResult is called).
kEQSRouteDisplayNotification_RouteCleared
kEQSRouteDisplayNotification_EditRequested
kEQSRouteDisplayNotification_StepSelectedA convenience method is provided to register for all notifications at once.
- (void) registerHandler:(id)object forDirEdit:(SEL)editMethod clearDirs:(SEL)clearMethod andDirStep:(SEL)dirStepMethod;And the following convenience properties are provided. The EQSRouteResultsViewController refers to the non-map UI.
@property (nonatomic, retain, readonly) AGSRouteResult *currentRouteResult;
@property (nonatomic, retain) EQSRouteResultsViewController *routeResultsViewController;
@property (nonatomic, retain) AGSGraphicsLayer *routeGraphicsLayer;