GLMapInfo
Objective-C
@interface GLMapInfo : NSObject
Swift
class GLMapInfo : NSObject
GLMapInfo
is a class with general information about all resources of a vector map and the states of those resources. It works with map data, navigation
data, contour lines, and hillshades. It is returned by -[GLMapManager cachedMapList]
.
-
Unavailable
GLMapInfo is returned by
[GLMapInfo cachedMapList]
Default -init is disabled.
Declaration
Objective-C
- (nonnull instancetype)init;
-
A dictionary mapping language codes to their corresponding names of this map.
Declaration
Objective-C
@property (readonly) NSDictionary<NSString *, NSString *> *_Nonnull names;
Swift
var names: [String : String] { get }
-
Unique ID of the offline map.
Declaration
Objective-C
@property (readonly) int64_t mapID;
Swift
var mapID: Int64 { get }
-
Timestamp when the offline map was last updated on the server.
Declaration
Objective-C
@property (readonly) NSTimeInterval serverTimestamp;
Swift
var serverTimestamp: TimeInterval { get }
-
Geographical point indicating the center of the map.
Declaration
Objective-C
@property (readonly) GLMapGeoPoint location;
Swift
var location: GLMapGeoPoint { get }
-
Array containing sub-regions of the current offline map. Usually used for large maps (size > 300 MB).
Declaration
Objective-C
@property (readonly) NSArray<GLMapInfo *> *_Nonnull subMaps;
Swift
var subMaps: [GLMapInfo] { get }
-
Parent of the sub-region map or nil if the map is not a sub-region.
Declaration
Objective-C
@property (readonly) GLMapInfo *_Nullable parent;
Swift
var parent: GLMapInfo? { get }
-
Flag indicating if this
GLMapInfo
instance is deleted and has no data sets.Declaration
Objective-C
@property (readonly) BOOL isDeleted;
Swift
var isDeleted: Bool { get }
-
Array of files associated with the map.
Declaration
Objective-C
@property (readonly) NSArray<NSURL *> *_Nonnull files;
Swift
var files: [URL] { get }
-
Retrieves the file path for a specified map data set stored on the disk.
Declaration
Objective-C
- (NSString *_Nullable)pathForDataSet:(GLMapInfoDataSet)dataSet;
Swift
func path(for dataSet: GLMapInfoDataSet) -> String?
Parameters
dataSet
The data set for which to retrieve the file path.
Return Value
A string representing the file path of the specified data set or nil if the data set is not available.
-
Fetches the current state of a specified map data set.
Declaration
Objective-C
- (GLMapInfoState)stateForDataSet:(GLMapInfoDataSet)dataSet;
Swift
func state(for dataSet: GLMapInfoDataSet) -> GLMapInfoState
Parameters
dataSet
The data set for which to retrieve the state.
Return Value
The current state of the specified data set.
-
Retrieves the timestamp of a specified map data set stored on the disk.
Declaration
Objective-C
- (NSTimeInterval)timestampForDataSet:(GLMapInfoDataSet)dataSet;
Swift
func timestamp(for dataSet: GLMapInfoDataSet) -> TimeInterval
Parameters
dataSet
The data set for which to retrieve the timestamp.
Return Value
The timestamp of the specified data set on the disk. This may differ from the server timestamp if a map update has occurred on the server.
-
Retrieves the timestamp of a specified map data set on the server.
Declaration
Objective-C
- (NSTimeInterval)serverTimestampForDataSet:(GLMapInfoDataSet)dataSet;
Swift
func serverTimestamp(for dataSet: GLMapInfoDataSet) -> TimeInterval
Parameters
dataSet
The data set for which to retrieve the server timestamp.
Return Value
The timestamp of the specified data set on the server. This may differ from the disk timestamp if a map update has occurred on the server.
-
Calculates the total size of the downloaded and decompressed data sets specified by a data set mask.
Declaration
Objective-C
- (uint64_t)sizeOnDiskForDataSets:(GLMapInfoDataSetMask)dataSets;
Swift
func sizeOnDisk(forDataSets dataSets: GLMapInfoDataSetMask) -> UInt64
Parameters
dataSets
A mask representing the data sets for which to calculate the total size.
Return Value
The total size, in bytes, of the specified data sets on the disk.
-
Calculates the total size of temporary files associated with the data sets specified by a data set mask.
Declaration
Objective-C
- (uint64_t)tempSizeOnDiskForDataSets:(GLMapInfoDataSetMask)dataSets;
Swift
func tempSizeOnDisk(forDataSets dataSets: GLMapInfoDataSetMask) -> UInt64
Parameters
dataSets
A mask representing the data sets for which to calculate the total size of temporary files.
Return Value
The total size, in bytes, of the temporary files associated with the specified data sets.
-
Calculates the total size of the specified map data sets on the server. The data sets are stored in a compressed format on the server.
Declaration
Objective-C
- (uint64_t)sizeOnServerForDataSets:(GLMapInfoDataSetMask)dataSets;
Swift
func sizeOnServer(forDataSets dataSets: GLMapInfoDataSetMask) -> UInt64
Parameters
dataSets
A mask representing the data sets for which to calculate the total size on the server.
Return Value
The total size, in bytes, of the specified data sets on the server.
-
Checks the state of all data sets specified by a data set mask and determines if any of them are in a given state.
Declaration
Objective-C
- (BOOL)haveState:(GLMapInfoState)state inDataSets:(GLMapInfoDataSetMask)sets;
Swift
func haveState(_ state: GLMapInfoState, inDataSets sets: GLMapInfoDataSetMask) -> Bool
Parameters
state
The state to check for.
sets
A mask representing the data sets to check.
Return Value
A boolean value indicating whether any of the specified data sets are in the given state.
-
Checks the state of all data sets and returns a mask of those data sets that are in a given state.
Declaration
Objective-C
- (GLMapInfoDataSetMask)dataSetsWithState:(GLMapInfoState)state;
Swift
func dataSets(with state: GLMapInfoState) -> GLMapInfoDataSetMask
Parameters
state
The state to check for.
Return Value
A mask representing the data sets that are in the given state.
-
Retrieves the name of the map in a specified language.
Declaration
Objective-C
- (NSString *_Nullable)nameInLanguage:(nonnull NSString *)language;
Swift
func name(inLanguage language: String) -> String?
Parameters
language
A string representing the preferred language code.
Return Value
A string representing the localized name of the map in the requested language or nil if the name is not available in the requested language.
-
Fetches the name of the map in its native language.
Declaration
Objective-C
- (nonnull NSString *)name;
Swift
func name() -> String
Return Value
A string representing the map’s name in its native language.
-
Retrieves the name of the map according to the provided language priority settings. This method iterates through the list of preferred languages in the settings, from highest to lowest priority, until it finds a translated name that is available.
Declaration
Objective-C
- (NSString *_Nullable)localizedName:(nonnull GLMapLocaleSettings *)settings;
Swift
func localizedName(_ settings: GLMapLocaleSettings) -> String?
Parameters
settings
An instance of GLMapLocaleSettings representing the preferred language order.
Return Value
A string representing the localized name of the map according to the provided language priority settings or nil if no translated name is available in the preferred languages.
-
Computes the geographical distance from the center of the map to a specified location.
Declaration
Objective-C
- (double)distanceFrom:(GLMapGeoPoint)location;
Swift
func distance(from location: GLMapGeoPoint) -> Double
Parameters
location
A GLMapGeoPoint representing the location to measure distance from.
Return Value
A double representing the geographical distance in meters from the center of the map to the provided location.
-
Calculates the distance from a given point to the nearest border of the map.
Declaration
Objective-C
- (double)distanceFromBorder:(GLMapPoint)location;
Swift
func distance(fromBorder location: GLMapPoint) -> Double
Parameters
location
A GLMapPoint representing the point on the map to measure distance from.
Return Value
A double representing the distance to the nearest map border measured in internal units. If the point is inside the map border, it returns 0.
-
Generates the borders of the map as a multi-polygon. Each polygon in the multi-polygon consists of a set of rings, where the first ring represents the outer border and the remaining rings represent the inner borders. To get coordinates from
NSValue
use-[NSValue glMapPoint]
or-[NSValue glMapGeoPoint]
getter function.Declaration
Objective-C
- (nonnull NSArray<NSArray<NSArray<NSValue *> *> *> *)getPolygons;
Swift
func getPolygons() -> [[[NSValue]]]
Return Value
An array of arrays of arrays of NSValue objects, each representing a point in a ring of a polygon of the multi-polygon.