Renaming of getGetFeatureInfoUrl and getGetLegendGraphicUrl
This commit is contained in:
@@ -29,7 +29,7 @@ const map = new Map({
|
||||
map.on('singleclick', function(evt) {
|
||||
document.getElementById('info').innerHTML = '';
|
||||
const viewResolution = /** @type {number} */ (view.getResolution());
|
||||
const url = wmsSource.getGetFeatureInfoUrl(
|
||||
const url = wmsSource.getFeatureInfoUrl(
|
||||
evt.coordinate, viewResolution, 'EPSG:3857',
|
||||
{'INFO_FORMAT': 'text/html'});
|
||||
if (url) {
|
||||
|
||||
@@ -29,7 +29,7 @@ const map = new Map({
|
||||
map.on('singleclick', function(evt) {
|
||||
document.getElementById('info').innerHTML = '';
|
||||
const viewResolution = /** @type {number} */ (view.getResolution());
|
||||
const url = wmsSource.getGetFeatureInfoUrl(
|
||||
const url = wmsSource.getFeatureInfoUrl(
|
||||
evt.coordinate, viewResolution, 'EPSG:3857',
|
||||
{'INFO_FORMAT': 'text/html'});
|
||||
if (url) {
|
||||
|
||||
@@ -4,11 +4,11 @@ title: WMS GetLegendGraphic
|
||||
shortdesc: Example of a WMS GetLegendGraphic.
|
||||
docs: >
|
||||
WMS supports the [getLegendGraphic request](https://docs.geoserver.org/latest/en/user/services/wms/get_legend_graphic/index.html).
|
||||
This example demonstrates the use of the `getGetLegendGraphicUrl` method.
|
||||
This example demonstrates the use of the `getLegendUrl` method.
|
||||
|
||||
|
||||
As a legend can be responsive to the scale it is updated on every change of the resolution.
|
||||
tags: "GetLegendGraphic, getGetLegendGraphicURL, WMS"
|
||||
tags: "GetLegendGraphic, getLegendUrl, WMS"
|
||||
---
|
||||
<div id="map" class="map"></div>
|
||||
Legend:
|
||||
|
||||
@@ -12,7 +12,7 @@ const wmsSource = new ImageWMS({
|
||||
});
|
||||
|
||||
const updateLegend = function(resolution) {
|
||||
const graphicUrl = wmsSource.getGetLegendGraphicUrl(resolution);
|
||||
const graphicUrl = wmsSource.getLegendUrl(resolution);
|
||||
const img = document.getElementById('legend');
|
||||
img.src = graphicUrl;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user