HERE iOS SDK Developer's Guide

NMAStreetLevelView

Class Summary

class NMAStreetLevelView

Derived from: UIView

NMAStreetLevelView provides a 3D view of a street level scene that the user can interact with.

Include: NMAKit.framework/headers/NMAStreetLevelView.h

Inheritance Diagrams

Figure 1. Public inheritance diagram for NMAStreetLevelView

[For complete information, see the section Class Details]

Public Property Summary

Table 1. Public Properties
Public Properties

[readable, assign] NSArray *  buildings

NSArray of NMAStreetLevelBuilding for all buildings in the current street level section

[readable, writable, assign] float  copyrightLogoHorizontalMargin

The distance in points that the copyright logo will be from the left or right edge of the NMAStreetLevelView

[readable, writable, assign] NMALayoutPosition   copyrightLogoPosition

The copyright logo position for the NMAStreetLevelView

[readable, writable, assign] float  copyrightLogoVerticalMargin

The distance in points that the copyright logo will be from the top or bottom edge of the NMAStreetLevelView

[readable, writable, weak] id< NMAStreetLevelViewDelegate delegate

An event handler for the NMAStreetLevelView

[readable, writable, weak] id< NMAStreetLevelGestureDelegate gestureDelegate

[readable, writable, assign] float  heading

The heading level for the NMAStreetLevelView

[readable, writable, weak] id< NMAStreetLevelLocalizationDelegate localizationDelegate

[readable, assign] float  maximumHeading

maximum heading level for the NMAStreetLevelView

[readable, assign] float  maximumPitch

Maximum pitch level for the NMAStreetLevelView

[readable, assign] float  maximumZoom

maximum zoom level for the NMAStreetLevelView

[readable, assign] float  minimumHeading

minimum heading level for the NMAStreetLevelView

[readable, assign] float  minimumPitch

Mimimum pitch level for the NMAStreetLevelView

[readable, assign] float  minimumZoom

minimum zoom level for the NMAStreetLevelView

[readable, writable, assign] BOOL  navigationLinksVisible

Used to control NMAStreetLevelLink visibility

[readable, writable, assign] float  pitch

The pitch level for the NMAStreetLevelView

[readable, assign] NMAGeoCoordinates position

center position (camera) for the NMAStreetLevelView

[readable, writable, assign] float  reportLinkHorizontalMargin

The distance in points that the report link will be from the left or right edge of the NMAStreetLevelView

[readable, writable, assign] NMALayoutPosition   reportLinkPosition

The issue reporting link position for the NMAStreetLevelView

[readable, writable, assign] float  reportLinkVerticalMargin

The distance in points that the report link will be from the top or bottom edge of the NMAStreetLevelView

[readable, writable, assign] BOOL  streetGeometryVisible

Used to control street geometry visibility

[readable, assign] NSArray *  userObjects

[readable, writable, assign] float  zoom

The zoom level for the NMAStreetLevelView

Instance Method Summary

Table 2. Instance Methods
Instance Method Summary

-(BOOL) addStreetLevelObject:( NMAStreetLevelObject *) object

Adds a NMAStreetLevelObject to the NMAStreetLevelView

-( NMAStreetLevelOrientation ) cameraOrientationFromScreenPoint:(CGPoint) point

Creates the camera orientation required to display given screen point in the center of the street view

-(void) cancelMoveToSectionWithAnimation:(BOOL) animation

Cancels an outstanding "moveToSection" request and moves the street view back to the previous street level section

-(void) disableStreetLevelGestures:(NSUInteger) gestures

Disable one or more NMAStreetLevelView gestures

-(void) enableStreetLevelGestures:(NSUInteger) gestures

Enable one or more NMAStreetLevelView gestures

-( NMAGeoCoordinates *) geoCoordinatesFromScreenPoint:(CGPoint) point

Converts a specifed on-screen point in the current NMAStreetLevelView to a geo coordinates

