Package globus.glmap

Class GLMapInfo


public class GLMapInfo extends GLNativeObject
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 Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Resource associated with map
    static @interface 
    Mask for data sets
    static @interface 
    State of map resource
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static long
    ID of world map
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    dataSetsWithState(int state)
    Checks states of all data sets.
    boolean
    deserializeState(int dataSet, byte[] data, android.content.res.AssetManager assetManager)
    Restore state of data set
    double
    Calculates distance from the map borders to the point
    boolean
    equals(Object other)
     
    double
    Retrieves the latitude of the map's center.
    Retrieves the localized name of the map based on the given locale settings.
    double
    Retrieves the longitude of the map's center.
    long
    Retrieves the unique ID of the map.
    Retrieves the array of sub-maps within this collection.
    MapPoint[][][]
    Return polygons with borders of map
    long
    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
     
    boolean
    haveChild(long childID)
    Check if this collection contains child
    boolean
    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 set

    Methods inherited from class globus.glmap.GLNativeObject

    dispose

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • WorldMapID

      public static long WorldMapID
      ID of world map
  • Method Details

    • equals

      public boolean equals(@Nullable Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • 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

      @Nullable public GLMapInfo[] getMaps()
      Retrieves the array of sub-maps within this collection.
      Returns:
      An array of GLMapInfo representing sub-maps of this collection, or null if the map is not a collection.
      See Also:
    • getLocalizedName

      @NonNull public String getLocalizedName(@NonNull GLMapLocaleSettings localeSettings)
      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

      public double distanceToMapBorders(@NonNull MapPoint point)
      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 set
      data - serialized data
      assetManager - The AssetManager to be used while loading resources
      Returns:
      true on success
    • getPolygons

      @Nullable public MapPoint[][][] getPolygons()
      Return polygons with borders of map
      Returns:
      polygons with borders of map