use of ol.source.TileWmsParams in project gwt-ol3 by TDesjardins.
the class TileWmsExample method show.
/*
* (non-Javadoc)
*
* @see de.desjardins.ol3.demo.client.example.Example#show()
*/
@Override
public void show(String exampleId) {
TileWmsParams params = new TileWmsParams();
params.setLayers("topp:states");
params.setTiled(true);
TileWmsOptions options = new TileWmsOptions();
options.setUrl("https://ahocevar.com/geoserver/wms");
options.setParams(params);
options.setServerType(WmsServerType.GEOSERVER);
TileWms source = new TileWms(options);
Extent extent = new Extent(-13884991, 2870341, -7455066, 6338219);
Tile layer = new Tile();
layer.setExtent(extent);
layer.setSource(source);
Coordinate centerCoordinate = new Coordinate(-10997148, 4569099);
View view = new View();
view.setCenter(centerCoordinate);
view.setZoom(4);
// create the map
MapOptions mapOptions = new MapOptions();
mapOptions.setTarget(exampleId);
mapOptions.setView(view);
Map map = new Map(mapOptions);
map.addLayer(layer);
// add some controls
map.addControl(new ScaleLine());
DemoUtils.addDefaultControls(map.getControls());
// add some interactions
map.addInteraction(new KeyboardPan());
map.addInteraction(new KeyboardZoom());
map.addControl(new Rotate());
}
Aggregations