Class WebMapLayer



  • public class WebMapLayer
    extends MapLayer
    • Constructor Detail

      • WebMapLayer

        public WebMapLayer​()
        Constructor
    • Method Detail

      • getZoom

        public int getZoom​()
        Gets the current zoom level
        Returns:
        the current zoom level
      • setZoom

        public void setZoom​(int zoom)
        Set the current zoom level
        Parameters:
        zoom - the new zoom level
      • getCenter

        public java.awt.geom.Point2D getCenter​()
        Gets the current pixel center of the map. This point is in the global bitmap coordinate system, not as lat/longs.
        Returns:
        the current center of the map as a pixel value
      • isRestrictOutsidePanning

        public boolean isRestrictOutsidePanning​()
      • setRestrictOutsidePanning

        public void setRestrictOutsidePanning​(boolean restrictOutsidePanning)
      • setCenter

        public void setCenter​(java.awt.geom.Point2D center)
        Sets the new center of the map in pixel coordinates.
        Parameters:
        center - the new center of the map in pixel coordinates
      • setCenterPosition

        public void setCenterPosition​(GeoPosition geoPosition)
        A property indicating the center position of the map
        Parameters:
        geoPosition - the new property value
      • getCenterPosition

        public GeoPosition getCenterPosition​()
        A property indicating the center position of the map
        Returns:
        the current center position
      • getTileFactory

        public TileFactory getTileFactory​()
        Get the current factory
        Returns:
        the current property value
      • setTileFactory

        public void setTileFactory​(TileFactory factory)
        Set the current tile factory
        Parameters:
        factory - the new property value
      • getLoadingImage

        public java.awt.Image getLoadingImage​()
        A property for an image which will be display when an image is still loading.
        Returns:
        the current property value
      • setLoadingImage

        public void setLoadingImage​(java.awt.Image loadingImage)
        A property for an image which will be display when an image is still loading.
        Parameters:
        loadingImage - the new property value
      • isDrawTileBorders

        public boolean isDrawTileBorders​()
        Indicates if the tile borders should be drawn. Mainly used for debugging.
        Returns:
        the value of this property
      • setDrawTileBorders

        public void setDrawTileBorders​(boolean drawTileBorders)
        Set if the tile borders should be drawn. Mainly used for debugging.
        Parameters:
        drawTileBorders - new value of this drawTileBorders
      • setWebMapProvider

        public void setWebMapProvider​(WebMapProvider prov)
        Set web map provider
        Parameters:
        prov - The web map provider
      • getWebMapProvider

        public WebMapProvider getWebMapProvider​()
        Get web map provider
        Returns:
        Web map provider
      • getAddressLocation

        public GeoPosition getAddressLocation​()
      • setAddressLocation

        public void setAddressLocation​(GeoPosition pos,
                                       int zoom)
      • setAddressLocation

        public void setAddressLocation​(GeoPosition pos)
      • repaint

        public void repaint​()
        Repaint
      • drawMapTiles

        public void drawMapTiles​(java.awt.Graphics2D g,
                                 int zoom,
                                 int width,
                                 int height)
        Draw the map tiles
        Parameters:
        g - Graphics2D
        zoom - Zoom level to draw at
        width - The width
        height - The height
      • drawMapTiles

        public void drawMapTiles​(java.awt.Graphics2D g,
                                 int zoom,
                                 java.awt.Rectangle viewportBounds)
        Draw the map tiles. This method is for implementation use only.
        Parameters:
        g - Graphics
        zoom - zoom level to draw at
        viewportBounds - View bounds
      • isTileOnMap

        public boolean isTileOnMap​(int x,
                                   int y,
                                   java.awt.Dimension mapSize)
      • calculateViewportBounds

        public java.awt.Rectangle calculateViewportBounds​(java.awt.Graphics2D g,
                                                          int width,
                                                          int height)
        Calculate view port bounds
        Parameters:
        g - Graphic2D
        width - The width
        height - The height
        Returns:
        View port bounds rectangle
      • getLayerInfo

        public java.lang.String getLayerInfo​()
        To string
        Overrides:
        getLayerInfo in class MapLayer
        Returns:
        String