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()
getLocalizedName
(GLMapLocaleSettings localeSettings) Return name of a map for given locale settings.double
getLon()
long
getMapID()
getMaps()
MapPoint[][][]
Return polygons with borders of maplong
getSizeOnDisk
(int dataSetMask) long
getSizeOnServer
(int dataSetMask) int
getState
(int dataSet) long
getTempSize
(int dataSetMask) int
hashCode()
boolean
haveChild
(long childID) Check if this collection contains childboolean
haveState
(int state, int dataSetMask) Check states in all data sets in `sets` mask.boolean
Map collection is created for big countries and contains regions maps.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()Map collection is created for big countries and contains regions maps.Also, there are collections for parts of the world with lot of small countries, like Oceania and Carribean.
- Returns:
- true if this maps is collection
- See Also:
-
getMaps
- Returns:
- array of GLMapInfo with sub-maps of this collection
- See Also:
-
getLocalizedName
Return name of a map for given locale settings.- Parameters:
localeSettings
- Locale settings that define priority of localizations- Returns:
- Localized name of the map
-
getMapID
public long getMapID()- Returns:
- ID of the map
-
getLon
public double getLon()- Returns:
- Longitude of the center of a map
-
getLat
public double getLat()- Returns:
- Latitude of the center of a map
-
getState
public int getState(int dataSet) - Parameters:
dataSet
- data set- Returns:
- state of a data set
-
haveState
public boolean haveState(int state, int dataSetMask) Check states in all data sets in `sets` mask. And returns YES if state of any of them equals `state`.- Parameters:
state
- State to checkdataSetMask
- Data set mask- Returns:
- Returns `true` if state of any of data set in `dataSetMask` mask equals `state`.
-
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) - Parameters:
dataSetMask
- data set mask- Returns:
- Size of compressed data sets on server
-
getSizeOnDisk
public long getSizeOnDisk(int dataSetMask) - Parameters:
dataSetMask
- data set mask- Returns:
- Size of data sets on disk
-
getTempSize
public long getTempSize(int dataSetMask) - Parameters:
dataSetMask
- data set mask- Returns:
- Size of temporary download data for data sets
-
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
-