MapsIndoors iOS SDK V3
Loading...
Searching...
No Matches
Instance Methods | Class Methods | Properties | List of all members
MPMapControl Class Reference

#include <MPMapControl.h>

Inheritance diagram for MPMapControl:
<MPFloorSelectorDelegate> <MPBuildingDelegate> <MPVenueProviderDelegate> <MPPositionProviderDelegate>

Instance Methods

(nullable instancetype) - initWithMap:
 
(void) - setupMapWithVenue:
 
(nullable MPLocation *) - getLocation:
 
(nullable MPLocation *) - getLocationById:
 
(void) - showSearchResult:
 
(void) - setDisplayRule:
 
(void) - setDisplayRules:
 
(void) - setDisplayRule:forLocation:
 
(void) - setDisplayRule:forLocations:
 
(void) - setDisplayRuleNamed:forLocation:
 
(MPLocationDisplayRule *_Nullable) - getDisplayRuleForTypeNamed:
 
(MPLocationDisplayRule *_Nullable) - getEffectiveDisplayRuleForLocation:
 
(void) - resetDisplayRuleForLocation:
 
(void) - resetDisplayRulesForLocations:
 
(void) - clearTileCache
 
(void) - clearMap
 
(void) - showUserPosition:
 
(void) - goTo:
 
(void) - showAreaOfLocation:
 
(void) - addDisplayRule:
 
(void) - addDisplayRules:
 
(void) - enableLiveData:
 
(void) - enableLiveData:handler:
 
(void) - disableLiveData:
 
- Instance Methods inherited from <MPFloorSelectorDelegate>
(void) - floorHasChanged:
 
- Instance Methods inherited from <MPBuildingDelegate>
(void) - onBuildingReady:
 
- Instance Methods inherited from <MPVenueProviderDelegate>
(void) - onVenuesReady:
 
(void) - onBuildingWithinBoundsReady:
 
(void) - onBuildingDetailsReady:
 
(void) - onVenueDetailsReady:
 
(void) - onBuildingsReady:
 
- Instance Methods inherited from <MPPositionProviderDelegate>
(void) - onPositionUpdate:
 
(void) - onPositionFailed:
 

Class Methods

(BOOL) + isMapLabelHaloEnabled
 
(void) + setMapLabelFont:showHalo:
 

Properties

id< MPMapControlDelegatedelegate
 
id< MPFloorSelectorProtocolcustomFloorSelector
 
MPFloorSelectorControlfloorSelector
 
BOOL floorSelectorHidden
 
MPPositionIndicatorcurrentPosition
 
MPLocationselectedLocation
 
NSArray< MPLocation * > * searchResult
 
NSNumber * currentFloor
 
MPMapStylemapStyle
 
BOOL mapLocationsHidden
 
NSString * venue
 
BOOL mapContentReady
 
MPLocationDisplayRule *_Nullable locationHighlightDisplayRule
 
MPLocationDisplayRule *_Nullable defaultDisplayRule
 
UIFont * mapLabelFont
 
UIColor * mapLabelColor
 
CGSize mapIconSize
 
BOOL locationClusteringEnabled
 
BOOL locationHideOnIconOverlapEnabled
 
BOOL hideIconsOverlappingRoute
 
NSRange zIndexRangeForMapsIndoorsOverlays
 
NSRange zIndexRangeForPolygonOverlays
 
NSRange zIndexRangeFor2DModelOverlays
 
int zIndexForUserLocationMarker
 
int zIndexForPositioningAccuracyCircle
 
int zIndexForBuildingOutlineHighlight
 
int zIndexForLocationOutlineHighlight
 
NSRange zIndexRangeForMapsIndoorsTileLayers
 
NSString * userLocationAccessibilityLabel
 
NSString * userLocationAccuracyAccessibilityLabel
 

Detailed Description

Convenience class for setting up a Google map with MapsIndoors venues, buildings, locations and other map content.

Method Documentation

◆ addDisplayRule:

- (void) addDisplayRule: (nonnull MPLocationDisplayRule *) rule
See also
setDisplayRule
Deprecated
Replaced by -[setDisplayRule:] in version 3.7.0

◆ addDisplayRules:

- (void) addDisplayRules: (nonnull NSArray< MPLocationDisplayRule * > *) rules
See also
setDisplayRules
Deprecated
Replaced by -[setDisplayRules:] in version 3.7.0

