1
好的問題是,當我點擊地圖上的動態圖層時,錯誤的信息或沒有信息正在變成低谷。如何從esri小冊子的動態圖層中獲取正確的信息
的例子來使其更容易理解:
將被添加的動態層是:
vestigingLayer1 = L.esri.dynamicMapLayer("http://ags101.prvgld.nl/arcgis/rest/services/IBIS_bedrijventerrein_app/IBIS_bedrijventerrein_app/MapServer",
{
layers: [0],
position: 'front',
})
map.addLayer(vestigingLayer1);
,在該層上的鼠標點擊反應的codepart是:
map.on("click", function(e) {
if(typeof vestigingLayer1 === 'undefined'){
}
else{
vestigingLayer1.identify(e.latlng, function(data) {
if(data.results.length > 0) {
// Popup toevoegen en informatie toevoegen
popupText = "<div style='overflow:scroll; max-width:250px; max-height:260px;'>";
for (prop in data.results[0].attributes) {
var val = data.results[0].attributes[prop];
if (val != 'undefined' && val != "0" && prop !="OBJECTID" && prop != "Name") {
popupText += "<b>" + prop.replace(" (Esri)",'') + "</b>: " + val + "<br>";
}
}
popupText += "</div>";
//Popup toevoegen op de plaats waar geklikt is.
var popup = L.popup()
.setLatLng(e.latlng)
.setContent(popupText)
.openOn(map);
}
});
}
所以如果你通過螢火蟲關注代碼部分,你可以看到數據結果總是給出同一圖層的信息(1),或者它沒有結果。
另外一個鏈接到工作網站,使其更清晰一點。 http://geodev.prvgld.nl/geoapp/definitief/kaart.html
如果有人知道這個答案,我真的很感激它。
,不知何故它說,它不具備信息。 這很奇怪,因爲在數據庫中我可以看到有更多的信息。這可能是因爲圖層上的可點擊部分是一個小點/圖標。可能在web服務的某個地方標記爲不提供信息?那可能嗎? –