#import <JSQLocationMediaItem.h>
The JSQLocationMediaItem class is a concrete JSQMediaItem subclass that implements the JSQMessageMediaData protocol and represents a location media message. An initialized JSQLocationMediaItem object can be passed to a JSQMediaMessage object during its initialization to construct a valid media message object. You may wish to subclass JSQLocationMediaItem to provide additional functionality or behavior.
| - (instancetype) initWithLocation: |
|
(CLLocation *) |
location |
|
Initializes and returns a location media item object having the given location.
- Parameters
-
| location | The location for the media item. This value may be nil. |
- Returns
- An initialized
JSQLocationMediaItem if successful, nil otherwise.
If the location data must be dowloaded from the network, you may initialize a JSQLocationMediaItem object with a nil location. Once the location data has been retrieved, you can then set the location property using setLocation: withCompletionHandler:
| - (void) setLocation: |
|
(CLLocation *) |
location |
| region: |
|
(MKCoordinateRegion) |
region |
| withCompletionHandler: |
|
(JSQLocationMediaItemCompletionBlock) |
completion |
|
|
| |
Sets the specified location for the location media item and immediately begins creating a map view snapshot image on a background thread.
The specified block is executed upon completion of creating the snapshot image and is executed on the app’s main thread.
- Parameters
-
| location | The location for the media item. |
| region | The map region that you want to capture. |
| completion | The block to call after the map view snapshot for the given location has been created. |
| - (void) setLocation: |
|
(CLLocation *) |
location |
| withCompletionHandler: |
|
(JSQLocationMediaItemCompletionBlock) |
completion |
|
|
| |
Sets the specified location for the location media item and immediately begins creating a map view snapshot image on a background thread. The map view zooms to a default region whose center point is the location coordinate and whose span is 500 meters for both the latitudinal and longitudinal meters.
The specified block is executed upon completion of creating the snapshot image and is executed on the app’s main thread.
- Parameters
-
| location | The location for the media item. |
| completion | The block to call after the map view snapshot for the given location has been created. |
| - (CLLocationCoordinate2D) coordinate |
|
readnonatomicassign |
The coordinate of the location property.
The location for the media item. The default value is nil.
The documentation for this class was generated from the following files:
- Vendors/JSQMessagesViewController/Model/JSQLocationMediaItem.h
- Vendors/JSQMessagesViewController/Model/JSQLocationMediaItem.m