Class JMapPane

    • Constructor Detail

      • JMapPane

        public JMapPane()
        Creates a new map pane.
      • JMapPane

        public JMapPane​(MapContent content)
        Creates a new map pane.
        Parameters:
        content - the map content containing the layers to display (may be null)
      • JMapPane

        public JMapPane​(MapContent content,
                        RenderingExecutor executor,
                        GTRenderer renderer)
        Creates a new map pane. Any or all arguments may be null
        Parameters:
        content - the map content containing the layers to display
        executor - the rendering executor to manage drawing
        renderer - the renderer to use for drawing layers
    • Method Detail

      • getRenderer

        public GTRenderer getRenderer()
        Gets the renderer, creating a default one if required.
        Returns:
        the renderer
      • setRenderer

        public void setRenderer​(GTRenderer renderer)
        Sets the renderer to be used by this map pane.
        Parameters:
        renderer - the renderer to use
      • getBaseImage

        public RenderedImage getBaseImage()
        Retrieve the map pane's current base image.

        The map pane caches the most recent rendering of map layers as an image to avoid time-consuming rendering requests whenever possible. The base image will be re-drawn whenever there is a change to map layer data, style or visibility; and it will be replaced by a new image when the pane is resized.

        This method returns a live reference to the current base image. Use with caution.

        Returns:
        a live reference to the current base image
      • drawLayers

        protected void drawLayers​(boolean createNewImage)
        Description copied from class: AbstractMapPane
        Draws layers into one or more images which will then be displayed by the map pane.
        Specified by:
        drawLayers in class AbstractMapPane