◆ clearMap

- (void) clearMap

Remove all markers associated with search results and selected location from the map.

◆ clearTileCache

- (void) clearTileCache

◆ disableLiveData:

- (void) disableLiveData: (nonnull NSString *) domainType

End subscribing for and showing Live Data for locations in the visible map region for given MPLiveDomainType.

Provided by category MPMapControl(LiveData).

◆ enableLiveData:

- (void) enableLiveData: (nonnull NSString *) domainType

Start subscribing for and showing Live Data for locations in the visible map region with given MPLiveDomainType. The SDK will handle rendering of the Live Data updates. Note that the SDK will set custom display rules for this rendering. Adding your own or resetting display rules while Live Data is enabled with default rendering may break the rendering for the current MPMapControl instance.

Provided by category MPMapControl(LiveData).

◆ enableLiveData:handler:

- (void) enableLiveData: (nonnull NSString *) domainType
handler: (nonnull id< MPMappedLocationUpdateHandler >) handler 

Start subscribing for Live Data for locations in the visible map region with given MPLiveDomainType. Delegate will be called to handle display updates.

Provided by category MPMapControl(LiveData).

◆ getDisplayRuleForTypeNamed:

- (MPLocationDisplayRule *_Nullable) getDisplayRuleForTypeNamed: (nonnull NSString *) ruleName

Get a type-displayRule by name.

Parameters
ruleNameName of type-displayRule to retrieve.
Returns
nil or MPLocationDisplayRule
Since
3.7.0

◆ getEffectiveDisplayRuleForLocation:

- (MPLocationDisplayRule *_Nullable) getEffectiveDisplayRuleForLocation: (nonnull MPLocation *) location

Get the currently used displayRule for the given MPLocation. Note that the returned displayRule may be, in priority-order, one of:

  • a custom, override displayRule registered with this instance of MPMapControl
  • a custom displayRule assigned to the MPLocation object
  • a shared displayRule for the 'MPLocation type'
  • the shared , default display rule
    Parameters
    locationThe MPLocation to retrieve the currently active displayRule for.
    Returns
    MPLocationDisplayRule*
    Since
    3.7.0

◆ getLocation:

- (nullable MPLocation *) getLocation: (nonnull GMSMarker *) marker

Get the location that wraps the given marker.

◆ getLocationById:

- (nullable MPLocation *) getLocationById: (nonnull NSString *) idString

Get location by string id reference.

◆ goTo:

- (void) goTo: (nonnull MPLocation *) location

Focus the map on the given location.

Parameters
locationThe location to show on the map.

◆ initWithMap:

- (nullable instancetype) initWithMap: (nonnull GMSMapView *) map

Initialize a MPMapControl object with given map.

Parameters
mapThe map to build the map control on.

◆ isMapLabelHaloEnabled

+ (BOOL) isMapLabelHaloEnabled

Returns whether halo is enabled for map labels.

◆ resetDisplayRuleForLocation:

- (void) resetDisplayRuleForLocation: (nonnull MPLocation *) location

Remove any specific displayrule that has been added to the given MPLocation. Once the location-specific display rule is removed, the MPLocation will be displayed on map according to it's type-displayrule.

Parameters
locationMPLocation that should have it's specific displayrule removed.
Since
3.7.0

◆ resetDisplayRulesForLocations:

- (void) resetDisplayRulesForLocations: (nonnull NSArray< MPLocation * > *) locations

Remove any specific displayrule that has been added to the given MPLocations. Once the location-specific display rules are removed, the MPLocations will be displayed on map according to their type-displayrule.

Parameters
locationsMPLocations that should have their specific displayrule removed.
Since
3.7.0

◆ setDisplayRule:

- (void) setDisplayRule: (nullable MPLocationDisplayRule *) rule

Add a location display rule for a specific location type. You need to know the types applied to the map locations. The display rule name corresponds to the location type we want the rule to apply for. Adding a rule with name nil, will apply generally to all types Adding a rule with a name, will override a more general rule

Parameters
ruledisplayrule to add.
Since
3.7.0

◆ setDisplayRule:forLocation:

- (void) setDisplayRule: (nonnull MPLocationDisplayRule *) rule
forLocation: (nullable MPLocation *) location 

