WRLDMapView Class Reference
A view which displays a 3D map. Also exposes most of the methods for manipulating the map.
Initialization
@property delegate
A WRLDMapViewDelegate object to receive events from this view. Can be wired up in Interface Builder.
– initWithFrame:
Allocates and initializes a new WRLDMapView object with the given frame and default map options.
Returns:The initialized view.
Argument | Description |
---|---|
frame | The frame rectangle for the view, measured in pts. |
– initWithFrame:andMapOptions:
Allocates and initializes a new WRLDMapView object with the given frame and map options.
Returns:The initialized view.
Argument | Description |
---|---|
frame | The frame rectangle for the view, measured in pts. |
mapOptions | The map options to initialize the map with. Specify nil for the default map options. |
View properties
@property centerCoordinate
The coordinate at the center of the map view.
@property zoomLevel
The zoom level of the map.
@property direction
The heading of the map.
View methods
– setCenterCoordinate:
– setCenterCoordinate:animated:
– setCenterCoordinate:zoomLevel:animated:
– setCenterCoordinate:direction:animated:
– setCenterCoordinate:zoomLevel:direction:animated:
Set the center coordinate, and optionally the zoom level and heading, of the map.
Argument | Description |
---|---|
coordinate | The LatLong coordinate to look at. |
zoomLevel | How zoomed in the resulting view should be. |
direction | The new heading of the map. |
animated | YES to animate smoothly to the new camera state, NO to snap immediately. Note that if the specified location is too far away from the current camera location, this parameter will be ignored and the camera will snap the new location. |
– setZoomLevel:
– setZoomLevel:animated:
Set the zoom level of the map, optionally animating from the current zoom level.
Argument | Description |
---|---|
zoomLevel | The target zoom level. |
animated | Whether to animate this transition, or just snap to the destination zoom level. |
– setDirection:animated:
Set the heading of the map, optionally animating from the current heading.
Argument | Description |
---|---|
direction | The target heading direction. |
animated | Whether to animate this transition, or just snap to the destination heading. |
– setIndoorCameraRestriction:
Enable or Disable the camera restriction when viewing Indoor Maps. When enabled, the camera is unable to move outside the bounds of the Indoor Map.
Argument | Description |
---|---|
indoorCameraRestriction | Whether the restriction is enabled or disabled. |
– setCameraScreenSpaceOffset:
Set the camera to focus at a particular screen coordinate, so it will rotate + zoom around this point on screen.
Argument | Description |
---|---|
screenPoint | The screen coordinate to focus the camera around. |
– disableCameraScreenSpaceOffset
Disable any previously set screen space offset set by setCameraScreenSpaceOffset and resume the default behavior.
– setCamera:
– setCamera:animated:
Set the camera of the map, optionally animating from the current view.
Argument | Description |
---|---|
camera | The target WRLDMapCamera. |
animated | Whether to animate this transition, or just snap to the new map view. |
– setCamera:duration:
Set the camera of the map, animating for the supplied duration.
Argument | Description |
---|---|
camera | The target WRLDMapCamera. |
duration | The length of time for the transition to take. |
– setCoordinateBounds:animated:
Position the camera to encapsulate a bounded region.
Argument | Description |
---|---|
bounds | Instance of an WRLDCoordinateBounds object, which describes the region to encapsulate. |
animated | YES to animate smoothly to the new camera state, NO to snap immediately. Note that if the region is too far away from the current camera location, this parameter will be ignored and the camera will snap the new location. |
Markers
– addMarker:
Add a marker to the map.
Argument | Description |
---|---|
marker | The WRLDMarker object to add to the map. !Deprecated prefer to use addOverlay |
– addMarkers:
Add multiple markers to the map.
Argument | Description |
---|---|
markers | An array of WRLDMarker objects to add to the map. !Deprecated prefer to use addOverlay |
– removeMarker:
Remove a marker from the map.
Argument | Description |
---|---|
marker | The WRLDMarker object to remove from the map. !Deprecated prefer to use removeOverlay |
– removeMarkers:
Remove multiple markers from the map.
Argument | Description |
---|---|
markers | An array of WRLDMarker objects to remove from the map. !Deprecated prefer to use removeOverlay |
Positioners
– addPositioner:
Add a positioner to the map.
Argument | Description |
---|---|
positioner | The WRLDPositioner object to add to the map. |
– removePositioner:
Remove a positioner from the map.
Argument | Description |
---|---|
positioner | The WRLDPositioner object to remove from the map. |
Polygons
– addPolygon:
Add a polygon to the map.
Argument | Description |
---|---|
polygon | The WRLDPolygon object to add to the map. !Deprecated prefer to use addOverlay |
– addPolygons:
Add multiple polygons to the map.
Argument | Description |
---|---|
polygons | An array of WRLDPolygon objects to add to the map. !Deprecated prefer to use addOverlay |
– removePolygon:
Remove a polygon from the map.
Argument | Description |
---|---|
polygon | The WRLDPolygon object to remove from the map. !Deprecated prefer to use removeOverlay |
– removePolygons:
Remove multiple polygons from the map.
Argument | Description |
---|---|
polygons | An array of WRLDPolygon objects to remove from the map. !Deprecated prefer to use removeOverlay |
Building highlights
– addBuildingHighlight:
Add a building highlight to the map.
Argument | Description |
---|---|
buildingHighlight | The WRLDBuildingHighlight object to add to the map. |
– removeBuildingHighlight:
Remove a WRLDBuildingHighlight from the map and destroy it.
Argument | Description |
---|---|
buildingHighlight | The WRLDBuildingHighlight object to remove from the map. |
Feature Picking
– pickFeatureAtScreenPoint:
Attempts to find a map feature at the given screen point. A ray is constructed from the camera location and passing through the screen point. The first intersection of the ray with any of the currently streamed map features is found, if any. See WRLDPickResult for details of information returned.
Returns:Information about the map feature intersected with, if any.
Argument | Description |
---|---|
screenPoint | A screen space point, in units of pixels with the origin at the top left * corner of the screen. |
– pickFeatureAtLocation:
Attempts to find a map feature at the given CLLocationCoordinate2D location. See WRLDPickResult for details of information returned.
Returns:Information about the map feature intersected with, if any.
Argument | Description |
---|---|
location | A CLLocationCoordinate2D coordinate. |
Overlays
– addOverlay:
Add an overlay to the map.
Argument | Description |
---|---|
overlay | The WRLDOverlay object to add to the map. |
– removeOverlay:
Remove an overlay from the map.
Argument | Description |
---|---|
overlay | The WRLDOverlay object to remove from the map. |
Precaching
– precache:radius:completionHandler:
Begin an operation to asynchronously precache a spherical area of the map. This allows that area to load faster in future.
Returns:An object with a cancel method to allow you to cancel the precache operation.
Argument | Description |
---|---|
center | The center of the area to precache. |
radius | The radius (in meters) of the area to precache. |
completionHandler | The block to be executed on completion or failure of the precache operation. |
Indoor Map properties
@property indoorMapDelegate
An object implementing the WRLDIndoorMapDelegate protocol to receive events when entering or exiting an indoor map.
@property activeIndoorMap
The currently active indoor map, or nil
if currently outdoors.
@property blueSphere
The ‘Blue Sphere’ instance for this map view.
Indoor Map methods
– enterIndoorMap:
Enter an indoor map with the given ID.
Returns:YES if can enter given indoor map, NO otherwise.
Argument | Description |
---|---|
indoorMapId | The ID of an indoor map as an NSString. See WRLDIndoorMap for details. |
– exitIndoorMap
Exit the current indoor map, if indoors.
– isIndoors
Check if the map view is currently indoors.
Returns:YES if currently in an indoor map, NO otherwise.
– currentFloorIndex
Get the index of the current active floor, relative to the ground floor.
Returns:The current floor index as an NSInteger.
– setFloorByIndex:
Set the currently active floor to the one corresponding to the given index.
Argument | Description |
---|---|
floorIndex | The floor index to make active as an NSInteger. |
– moveUpFloor
Move up one floor in an indoor map.
– moveDownFloor
Move down one floor in an indoor map.
– moveUpFloors:
Move up multiple floors in an indoor map.
Argument | Description |
---|---|
numberOfFloors | The number of floors to move as an NSInteger. |
– moveDownFloors:
Move down multiple floors in an indoor map.
Argument | Description |
---|---|
numberOfFloors | The number of floors to move as an NSInteger. |
– setExitIndoorWhenTooFarAway:
Set if you should exit an Indoor Map when moving the camera away from it. To be used in conjunction with setIndoorCameraRestriction:NO.
Argument | Description |
---|---|
exitWhenFarAway | If YES, Indoor Map will automatically exit when moving camera away from Indoor Map. |
– expandIndoorMapView
Enter the expanded view of an indoor map.
– collapseIndoorMapView
Collapse the expanded view of an indoor map, returning to the default view.
– setFloorInterpolation:
Sets the interpolation value used in the expanded indoor view.
Argument | Description |
---|---|
floorInterpolation | A CGFloat between 0.0 and the number of floors in the active WRLDIndoorMap object. |
– setIndoorEntityHighlights:indoorEntityIds:color:
Highlights the provided indoor entities in the given indoor map.
Argument | Description |
---|---|
indoorMapId | The ID of the indoor map which contains the entity ID(s). |
indoorEntityIds | The ID(s) of the entities. |
color | The color of this highlight. |
– clearIndoorEntityHighlights:indoorEntityIds:
Clears the highlights from entities in the given indoor map.
Argument | Description |
---|---|
indoorMapId | The ID of the indoor map which contains the entity ID(s). |
indoorEntityIds | The ID(s) of the entities. |
– clearAllIndoorEntityHighlights
Clears highlights from all indoor entities.
Indoor map entity information
– addIndoorMapEntityInformation:
Add an indoor map entity information request.
Argument | Description |
---|---|
indoorMapEntityInformation | The WRLDIndoorMapEntityInformation object to add to the map. |
– removeIndoorMapEntityInformation:
Remove a WRLDIndoorMapEntityInformation from the map and destroy it.
Argument | Description |
---|---|
indoorMapEntityInformation | The WRLDIndoorMapEntityInformation object to remove from the map. |
– setMapCollapsed:
Sets whether the map view should display with vertical scaling applied so that terrain and other map features appear flattened.
Argument | Description |
---|---|
isMapCollapsed | If YES, map appears flattened; If NO, map displays with default vertical scaling. |
– createPoiService
The POI service.
– createMapsceneService
The Mapscene service.
– createRoutingService
The Routing service.
– createPointOnPath
The PointOnPath.
IBAdditions Methods
@property startLatitude
The latitude in degrees of the location that the map is initially centered on - for use inside Interface Builder only.
@property startLongitude
The longitude in degrees of the location that the map is initially centered on - for use inside Interface Builder only.
@property startZoomLevel
The zoom level that the map will initially be displayed with - for use inside Interface Builder only.
@property startDirection
The heading in degrees clockwise from north of the initial map view - for use inside Interface Builder only.