SGLayer |
Updates and retrieves records that are within a layer.
Conforms to: SGLocationServiceDelegate
Superclass: NSObject
Declared In: SGLayer.h
A layer object has the ability to update and retrieve records that are already registered with the object. By adding the layer as a delegate to the SGLocationService , the layer will do its best to update the record once information is recieved about it. If the layer recieves a record that isn't already registered, it will call recordAnnotationFromGeoJSONObject: . If the record is already registered, then the layer object will attempt to call updateRecordWithGeoJSONObject: the object implements it.
The layer object does not handle errors generated by the SGLocationService. If an error is incurred, it is up to the other delegates to handle the error.
 Adds a SGRecordAnnotation to the layer.
Adds an array of SGRecordAnnotations to the SGLayer object.
Initialize a new SGLayer object with a layer name.
 Get the amount of SGRecordAnnotations registered with the SGLayer object.
Creates a new record from the given dictionary.
 Removes all SGRecordAnnotations registered with the SGLayer object.
Remove a SGRecordAnnotation registed with the SGLayer object.
Remove a SGRecordAnnotation registed with the SGLayer object.
Remove a SGRecordAnnotation registed with the SGLayer object.
Remove a SGRecordAnnotation registed with the SGLayer object.
 Retrieves all records that are registered with the SGLayer object from SimpleGeo.
 Retrieves all registered records within a range from this layer that are in SimpleGeo.
Retrieves records within from an origin with a desired radius from SimpleGeo.
Retrieves records within from an origin with a desired radius from SimpleGeo and within a given interval. To make use of our time based index, the difference between start and end must not be greater than 60 minutes.
Retrieves records within from an origin with a desired radius from SimpleGeo and within a given interval. To make use of our time based index, the difference between start and end must not be greater than 60 minutes.
Retrieves records within the given geohash from SimpleGeo.
Retrieves records within the given geohash from SimpleGeo and within a given interval. To make use of our time based index, the difference between start and end must not be greater than 60 minutes.
Retrieves records within the given geohash from SimpleGeo and within a given interval. To make use of our time based index, the difference between start and end must not be greater than 60 minutes.
 Retrieves all registered records within a range from this layer that are in SimpleGeo.
 Updates or adds all records registered with the SGLayer object to SimpleGeo.
 Updates or adds all registered records within a range from this SGLayer object to SimpleGeo.
 Updates or adds all registered records within a range from this SGLayer object to SimpleGeo.
addRecordAnnotation: |
 Adds a SGRecordAnnotation to the layer.
- (void) addRecordAnnotation:(id<SGRecordAnnotation>)recordAnnotation;
recordAnnotation
The record annotation to add.
When a record is added, the layer of the record is changed to reflect the layerId.
addRecordAnnotations: |
Adds an array of SGRecordAnnotations to the SGLayer object.
- (void) addRecordAnnotations:(NSArray*)recordAnnotations;
recordAnnotations
The array of record annotations to add.
See addRecord:
initWithLayerName: |
Initialize a new SGLayer object with a layer name.
- (id) initWithLayerName:(NSString*)layerId;
layerId
The name of the layer.
A initialized SGLayer object.
See layerId
recordAnnotationCount |
 Get the amount of SGRecordAnnotations registered with the SGLayer object.
- (NSInteger) recordAnnotationCount;
 The amount of records registerd with the SGLayer object.
recordAnnotationFromGeoJSONObject: |
Creates a new record from the given dictionary.
- (id<SGRecordAnnotation>) recordAnnotationFromGeoJSONObject:(NSDictionary*)geoJSONObject;
geoJSONObject
The GeoJSON dictionary representation of the new record. 
The SGRecordAnnotation of the GeoJSON dictionary.
This method is called when the layer finds an unregistered record. The default implementation of this method creates a new instance of SGRecord and calls updateRecordWithGeoJSONObject:. If subclasses wish to do any manipulation to a record after it is retrieved from SimpleGeo, they are encouraged to override this method.
recordAnnotations |
- (NSArray*) recordAnnotations;
All the SGRecordAnntations registered with the SGLayer object.
removeAllRecordAnnotations |
 Removes all SGRecordAnnotations registered with the SGLayer object.