Add a location display rule for a single MPLocation. This display rule takes precedence over more general displayrules like the type-display-rule and default display rule.

Parameters
ruleDisplay rule to use for the given MPLocation.
locationMPLocation that the displayrule should apply to.
Since
3.7.0

◆ setDisplayRule:forLocations:

- (void) setDisplayRule: (nonnull MPLocationDisplayRule *) rule
forLocations: (nonnull NSArray< MPLocation * > *) locations 

Add a location display rule for multiple MPLocations. This display rule takes precedence over more general displayrules like the type-display-rule and default display rule.

Parameters
ruleDisplay rule to use for the given MPlocations.
locationsMPLocation's that the displayrule should apply to.
Since
3.7.0

◆ setDisplayRuleNamed:forLocation:

- (void) setDisplayRuleNamed: (nonnull NSString *) ruleName
forLocation: (nonnull MPLocation *) location 

Apply a named displayRule to the given MPLocation. If MPMapControl does not have a displayRule with the given name, no changes is applied.

Parameters
ruleNameName of displayRule to apply to location
locationMPLocation to apply displayRule to
Since
3.7.0

◆ setDisplayRules:

- (void) setDisplayRules: (nonnull NSArray< MPLocationDisplayRule * > *) rules

Add multiple location display rules.

See also
setDisplayRule
Parameters
rulesArray of displayrules to add.
Since
3.7.0

◆ setMapLabelFont:showHalo:

+ (void) setMapLabelFont: (UIFont *_Nullable) mapLabelFont
showHalo: (BOOL) showHalo 

Set the font that MapsIndoors should use when rendering labels on the map, and enable or disable white halo for improved visibility.

◆ setupMapWithVenue:

- (void) setupMapWithVenue: (nonnull NSString *) venueName

Setup the venue map with default providers based on MapsIndoors.solutionId.

Parameters
venueNameThe MapsPeople site id, used for locations and routing.

◆ showAreaOfLocation:

- (void) showAreaOfLocation: (nonnull MPLocation *) location

Make sure the complete geometry of the given MPLocation is visible on the map. If the location is fully visible, the visible area of the map is unchanged. If the location is not fully visible, the map is centered around the location, and if needed zoomed. This method does not change the shown floor. The maps current bearing and vieweing angle is preserved.

Parameters
locationLocation to show.

◆ showSearchResult:

- (void) showSearchResult: (BOOL) fitBounds

Show a given array of locations. The display will override any zoom level condition made from display rules. Clear the locations by calling again with [showLocations:nil fitBounds:NO]

◆ showUserPosition:

- (void) showUserPosition: (BOOL) show

Show or hide the user position marker.

Parameters
showshow/hide

Property Documentation

◆ currentFloor

- (NSNumber*) currentFloor
readwritenonatomicassign

The current floor.

◆ currentPosition

- (MPPositionIndicator*) currentPosition
readnonatomicassign

Current user location.

Deprecated
Use MapsIndoors.positionProvider.latestPositionResult if you need to know the current position.

◆ customFloorSelector

- (id<MPFloorSelectorProtocol>) customFloorSelector
readwritenonatomicstrong

Custom floor selector for the map to use. When provided, the MapControl will not create a floor selector control autonomously.

◆ defaultDisplayRule

- (MPLocationDisplayRule* _Nullable) defaultDisplayRule
readnonatomicstrong

The default display settings used by MPMapControl to display a location. Modify this object to change the default visual appearance of a location. The default appearance only applies for locations that has no other references to a display rule.

◆ delegate

- (id<MPMapControlDelegate>) delegate
readwritenonatomicweak

Delegate object containing data events

◆ floorSelector

- (MPFloorSelectorControl*) floorSelector
readatomicassign

Floor selector UI element.

If a custom floor selector is not provided (

See also
customFloorSelector), MPMapControl will create a default floor selector. If you need a customized floor selector beyond what MPFloorSelectorControl provides, or need finer control over location and visibility of the floor selector, a custom floor selector can be provided to the MapControl using the MPFloorSelectorControl property.

May be nil if a custom floor selector has been provided.

◆ floorSelectorHidden

- (BOOL) floorSelectorHidden
readwritenonatomicassign

Hide floor selector UI element. Only applies to default floor selector; if a custom floor selector is provided, the MapControl is not repsonsible for it's visibility.

