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:
- every tile URL is stable across pan/zoom, so it reuses the renderer's URL-keyed image cache;
- the server hits its own tile cache — usually ~10× faster than rendering;
- 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, readerFields inherited from class org.geotools.map.RasterLayer
sourceFields inherited from class org.geotools.map.StyleLayer
styleFields inherited from class org.geotools.map.Layer
listenerList, LOGGER, selected, title, userData, visible -
Constructor Summary
ConstructorsConstructorDescriptionFXTiledWMSLayer(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, isNativelySupportedMethods inherited from class org.geotools.map.GridReaderLayer
dispose, getParams, toFeatureCollectionMethods inherited from class org.geotools.map.RasterLayer
getFeatureSourceMethods inherited from class org.geotools.map.StyleLayer
getStyle, setStyleMethods 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
-
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 serverlayer- the WMS layer descriptor (from capabilities)
-