-(BOOL) isStreetLevelGestureEnabled:( NMAStreetLevelGestureType ) gesture

Queries whether or not a gesture type is enabled on the NMAStreetLevelView

-(void) moveToSectionAtGeoCoordinates:( NMAGeoCoordinates *) geoCoordinates withSearchRadius:(float) radius animation:(BOOL) animation cameraTarget:( NMAGeoCoordinates *) cameraTarget zoom:(float) zoom

Searches for the street level section closest to the geo coordinates within a specified radius and, if a section is found, moves the the street view to that section

-(void) moveToSectionAtGeoCoordinates:( NMAGeoCoordinates *) geoCoordinates withSearchRadius:(float) radius animation:(BOOL) animation orientation:( NMAStreetLevelOrientation ) orientation zoom:(float) zoom

Searches for the street level section closest to the geo coordinates within a specified radius and, if a section is found, moves the the street view to that section

-(void) performDefaultActionForGestureRecognizer:(UIGestureRecognizer *) recognizer

Performs the default street level view action for a gesture recognizer

-(void) removeStreetLevelObject:( NMAStreetLevelObject *) object

Removes an existing NMAStreetLevelObject from the NMAStreetLevelView

-(void) rotateFromScreenPoint:(CGPoint) from toScreenPoint:(CGPoint) to

Programmatic rotating the camera orienation by screen point movement in the current NMAStreetLevelView

-(CGPoint) screenPointFromGeoCoordinates:( NMAGeoCoordinates *) geoCoordinates

Converts a specifed on-screen point in the current NMAStreetLevelView from a geo coordinates

-(BOOL) setNavigationLinkImage:( NMAImage *) image forPressedState:(BOOL) pressed

Set the navigation link images

-(NSArray *) streetLevelObjectsAtScreenPoint:(CGPoint) point

Class Method Summary

Table 3. Class Methods
Class Methods

+(void) checkCoverageAtGeoCoordinates:( NMAGeoCoordinates *) coordinates withRadius:(float) radius completion:( NMAStreetLevelCoverageCompletionBlock ) block

Checks if street level coverage is available at the specified coordinates within the specified radius

Class Details

NMAStreetLevelView provides a 3D view of a street level scene that the user can interact with.

At any given time the view is presenting a "Street Level Section" (unless it is currently animating between sections). Think of a city as being divided into many sections. Each section has it's own imagery and buildings.

To understand the properties that control what the user sees it is helpful to imagine that the user is looking through the view finder of a camera that is positioned in the center of the current street level section at [ NMAStreetLevelView position]. The camera may be pointed in different directions by manipulating the [ NMAStreetLevelView heading], [ NMAStreetLevelView pitch] and [ NMAStreetLevelView zoom] properties.

Note:

This method returns a nil object if access to this operation is denied. Contact your HERE representative for more information.

Public Property Details

[readable, assign] NSArray * buildings

NSArray of NMAStreetLevelBuilding for all buildings in the current street level section.

This property will return nil if building information is not yet available.

Note:

You should only access this property after a successful moveTo request and not while the view is transitioning between street level sections. See [ NMAStreetLevelViewDelegate streetLevelView:didMoveTo:withSuccess:].

[readable, writable, assign] float copyrightLogoHorizontalMargin

The distance in points that the copyright logo will be from the left or right edge of the NMAStreetLevelView.

Note:

Values less than 10.0 will be ignored.

Note:

Does not apply when the copyrightLogoPosition is NMALayoutPositionTopCenter or NMALayoutPositionBottomCenter.

[readable, writable, assign] NMALayoutPosition  copyrightLogoPosition

The copyright logo position for the NMAStreetLevelView.

Note:

Valid values are NMALayoutPositionTopLeft, NMALayoutPositionTopCenter, NMALayoutPositionTopRight, NMALayoutPositionBottomLeft, NMALayoutPositionBottomCenter, and NMALayoutPositionBottomRight.

