Class GoogleMapProjection

  • All Implemented Interfaces:
    MapProjection

    public class GoogleMapProjection
    extends java.lang.Object
    implements MapProjection
    Google map projection, convert from LatLng object to world coordinate and from world coordinate to PixelPoint object.
    • Constructor Detail

      • GoogleMapProjection

        public GoogleMapProjection​(int tileSize)
      • GoogleMapProjection

        public GoogleMapProjection()
    • Method Detail

      • getTileSize

        public int getTileSize()
        Description copied from interface: MapProjection
        The pixels of the tile in one dimension.
        Specified by:
        getTileSize in interface MapProjection
        Returns:
        The size of a tile.
      • fromPointToLatLng

        public LatLng fromPointToLatLng​(Point point)
        Description copied from interface: MapProjection
        Converts the world coordinate point to the LatLng coordinate.
        Specified by:
        fromPointToLatLng in interface MapProjection
        Parameters:
        point - The world Point coordinate of the point.
        Returns:
        The world coordinate of the point.
      • fromLatLngToPoint

        public Point fromLatLngToPoint​(LatLng latlng)
        Description copied from interface: MapProjection
        Converts the given LatLng to the world pixel coordinates, relative to the top-left of the map that provided this Projection
        Specified by:
        fromLatLngToPoint in interface MapProjection
        Parameters:
        latlng - The LatLng coordinate of the point.
        Returns:
        The world coordinate of the point.
      • fromPointToPixelPoint

        public PixelPoint fromPointToPixelPoint​(Point point,
                                                int zoomLevel)
        Description copied from interface: MapProjection
        Converts the world coordinate point to the pixel point at a given zoom level. The point is relative to the top-left of the map.
        Specified by:
        fromPointToPixelPoint in interface MapProjection
        Parameters:
        point - The world coordinate point.
        zoomLevel - The current zoom level.
        Returns:
        The pixel point of the given point.