- (void) removeAllRecordAnnotations;
removeRecordAnnotation: |
Remove a SGRecordAnnotation registed with the SGLayer object.
See Also:- (void) removeRecordAnnotation:(id<SGRecordAnnotation>)recordAnnotation;
recordAnnotation
The record annotation to remove.
removeRecordAnnotationAtIndex: |
Remove a SGRecordAnnotation registed with the SGLayer object.
See Also:- (void) removeRecordAnnotation:(id<SGRecordAnnotation>)recordAnnotation;
recordAnnotation
The record annotation to remove.
removeRecordAnnotationAtIndex: |
Remove a SGRecordAnnotation registed with the SGLayer object.
See Also:- (void) removeRecordAnnotations:(NSArray*)recordAnnotations;
recordAnnotation
The array of record annotations to remove.
removeRecordAnnotations: |
Remove a SGRecordAnnotation registed with the SGLayer object.
See Also:- (void) removeRecordAnnotations:(NSArray*)recordAnnotations;
recordAnnotation
The array of record annotations to remove.
retrieveAllRecords |
 Retrieves all records that are registered with the SGLayer object from SimpleGeo.
- (NSString*) retrieveAllRecords;
 A request identifier that can be used to analyze the response object returned to the SGLocationServiceDelegate
See updateRecordsFromIndex:toIndex:
retrieveRecordAnnotations: |
 Retrieves all registered records within a range from this layer that are in SimpleGeo.
See Also:- (NSString*) retrieveRecordAnnotations:(NSArray*)recordAnnoations;
recordAnnotations
The annotations to retrieve.
 Currently, there is no way to retrieve ALL records in a single GET request. Each record creates a HTTP request so if there are 300 records register with the SGLayer object, then it might be a minute in order to recieve a response back. As soon as a request returns, the record is immediately updated and the next request is sent. If at any time a request fails, all delegates registered with SGLocationService are notified with the response identifier.
Records are retrieved in order. If record retrieval fails at n + 1, then all records 0
retrieveRecordsForCoordinate:radius:types:limit: |
Retrieves records within from an origin with a desired radius from SimpleGeo.
- (NSString*) retrieveRecordsForCoordinate:(CLLocationCoordinate2D)coord radius:(double)radius types:(NSArray*)types limit:(NSInteger)limit;
coord
The lat/lon coordinates that declare the origin of the search space.
radius
The radius of the circle.
types
The types of objects to retrieve. 
limit
The amount of objects to retrieve.
 A request identifier that can be used to analyze the response object returned to the SGLocationServiceDelegate
retrieveRecordsForCoordinate:radius:types:limit: |
Retrieves records within from an origin with a desired radius from SimpleGeo and within a given interval. To make use of our time based index, the difference between start and end must not be greater than 60 minutes.
See Also:- (NSString*) retrieveRecordsForCoordinate:(CLLocationCoordinate2D)coord radius:(double)radius types:(NSArray*)types limit:(NSInteger)limit start:(double)start end:(double)end;
coord
The lat/lon coordinates that declare the origin of the search space.
radius
The radius of the circle.
types
The types of objects to retrieve. 
limit
The amount of objects to retrieve.
start
An Epoch timestamp that is the beginning of the time interval in seconds.
end
An Epoch timestamp that is the end of the time interval in seconds.
 A request identifier that can be used to analyze the response object returned to the SGLocationServiceDelegate
retrieveRecordsForCoordinate:radius:types:limit:start:end: |
Retrieves records within from an origin with a desired radius from SimpleGeo and within a given interval. To make use of our time based index, the difference between start and end must not be greater than 60 minutes.
See Also:- (NSString*) retrieveRecordsForCoordinate:(CLLocationCoordinate2D)coord radius:(double)radius types:(NSArray*)types limit:(NSInteger)limit start:(double)start end:(double)end;
coord
The lat/lon coordinates that declare the origin of the search space.
radius
The radius of the circle.
types
The types of objects to retrieve. 
limit
The amount of objects to retrieve.
start
An Epoch timestamp that is the beginning of the time interval in seconds.
end
An Epoch timestamp that is the end of the time interval in seconds.
retrieveRecordsForGeohash:types:limit: |
Retrieves records within the given geohash from SimpleGeo.
- (NSString*) retrieveRecordsForGeohash:(SGGeohash)region types:(NSArray*)types limit:(NSInteger)limit;
geohash
The geohash to search in.
types
The types of objects to retrieve. 
limit
The amount of objects to retrieve.
 A request identifier that can be used to analyze the response object returned to the SGLocationServiceDelegate