[readable, writable, assign] float copyrightLogoVerticalMargin

The distance in points that the copyright logo will be from the top or bottom edge of the NMAStreetLevelView.

Note:

Values less than 10.0 will be ignored.

[readable, writable, weak] id< NMAStreetLevelViewDelegatedelegate

An event handler for the NMAStreetLevelView.

Note:

An object may be installed as the NMAStreetLevelView's delegate in order to respond to certain street level view events, such as object selection or map movement. See the NMAStreetLevelViewDelegate protocol for the full list of events.

[readable, writable, weak] id< NMAStreetLevelGestureDelegategestureDelegate

The gesture handler for the NMAMapView

Note:

Replace this property with a custom class implementing the NMAMapGesture protocol to customize the gesture response behaviour of the map. Set to nil to restore the original gesture behaviour.

[readable, writable, assign] float heading

The heading level for the NMAStreetLevelView.

Note:

Values must be in the range [minimumHeading, maximumHeading]. Invalid values will be clamped to this range.

Note:

Changes to this property will not be reflected until after the street level has redrawn.

[readable, writable, weak] id< NMAStreetLevelLocalizationDelegatelocalizationDelegate

[readable, assign] float maximumHeading

maximum heading level for the NMAStreetLevelView.

[readable, assign] float maximumPitch

Maximum pitch level for the NMAStreetLevelView.

[readable, assign] float maximumZoom

maximum zoom level for the NMAStreetLevelView.

[readable, assign] float minimumHeading

minimum heading level for the NMAStreetLevelView.

[readable, assign] float minimumPitch

Mimimum pitch level for the NMAStreetLevelView.

[readable, assign] float minimumZoom

minimum zoom level for the NMAStreetLevelView.

[readable, writable, assign] BOOL navigationLinksVisible

Used to control NMAStreetLevelLink visibility.

If links are visible tapping them results in a call to [ NMAStreetLevelViewDelegate streetLevelView:shouldMoveToLink:] followed by a move to the street level section the link represents.

This property defaults to YES.

[readable, writable, assign] float pitch

The pitch level for the NMAStreetLevelView.

Note:

Values must be in the range [minimumPitch, maximumPitch]. Invalid values will be clamped to this range.

Note:

Changes to this property will not be reflected until after the street level has redrawn.

[readable, assign] NMAGeoCoordinatesposition

center position (camera) for the NMAStreetLevelView.

[readable, writable, assign] float reportLinkHorizontalMargin

The distance in points that the report link will be from the left or right edge of the NMAStreetLevelView.

Note:

Values less than 5.0 will be ignored.

[readable, writable, assign] NMALayoutPosition  reportLinkPosition

The issue reporting link position for the NMAStreetLevelView.

Note:

Valid values are NMALayoutPositionTopLeft, NMALayoutPositionTopRight, NMALayoutPositionBottomLeft and NMALayoutPositionBottomRight.

[readable, writable, assign] float reportLinkVerticalMargin

The distance in points that the report link will be from the top or bottom edge of the NMAStreetLevelView.

Note:

Values less than 5.0 will be ignored.

[readable, writable, assign] BOOL streetGeometryVisible

Used to control street geometry visibility. Street geometry is the line drawn on the top of road elements inside NMAStreetLevelView.

[readable, assign] NSArray * userObjects

Array of NMAStreetLevelObject representing the current list of objects added via [ NMAStreetLevelView addStreetLevelObject:]

[readable, writable, assign] float zoom

The zoom level for the NMAStreetLevelView.

Note:

Values must be in the range [minimumZoom, maximumZoom]. Invalid values will be clamped to this range.

Note:

Changes to this property will not be reflected until after the street level has redrawn.

Instance Method Details

-(BOOL) addStreetLevelObject:( NMAStreetLevelObject *) object

Adds a NMAStreetLevelObject to the NMAStreetLevelView.

