This example shows how to trigger WMS GetFeatureInfo requests on click for a WMS image layer. Additionally
这个例子用来说明在WMS图像图层上单击如何触发WMS的GetFeatureInfo请求。此外,map.forEachLayerAtPixel用来改变鼠标指针当其在地图上一个不透明的像素上停留的时候。
代码:
map.forEachLayerAtPixel
is used to change the mouse pointer when hovering a non-transparent pixel on the map.这个例子用来说明在WMS图像图层上单击如何触发WMS的GetFeatureInfo请求。此外,map.forEachLayerAtPixel用来改变鼠标指针当其在地图上一个不透明的像素上停留的时候。
代码:
<!DOCTYPE html>
<html>
<head>
<title>WMS GetFeatureInfo (Image Layer)</title>
<link rel="stylesheet" href="https://openlayers.org/en/v4.2.0/css/ol.css" type="text/css">
<!-- The line below is only needed for old environments like Internet Explorer and Android 4.x -->
<script src