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
Modifier and TypeClassDescriptionstatic @interface
Resource associated with mapstatic @interface
Mask for data setsstatic @interface
State of map resource -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
dataSetsWithState
(int state) Checks states of all data sets.boolean
deserializeState
(int dataSet, byte[] data, android.content.res.AssetManager assetManager) Restore state of data setdouble
distanceToMapBorders
(MapPoint point) Calculates distance from the map borders to the pointboolean
double
getLat()
Retrieves the latitude of the map's center.getLocalizedName
(GLMapLocaleSettings localeSettings) Retrieves the localized name of the map based on the given locale settings.double
getLon()
Retrieves the longitude of the map's center.long
getMapID()
Retrieves the unique ID of the map.getMaps()
Retrieves the array of sub-maps within this collection.MapPoint[][][]
Return polygons with borders of maplong
getSizeOnDisk
(int dataSetMask) Retrieves the size of the data sets stored on disk for the specified data set mask.long
getSizeOnServer
(int dataSetMask) Retrieves the size of the compressed data sets available on the server for the specified data set mask.int
getState
(int dataSet) Retrieves the state of the specified data set.long
getTempSize
(int dataSetMask) Retrieves the size of temporary download data for the specified data set mask.int
hashCode()
boolean
haveChild
(long childID) Check if this collection contains childboolean
haveState
(int state, int dataSetMask) Checks if any data set in the provided mask has the specified state.boolean
Checks 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:
true
if this map is a collection,false
otherwise.- See Also:
-
getMaps
Retrieves the array of sub-maps within this collection.- Returns:
- An array of
GLMapInfo
representing sub-maps of this collection, ornull
if 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:
true
if any data set in the mask has the specified state,false
otherwise.
-
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
-