Class FXTiledWMSLayer

java.lang.Object
org.geotools.map.Layer
org.geotools.map.StyleLayer
org.geotools.map.RasterLayer
org.geotools.map.GridReaderLayer
org.geotools.ows.wms.map.WMSLayer
org.jorigin.geotools.map.FXTiledWMSLayer

public class FXTiledWMSLayer extends org.geotools.ows.wms.map.WMSLayer
Marker WMSLayer that asks FX renderers to tile the GetMap requests client-side on the Pseudo-Mercator ("PM") quadtree grid (PMTileGrid) — instead of issuing one big GetMap per view.

Motivation

Many WMS endpoints are actually WMS-R (tile-cached WMS): the server keeps a cache of pre-rendered tiles aligned on the PM grid and serves cached bytes when the GetMap bbox / size match a grid tile exactly. Typical ad-hoc GetMaps produced from a freely-panned viewport miss that cache and force a fresh render, which is orders of magnitude slower.

Tiling the request client-side on the PM grid has three benefits:

  1. every tile URL is stable across pan/zoom, so it reuses the renderer's URL-keyed image cache;
  2. the server hits its own tile cache — usually ~10× faster than rendering;
  3. tiles are loaded in parallel via JavaFX async image I/O, so the view fills progressively as responses come in.

Usage


   WebMapServer wms       = new WebMapServer(url);
   Layer layer            = wms.getCapabilities().getLayerList().get(i);
   FXTiledWMSLayer mapLyr = new FXTiledWMSLayer(wms, layer);
   mapContent.addLayer(mapLyr);
 

Renderers that do not recognize this subclass treat it as a regular WMSLayer and fall back to the single-request pipeline.

Author:
Julien SEINTURIER - Université de Toulon / CNRS LIS umr 7020
  • Field Summary

    Fields inherited from class org.geotools.map.GridReaderLayer

    params, reader

    Fields inherited from class org.geotools.map.RasterLayer

    source

    Fields inherited from class org.geotools.map.StyleLayer

    style

    Fields inherited from class org.geotools.map.Layer

    listenerList, LOGGER, selected, title, userData, visible
  • Constructor Summary

    Constructors
    Constructor
    Description
    FXTiledWMSLayer(org.geotools.ows.wms.WebMapServer wms, org.geotools.ows.wms.Layer layer)
    Builds a new FX tiled WMS map layer.
  • Method Summary

    Methods inherited from class org.geotools.ows.wms.map.WMSLayer

    addLayer, addLayer, getBounds, getCoordinateReferenceSystem, getFeatureInfo, getFeatureInfo, getFeatureInfoAsText, getLastGetMap, getReader, getWebMapServer, getWMSLayers, getWMSStyles, isNativelySupported

    Methods inherited from class org.geotools.map.GridReaderLayer

    dispose, getParams, toFeatureCollection

    Methods inherited from class org.geotools.map.RasterLayer

    getFeatureSource

    Methods inherited from class org.geotools.map.StyleLayer

    getStyle, setStyle

    Methods inherited from class org.geotools.map.Layer

    addMapLayerListener, connectDataListener, finalize, fireMapLayerListenerLayerChanged, fireMapLayerListenerLayerDeselected, fireMapLayerListenerLayerHidden, fireMapLayerListenerLayerPreDispose, fireMapLayerListenerLayerSelected, fireMapLayerListenerLayerShown, getQuery, getTitle, getUserData, isSelected, isVisible, preDispose, removeMapLayerListener, setSelected, setTitle, setVisible, toString

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • FXTiledWMSLayer

      public FXTiledWMSLayer(org.geotools.ows.wms.WebMapServer wms, org.geotools.ows.wms.Layer layer)
      Builds a new FX tiled WMS map layer.
      Parameters:
      wms - the WMS server
      layer - the WMS layer descriptor (from capabilities)