Loading...
Searching...
No Matches

Class is used for storing location parameters: identifier, version, name, a list of sublocations, etc. More...

#include <com/navigine/idl/objc/NCLocation.h>

Inherits NSObject.

Instance Methods

(nullable NCElevationGraph *) - getElevationGraph:
 Method returns location elevation graph ElevationGraph for specified tag.
 
(nonnull NSArray< NSString * > *) - getGraphTags
 Method returns list of available graph tags.
 
(nullable NCSublocation *) - getSublocationById:
 Method is used for obtaining a sublocation with the specified identifier from the current location.
 
(nullable NCCategory *) - getCategoryById:
 Method is used for obtaining a category with the specified identifier from the current location.
 

Properties

int32_t id
 location's identifier.
 
int32_t version
 location's version.
 
NSString * name
 location name.
 
NSString * descript
 location's description.
 
NSArray< NCCategory * > * categories
 List of venue categories defined for the location Category.
 
NSArray< NCSublocation * > * sublocations
 List of sublocations Sublocation.
 
BOOL modified
 Flag indicates if location has been modified by user or not.
 

Detailed Description

Class is used for storing location parameters: identifier, version, name, a list of sublocations, etc.

Location instance can be obtained from LocationManager using LocationListener callback, when the location is loaded.

Referenced from LocationManager LocationListener.

Definition at line 23 of file NCLocation.h.

Method Documentation

◆ getCategoryById:

- (nullable NCCategory *) getCategoryById: (int32_t) id

Method is used for obtaining a category with the specified identifier from the current location.

Parameters
idcategory identifier.
Returns
Category of the current location with the specified identifier, if it exists. If category with the specified identifier doesn't exist, function returns null.

Swift code snippet:

// Get category by ID
if let firstCategory = categories.first {
let category = location.getCategoryById(firstCategory.getId())
if let category = category {
demonstrateCategoryUsage(category)
}
}

Objective C code snippet:

// Get category by ID
if (categories.count > 0) {
NCCategory *category = [location getCategoryById:[categories[0] getId]];
if (category != nil) {
[self demonstrateCategoryUsage:category];
}
}

◆ getElevationGraph:

- (nullable NCElevationGraph *) getElevationGraph: (nonnull NSString *) tag

Method returns location elevation graph ElevationGraph for specified tag.

Parameters
tagGraph tag in CMS
Returns
Elevation graph instance or null.
ElevationGraph of the current location with the specified tag, if it exists. If elevation graph with the specified tag doesn't exist, function returns null.

Swift code snippet:

// Get elevation graph by tag
if let firstTag = graphTags.first {
let elevationGraph = location.getElevationGraph(firstTag)
if let elevationGraph = elevationGraph {
demonstrateElevationGraphUsage(elevationGraph)
}
}

Objective C code snippet:

// Get elevation graph by tag
if (graphTags.count > 0) {
NCElevationGraph *elevationGraph = [location getElevationGraph:graphTags[0]];
if (elevationGraph != nil) {
[self demonstrateElevationGraphUsage:elevationGraph];
}
}

◆ getGraphTags

- (nonnull NSArray< NSString * > *) getGraphTags

Method returns list of available graph tags.

Returns
Array of existing tags

Swift code snippet:

// Get available graph tags
let graphTags = location.getGraphTags()
print("Available graph tags: \‍(graphTags)")

Objective C code snippet:

// Get available graph tags
NSArray<NSString *> *graphTags = [location getGraphTags];
NSLog(@"Available graph tags: %@", graphTags);

◆ getSublocationById:

- (nullable NCSublocation *) getSublocationById: (int32_t) id

Method is used for obtaining a sublocation with the specified identifier from the current location.

Parameters
idsublocation identifier.
Returns
The Sublocation of the current location with the specified identifier, if it exists. If sublocation with the specified identifier doesn't exist, function returns null.

Swift code snippet:

// Get sublocation by ID
if let firstSublocation = sublocations.first {
let sublocation = location.getSublocationById(firstSublocation.getId())
if let sublocation = sublocation {
demonstrateSublocationUsage(sublocation)
}
}

Objective C code snippet:

// Get sublocation by ID
if (sublocations.count > 0) {
NCSublocation *sublocation = [location getSublocationById:[sublocations[0] getId]];
if (sublocation != nil) {
[self demonstrateSublocationUsage:sublocation];
}
}

Property Documentation

◆ categories

- (NSArray<NCCategory *>*) categories
readnonatomicassign

List of venue categories defined for the location Category.

Swift code snippet:

// Get all categories
let categories = location.getCategories()
print("Number of categories: \‍(categories.count)")

Objective C code snippet:

// Get all categories
NSArray<NCCategory *> *categories = [location getCategories];
NSLog(@"Number of categories: %lu", (unsigned long)categories.count);

Definition at line 158 of file NCLocation.h.

◆ descript

- (NSString*) descript
readnonatomicassign

location's description.

Swift code snippet:

// Get location description
let description = location.getDescript()
print("Location description: \‍(description ?? "nil")")

Objective C code snippet:

// Get location description
NSString *description = [location getDescript];
NSLog(@"Location description: %@", description);

Definition at line 144 of file NCLocation.h.

◆ id

- (int32_t) id
readnonatomicassign

location's identifier.

Swift code snippet:

// Get location ID
let locationId = location.getId()
print("Location ID: \‍(locationId)")

Objective C code snippet:

// Get location ID
int32_t locationId = [location getId];
NSLog(@"Location ID: %d", locationId);

Definition at line 102 of file NCLocation.h.

◆ modified

- (BOOL) modified
readnonatomicassign

Flag indicates if location has been modified by user or not.

Swift code snippet:

// Check if location is modified
let isModified = location.getModified()
print("Location modified: \‍(isModified)")

Objective C code snippet:

// Check if location is modified
BOOL isModified = [location getModified];
NSLog(@"Location modified: %@", isModified ? @"YES" : @"NO");

Definition at line 186 of file NCLocation.h.

◆ name

- (NSString*) name
readnonatomicassign

location name.

Swift code snippet:

// Get location name
let name = location.getName()
print("Location name: \‍(name ?? "nil")")

Objective C code snippet:

// Get location name
NSString *name = [location getName];
NSLog(@"Location name: %@", name);

Definition at line 130 of file NCLocation.h.

◆ sublocations

- (NSArray<NCSublocation *>*) sublocations
readnonatomicassign

List of sublocations Sublocation.

Swift code snippet:

// Get all sublocations
let sublocations = location.getSublocations()
print("Number of sublocations: \‍(sublocations.count)")

Objective C code snippet:

// Get all sublocations
NSArray<NCSublocation *> *sublocations = [location getSublocations];
NSLog(@"Number of sublocations: %lu", (unsigned long)sublocations.count);

Definition at line 172 of file NCLocation.h.

◆ version

- (int32_t) version
readnonatomicassign

location's version.

Swift code snippet:

// Get location version
let version = location.getVersion()
print("Location version: \‍(version)")

Objective C code snippet:

// Get location version
int32_t version = [location getVersion];
NSLog(@"Location version: %d", version);

Definition at line 116 of file NCLocation.h.


The documentation for this class was generated from the following file: