Inherits from RMMapView : UIView
Declared in RMStaticMapView.h

Overview

An RMStaticMapView object provides an embeddable, static map image view. You use this class to display map information in your application that does not need to change or provide user interaction. You can center the map on a given coordinate and zoom level, specify the size of the area you want to display, and optionally provide a completion handler that can be performed upon map load. The map can also automatically have markers added to it if they were provided as simplestyle data when the map was created.

Warning: Please note that you are responsible for getting permission to use the map data, and for ensuring your use adheres to the relevant terms of use. You are also responsible for displaying attribution details for the data elsewhere in your application, if applicable.

Instance Methods

initWithFrame:mapID:

Initialize a static map view with a given frame and mapID.

- (id)initWithFrame:(CGRect)frame mapID:(NSString *)mapID

Parameters

frame

The frame with which to initialize the map view.

mapID

The Mapbox map ID string, typically in the format <username>.map-<mapname>.

Return Value

An initialized map view, or nil if the map view was unable to be initialized.

Discussion

Initialize a static map view with a given frame and mapID.

The map ID is expected to provide initial center coordinate and zoom level information, and may optionally also include simplestyle marker data, which will automatically be added to the map view.

Declared In

RMStaticMapView.h

initWithFrame:mapID:centerCoordinate:zoomLevel:

Initialize a static map view with a given frame, mapID, center coordinate, and zoom level.

- (id)initWithFrame:(CGRect)frame mapID:(NSString *)mapID centerCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(CGFloat)zoomLevel

Parameters

frame

The frame with which to initialize the map view.

mapID

The Mapbox map ID string, typically in the format <username>.map-<mapname>.

centerCoordinate

The map center coordinate.

zoomLevel

The map zoom level.

Return Value

An initialized map view, or nil if the map view was unable to be initialized.

Discussion

Initialize a static map view with a given frame, mapID, center coordinate, and zoom level.

The map ID may optionally also include simplestyle marker data, which will automatically be added to the map view.

Declared In

RMStaticMapView.h

initWithFrame:mapID:centerCoordinate:zoomLevel:completionHandler:

Designated initializer. Initialize a static map view with a given frame, mapID, center coordinate, and zoom level, performing a block upon completion of the map load.

- (id)initWithFrame:(CGRect)frame mapID:(NSString *)mapID centerCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(CGFloat)zoomLevel completionHandler:(void ( ^ ) ( UIImage *))handler

Parameters

frame

The frame with which to initialize the map view.

mapID

The Mapbox map ID string, typically in the format <username>.map-<mapname>.

centerCoordinate

The map center coordinate.

zoomLevel

The map zoom level.

handler

A block to be performed upon map load completion. An image of the map, including markers, is passed as an argument to the block in the event that you wish to use it elsewhere. The handler will be called on the main dispatch queue.

Return Value

An initialized map view, or nil if the map view was unable to be initialized.

Discussion

Designated initializer. Initialize a static map view with a given frame, mapID, center coordinate, and zoom level, performing a block upon completion of the map load.

The map ID may optionally also include simplestyle marker data, which will automatically be added to the map view. The block will be performed upon completion of the load of both the map and of any simplestyle markers included with the map ID.

Declared In

RMStaticMapView.h

initWithFrame:mapID:completionHandler:

Initialize a static map view with a given frame and mapID, performing a block upon completion of the map load.

- (id)initWithFrame:(CGRect)frame mapID:(NSString *)mapID completionHandler:(void ( ^ ) ( UIImage *))handler

Parameters

frame

The frame with which to initialize the map view.

mapID

The Mapbox map ID string, typically in the format <username>.map-<mapname>.

handler

A block to be performed upon map and marker load completion. An image of the map, including markers, is passed as an argument to the block in the event that you wish to use it elsewhere. The handler will be called on the main dispatch queue.

Return Value

An initialized map view, or nil if the map view was unable to be initialized.

Discussion

Initialize a static map view with a given frame and mapID, performing a block upon completion of the map load.

The map ID is expected to provide initial center coordinate and zoom level information, and may optionally also include simplestyle marker data, which will automatically be added to the map view. The block will be performed upon completion of the load of both the map and of any simplestyle markers included with the map ID.

Declared In

RMStaticMapView.h