Note:

Returns NO if the object has already been added (duplicates are not allowed).

Parameters:

Returns:

YES if the NMAStreetLevelObject was added successfully, NO otherwise

-( NMAStreetLevelOrientation ) cameraOrientationFromScreenPoint:(CGPoint) point

Creates the camera orientation required to display given screen point in the center of the street view.

Parameters:

  • point

    Screen point to center the street at.

Returns:

NMAStreetLevelOrientation camera orientation to display the the screen point in the center of the street view, or NMAStreetLevelOrientation::heading = NMAStreetLevelOrientation::pitch = -CGFLOAT_MAX if an error occurs.

-(void) cancelMoveToSectionWithAnimation:(BOOL) animation

Cancels an outstanding "moveToSection" request and moves the street view back to the previous street level section.

A typical use case for this method is to implement a user cancel or timeout if network connectivity is lost DURING moving to a new section. Note that all moves will eventually succeed/fail with a [ NMAStreetLevelViewDelegate streetLevelView:didMoveTo:withSuccess:] callback when network connectivity resumes.

If there is no previous section (i.e. for a newly initialized street view) or if there is not a currently outstanding move request then this method does nothing.

Note:

If a move has reached a certain point then cancellation is not possible and the view will move to the new section regardless. Also note that calling cancel will not result in [ NMAStreetLevelViewDelegate streetLevelView:didMoveTo:withSuccess:] indicating that the move failed - the view will successsfully move to the previous or next section.

Parameters:

  • animation

    Whether the street view will animate the transition between sections.

-(void) disableStreetLevelGestures:(NSUInteger) gestures

Disable one or more NMAStreetLevelView gestures.

Note:

: Pass NMAStreetLevelGestureTypeAll to disable all gestures.

Parameters:

  • gestures

    A bit-mask combination of one or more NMAStreetLevelGestureType values.

-(void) enableStreetLevelGestures:(NSUInteger) gestures

Enable one or more NMAStreetLevelView gestures.

Note that all gestures are enabled by default.

Parameters:

  • gestures

    A bit-mask combination of one or more NMAStreetLevelGestureType values (NMAStreetLevelGestureTypeAll enables all gestures).

-( NMAGeoCoordinates *) geoCoordinatesFromScreenPoint:(CGPoint) point

Converts a specifed on-screen point in the current NMAStreetLevelView to a geo coordinates.

Note:

Trying to convert a screen point that does not fall on a physical object in the view will result in nil being returned. For example, trying to get geo coordinates for points in the sky will result in nil.

Parameters:

  • point

    A screen point to be converted.

Returns:

NMAGeoCoordinates instance, or nil if a reasonble conversion could not be made.

-(BOOL) isStreetLevelGestureEnabled:( NMAStreetLevelGestureType ) gesture

Queries whether or not a gesture type is enabled on the NMAStreetLevelView.

Parameters:

  • gesture

    The gesture type to query.

Returns:

YES if the gesture type is enabled, NO if the gesture type is disabled.

-(void) moveToSectionAtGeoCoordinates:( NMAGeoCoordinates *) geoCoordinates withSearchRadius:(float) radius animation:(BOOL) animation cameraTarget:( NMAGeoCoordinates *) cameraTarget zoom:(float) zoom

Searches for the street level section closest to the geo coordinates within a specified radius and, if a section is found, moves the the street view to that section.

[ NMAStreetLevelViewDelegate streetLevelView:didMoveTo:withSuccess:] will report the ultimate result of the move request.

Note:

Calling this method whilst a move request is still outstanding will effectively cancel the current move request.

Parameters:

  • geoCoordinates

    NMAGeoCoordinates for the center of the search radius.

  • radius

    Search radius in Meters.

  • animation

    Whether the street view will animate the transition between sections.

  • cameraTarget

    The camera will be oriented to point to this coordinate if the move is successful.

  • zoom

    new camera zoom level if the move is successful.