retrieveRecordsForGeohash:types:limit: |
Retrieves records within the given geohash from SimpleGeo and within a given interval. To make use of our time based index, the difference between start and end must not be greater than 60 minutes.
See Also:- (NSString*) retrieveRecordsForGeohash:(SGGeohash)region types:(NSArray*)types limit:(NSInteger)limit start:(double)start end:(double)end;
geohash
The geohash to search in.
types
The types of objects to retrieve. 
limit
The amount of objects to retrieve.
start
An Epoch timestamp that is the beginning of the time interval in seconds.
end
An Epoch timestamp that is the end of the time interval in seconds.
 A request identifier that can be used to analyze the response object returned to the SGLocationServiceDelegate
retrieveRecordsForGeohash:types:limit:start:end: |
Retrieves records within the given geohash from SimpleGeo and within a given interval. To make use of our time based index, the difference between start and end must not be greater than 60 minutes.
See Also:- (NSString*) retrieveRecordsForGeohash:(SGGeohash)region types:(NSArray*)types limit:(NSInteger)limit start:(double)start end:(double)end;
geohash
The geohash to search in.
types
The types of objects to retrieve. 
limit
The amount of objects to retrieve.
start
An Epoch timestamp that is the beginning of the time interval in seconds.
end
An Epoch timestamp that is the end of the time interval in seconds.
retrieveRecordsFromIndex:toIndex: |
 Retrieves all registered records within a range from this layer that are in SimpleGeo.
See Also:- (NSString*) retrieveRecordAnnotations:(NSArray*)recordAnnoations;
recordAnnotations
The annotations to retrieve.
 A request identifier that can be used to analyze the response object returned to the SGLocationServiceDelegate
 Currently, there is no way to retrieve ALL records in a single GET request. Each record creates a HTTP request so if there are 300 records register with the SGLayer object, then it might be a minute in order to recieve a response back. As soon as a request returns, the record is immediately updated and the next request is sent. If at any time a request fails, all delegates registered with SGLocationService are notified with the response identifier.
Records are retrieved in order. If record retrieval fails at n + 1, then all records 0
updateAllRecords |
 Updates or adds all records registered with the SGLayer object to SimpleGeo.
- (NSString*) updateAllRecords;
 A request identifier that can be used to analyze the response object returned to the SGLocationServiceDelegate
See updateRecordsFromIndex:toIndex:
updateRecordAnnotations: |
 Updates or adds all registered records within a range from this SGLayer object to SimpleGeo.
See Also:- (NSString*) updateRecordAnnotations:(NSArray*)recordAnnotations;
recordAnnotations
The annotations to update.
 Currently, there is no way to update ALL records in a single PUT request. Each record creates a HTTP request so if there are 300 records registered with the SGLayer object, then it might be a minute in order to recieve a response back saying all records have been updated. As soon as a request returns, the next request is loaded. If at any time a request fails, all delegates registered with SGLocationService are notified with the initial request identifier and the proper NSError.
Records are updated in order. If a record update fails at n + 1, then all records 0
updateRecordsFromIndex:toIndex: |
 Updates or adds all registered records within a range from this SGLayer object to SimpleGeo.
See Also:- (NSString*) updateRecordAnnotations:(NSArray*)recordAnnotations;
recordAnnotations
The annotations to update.
 A request identifier that can be used to analyze the response object returned to the SGLocationServiceDelegate
 Currently, there is no way to update ALL records in a single PUT request. Each record creates a HTTP request so if there are 300 records registered with the SGLayer object, then it might be a minute in order to recieve a response back saying all records have been updated. As soon as a request returns, the next request is loaded. If at any time a request fails, all delegates registered with SGLocationService are notified with the initial request identifier and the proper NSError.
Records are updated in order. If a record update fails at n + 1, then all records 0
The layerId is the name of the layer used in SimpleGeo. A common convention used in naming a layer is a reverse URL. (e.g. "com.simplegeo.spatula").
layerId |
The layerId is the name of the layer used in SimpleGeo. A common convention used in naming a layer is a reverse URL. (e.g. "com.simplegeo.spatula").
@property ( nonatomic, readonly) NSString* layerId;
name of the layer.
© SimpleGeo Last Updated: 03/31/2010