Package globus.glmap
Class GLMapInfo
java.lang.Object
globus.glmap.GLNativeObject
globus.glmap.GLMapInfo
GLMapInfo is information object about an offline map. Presents information and state
of an offline map. Name, position, size and state of a map.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceResource associated with mapstatic @interfaceMask for data setsstatic @interfaceState of map resource -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintdataSetsWithState(int state) Checks states of all data sets.booleandeserializeState(int dataSet, byte[] data, android.content.res.AssetManager assetManager) Restore state of data setdoubledistanceToMapBorders(MapPoint point) Calculates distance from the map borders to the pointbooleandoublegetLat()Retrieves the latitude of the map's center.getLocalizedName(GLMapLocaleSettings localeSettings) Retrieves the localized name of the map based on the given locale settings.doublegetLon()Retrieves the longitude of the map's center.longgetMapID()Retrieves the unique ID of the map.getMaps()Retrieves the array of sub-maps within this collection.MapPoint[][][]Return polygons with borders of maplonggetSizeOnDisk(int dataSetMask) Retrieves the size of the data sets stored on disk for the specified data set mask.longgetSizeOnServer(int dataSetMask) Retrieves the size of the compressed data sets available on the server for the specified data set mask.intgetState(int dataSet) Retrieves the state of the specified data set.longgetTempSize(int dataSetMask) Retrieves the size of temporary download data for the specified data set mask.inthashCode()booleanhaveChild(long childID) Check if this collection contains childbooleanhaveState(int state, int dataSetMask) Checks if any data set in the provided mask has the specified state.booleanChecks if this map is a collection.byte[]serializeState(int dataSet) Serialize state of data setMethods inherited from class globus.glmap.GLNativeObject
dispose
-
Field Details
-
WorldMapID
public static long WorldMapIDID of world map
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
isCollection
public boolean isCollection()Checks if this map is a collection.Map collections are created for large countries and contain regional maps. Additionally, collections exist for areas with many small countries, such as Oceania and the Caribbean.
- Returns:
trueif this map is a collection,falseotherwise.- See Also:
-
getMaps
Retrieves the array of sub-maps within this collection.- Returns:
- An array of
GLMapInforepresenting sub-maps of this collection, ornullif the map is not a collection. - See Also:
-
getLocalizedName
Retrieves the localized name of the map based on the given locale settings.- Parameters:
localeSettings- The locale settings defining the priority of localizations.- Returns:
- The localized name of the map.
-
getMapID
public long getMapID()Retrieves the unique ID of the map.- Returns:
- The map's unique identifier as a
long.
-
getLon
public double getLon()Retrieves the longitude of the map's center.- Returns:
- The longitude of the map's center in degrees.
-
getLat
public double getLat()Retrieves the latitude of the map's center.- Returns:
- The latitude of the map's center in degrees.
-
getState
public int getState(int dataSet) Retrieves the state of the specified data set.- Parameters:
dataSet- The data set to query.- Returns:
- The state of the specified data set as an
GLMapInfo.State.
-
haveState
public boolean haveState(int state, int dataSetMask) Checks if any data set in the provided mask has the specified state.- Parameters:
state- The state to check.dataSetMask- A mask of data sets to evaluate.- Returns:
trueif any data set in the mask has the specified state,falseotherwise.
-
haveChild
public boolean haveChild(long childID) Check if this collection contains child- Parameters:
childID- child to test- Returns:
- `true` if contains child
-
distanceToMapBorders
Calculates distance from the map borders to the point- Parameters:
point- MapPoint representing the point on the map to measure distance from.- Returns:
- 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.
-
dataSetsWithState
public int dataSetsWithState(int state) Checks states of all data sets. And returns mask of sets with state equal to `state`.- Parameters:
state- State to check- Returns:
- Returns mask of data sets in state equal to `state`.
-
getSizeOnServer
public long getSizeOnServer(int dataSetMask) Retrieves the size of the compressed data sets available on the server for the specified data set mask.- Parameters:
dataSetMask- The mask identifying the data sets.- Returns:
- The size of the compressed data sets on the server, in bytes.
-
getSizeOnDisk
public long getSizeOnDisk(int dataSetMask) Retrieves the size of the data sets stored on disk for the specified data set mask.- Parameters:
dataSetMask- The mask identifying the data sets.- Returns:
- The size of the data sets on disk, in bytes.
-
getTempSize
public long getTempSize(int dataSetMask) Retrieves the size of temporary download data for the specified data set mask.- Parameters:
dataSetMask- The mask identifying the data sets.- Returns:
- The size of the temporary download data, in bytes.
-
serializeState
@NonNull public byte[] serializeState(int dataSet) Serialize state of data set- Parameters:
dataSet- data set- Returns:
- serialized data
-
deserializeState
public boolean deserializeState(int dataSet, @NonNull byte[] data, android.content.res.AssetManager assetManager) Restore state of data set- Parameters:
dataSet- data setdata- serialized dataassetManager- The AssetManager to be used while loading resources- Returns:
- true on success
-
getPolygons
Return polygons with borders of map- Returns:
- polygons with borders of map
-