-(void) moveToSectionAtGeoCoordinates:( NMAGeoCoordinates *) geoCoordinates withSearchRadius:(float) radius animation:(BOOL) animation orientation:( NMAStreetLevelOrientation ) orientation zoom:(float) zoom

Searches for the street level section closest to the geo coordinates within a specified radius and, if a section is found, moves the the street view to that section.

[ NMAStreetLevelViewDelegate streetLevelView:didMoveTo:withSuccess:] will report the ultimate result of the move request.

Note:

Calling this method whilst a move request is still outstanding will effectively cancel the current move request.

Parameters:

  • geoCoordinates

    NMAGeoCoordinates for the center of the search radius.

  • radius

    Search radius in Meters.

  • animation

    Whether the street view will animate the transition between sections.

  • orientation

    new camera orientation if the move is successful.

  • zoom

    new camera zoom level if the move is successful.

-(void) performDefaultActionForGestureRecognizer:(UIGestureRecognizer *) recognizer

Performs the default street level view action for a gesture recognizer. This method can be called within an NMAStreetLevelGestureDelegate to have the street view provide it's default behaviour in addition to any custom behaviour provided by the delegate.

Parameters:

  • recognizer

    UIGestureRecognizer for which to perform an action

-(void) removeStreetLevelObject:( NMAStreetLevelObject *) object

Removes an existing NMAStreetLevelObject from the NMAStreetLevelView.

Note:

The object will be removed asynchronously on the next pass of the street view render loop. Therefore the object may still be present in the userObjects property when this method returns.

Parameters:

-(void) rotateFromScreenPoint:(CGPoint) from toScreenPoint:(CGPoint) to

Programmatic rotating the camera orienation by screen point movement in the current NMAStreetLevelView.

Parameters:

  • from

    Screen Point to rotate from.

  • to

    Screen Point to rotate to.

-(CGPoint) screenPointFromGeoCoordinates:( NMAGeoCoordinates *) geoCoordinates

Converts a specifed on-screen point in the current NMAStreetLevelView from a geo coordinates.

Note:

This method will return unpredictable results if the geo coordinates supplied are not be "visible" within the current street view. For example, if the coordinates are behind the camera.

Parameters:

Returns:

The on-screen CGPoint, or CGPoint.x = CGPoint.y = -CGFLOAT_MAX if the NMAGeoCoordinates object is either off-screen or nil

-(BOOL) setNavigationLinkImage:( NMAImage *) image forPressedState:(BOOL) pressed

Set the navigation link images.

Note:

By default links are rendered using arrow images.

Parameters:

  • image

    NMAImage for the navigation link, pass nil for default images.

  • pressed

    pressed state that the image is used for.

Returns:

YES if image was set successfully.

-(NSArray *) streetLevelObjectsAtScreenPoint:(CGPoint) point

Retrieve all NMAViewObjects for the screen point

Parameters:

  • point

    A screen point to be retrieved.

Returns:

NSArray of NMAStreetLevelSelectedObject objects for this screen point. The possible objects can contain at NMAStreetLevelSelectedObject from NSArray: NMAStreetLevelBillboard, NMAStreetLevelBuilding, NMAStreetLevelIcon, NMAStreetLevelLink, NMAStreetLevelRoute

Class Method Details

+(void) checkCoverageAtGeoCoordinates:( NMAGeoCoordinates *) coordinates withRadius:(float) radius completion:( NMAStreetLevelCoverageCompletionBlock ) block

Checks if street level coverage is available at the specified coordinates within the specified radius.

Note that this method is asynchronous. When the result is available, the completion block will be invoked on the main thread.

This method do nothing if access to this operation is denied. Contact your HERE representative for more information.

Parameters:

  • coordinates

    The location at which to check street level coverage availability.

  • radius

    The maximum radius at which to search for coverage.

  • block

    The block to be invoked when request has completed

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.