◆ hideIconsOverlappingRoute

- (BOOL) hideIconsOverlappingRoute
readwriteatomicassign

Controls whether Location icons along a rendered route are hidden if they obstruct the route. Default is YES.

◆ locationClusteringEnabled

- (BOOL) locationClusteringEnabled
readwriteatomicassign

Controls whether overlapping map markers can be resolved by grouping some of the overlapping items. Default value is NO; When set to YES, the default behavior is to group MPLocation's of the same type.

◆ locationHideOnIconOverlapEnabled

- (BOOL) locationHideOnIconOverlapEnabled
readwriteatomicassign

Controls whether overlapping map markers can be resolved by hiding some of the overlapping items. Default value is YES;

◆ locationHighlightDisplayRule

- (MPLocationDisplayRule* _Nullable) locationHighlightDisplayRule
readnonatomicstrong

The display rule used by MPMapControl to highlight the selected location. Created and added by MPMapControl during initialization. Modify this displayrule to change the visual appearance of the location highlight.

◆ mapContentReady

- (BOOL) mapContentReady
readnonatomicassign

Indicates whether or not basic data for the map has been loaded. This does not indicate whether maptiles have been loaded and displayed.

◆ mapIconSize

- (CGSize) mapIconSize
readwriteatomicassign

Default map icon size

◆ mapLabelColor

- (UIColor*) mapLabelColor
readwriteatomicassign

The color that MapsIndoors should use when rendering labels on the map.

◆ mapLabelFont

- (UIFont*) mapLabelFont
readwriteatomicassign

The font that MapsIndoors should use when rendering labels on the map.

◆ mapLocationsHidden

- (BOOL) mapLocationsHidden
readwritenonatomicassign

Whether or not to hide all map locations. Default is NO

◆ mapStyle

- (MPMapStyle*) mapStyle
readwritenonatomicassign

The map style.

◆ searchResult

- (NSArray<MPLocation*>*) searchResult
readwritenonatomicassign

Current location search result.

◆ selectedLocation

- (MPLocation*) selectedLocation
readwritenonatomicassign

Current single location selection.

◆ userLocationAccessibilityLabel

- (NSString*) userLocationAccessibilityLabel
readwritenonatomicstrong

The accessibility label associated with the user location marker on the map. Default: "My Location"

◆ userLocationAccuracyAccessibilityLabel

- (NSString*) userLocationAccuracyAccessibilityLabel
readwritenonatomicstrong

The accessibility label associated with the user location accuracy circle on the map. Default: "My location, accuracy %@m"

◆ venue

- (NSString*) venue
readwritenonatomicassign

The venue name, at which the map should target its view.

◆ zIndexForBuildingOutlineHighlight

- (int) zIndexForBuildingOutlineHighlight
readatomicassign

zIndex for building outline highlight overlay

◆ zIndexForLocationOutlineHighlight

- (int) zIndexForLocationOutlineHighlight
readatomicassign

zIndex for location outline highlight overlay

◆ zIndexForPositioningAccuracyCircle

- (int) zIndexForPositioningAccuracyCircle
readatomicassign

zIndex of the accurqacy indicator circle.

◆ zIndexForUserLocationMarker

- (int) zIndexForUserLocationMarker
readatomicassign

zIndex of the user location marker (aka "the blue dot").

◆ zIndexRangeFor2DModelOverlays

- (NSRange) zIndexRangeFor2DModelOverlays
readatomicassign

zIndex range reserved for 2D Model overlays managed by MapsIndoors.

◆ zIndexRangeForMapsIndoorsOverlays

- (NSRange) zIndexRangeForMapsIndoorsOverlays
readatomicassign

Overall range reserved for MapsIndoors use.

◆ zIndexRangeForMapsIndoorsTileLayers

- (NSRange) zIndexRangeForMapsIndoorsTileLayers
readatomicassign

Indexes reserved for MapsIndoors tile layers. If you are adding tilelayers to a map with MapsIndoors tiles, you should set the zIndex of your tile layer above this range to make sure your tile layer shows on top of MapsIndoors tiles.

◆ zIndexRangeForPolygonOverlays

- (NSRange) zIndexRangeForPolygonOverlays
readatomicassign

zIndex range reserved for polygon overlays managed by MapsIndoors.