SGLayerMapView


Displays records from a layer on a MKMapView.

Conforms to: MKMapViewDelegate, SGLocationServiceDelegate
Superclass: MKMapView
Declared In: SGLayerMapView.h

Discussion

This is just a simple subclass of MKMapView which uses the records for each registered layer as annotations. SGLayerMapView will automatically load more records from SimpleGeo after the view is animated. In addition, the map will attempt to load more records based on the reloadTimeInterval if no movement is created. Just add SGLayer object to the map view. You can disable this feature by calling stopRetrieving since every record retrieval requires an HTTP request. Also, the map will remove annotation as they move out of view.

The map view will build records based on the SGLayers recordAnnotationFromGeoJSONObject: method. Records are not automatically added to their layer when they are retrieved. In order to add retrieved records to their SGLayer object, addRetrievedRecrodsToLayer should be set to YES.



Methods

-addLayer:

Adds a layer to the map view.

-addLayers:

Adds an array of layers to be displayed in the map view.

-removeLayer:

Removes a layer from the map view.

-removeLayers:

Removes an array of layers from the map view.

-startRetrieving

 Enables fetching records for each layer from SimpleGeo when the map view's region changes.

-stopRetrieving

 Disables fetching records for each layer from SimpleGeo when the map view's region changes.


addLayer:


Adds a layer to the map view.

- (void) addLayer:(SGLayer*)layer; 
Parameters
layer

The SGLayer to register with the map.


addLayers:


Adds an array of layers to be displayed in the map view.

- (void) addLayers:(NSArray*)layers; 
Parameters
layers

The array of layers.


removeLayer:


Removes a layer from the map view.

- (void) removeLayer:(SGLayer*)layer; 
Parameters
layer

The SGLayer to remove from the map.

Discussion

Remvoing a layer will also remove any annotation that are present on the map.


removeLayers:


Removes an array of layers from the map view.

- (void) removeLayers:(NSArray*)layers; 
Parameters
layers

The array of layers.


startRetrieving


 Enables fetching records for each layer from SimpleGeo when the map view's region changes.

- (void) startRetrieving; 


stopRetrieving


 Disables fetching records for each layer from SimpleGeo when the map view's region changes.

- (void) stopRetrieving; 

Properties

addRetrievedRecordsToLayer

Determines whether or not to add retrieved records to each SGLayer object as they are loaded by the map.

limit

The amount of records to retrieve each time the map view detects it needs to refresh its annotations.

reloadTimeInterval

The time interval (expressed in seconds) that tells the map to retrieve annotations when no movement has occurred.

requestEndTime

An Epoch timestamp that will be used when obtain nearby records the layers. The default is 0.

requestStartTime

An Epoch timestamp that will be used when obtain nearby records the layers. The default is 0.


addRetrievedRecordsToLayer


Determines whether or not to add retrieved records to each SGLayer object as they are loaded by the map.

@property (
    nonatomic,
    assign) BOOL addRetrievedRecordsToLayer; 


limit


The amount of records to retrieve each time the map view detects it needs to refresh its annotations.

@property (
    nonatomic,
    assign) NSInteger limit; 


reloadTimeInterval


The time interval (expressed in seconds) that tells the map to retrieve annotations when no movement has occurred.

@property (
    nonatomic,
    assign) NSTimeInterval reloadTimeInterval; 
Discussion

Set this value to a negative interval to not load any records when no animations have occurred.


requestEndTime


An Epoch timestamp that will be used when obtain nearby records the layers. The default is 0.

@property (
    nonatomic,
    assign) double requestEndTime; 


requestStartTime


An Epoch timestamp that will be used when obtain nearby records the layers. The default is 0.

@property (
    nonatomic,
    assign) double requestStartTime; 

© SimpleGeo Last Updated: 03/31/2010