Skip to content

Commit 5b28ffe

Browse files
committed
【update】更新plot例子 review by yuhh
1 parent b4774a0 commit 5b28ffe

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

examples/leaflet/plot_dynamicPlot.html

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@
214214
});
215215
L.supermap.tiledMapLayer(url).addTo(map);
216216
var plottingLayer = L.supermap.plotting.plottingLayer("plot", serverUrl);
217-
plottingLayer.spatialAnalystUrl=host+"/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst";
218217
plottingLayer.addTo(map);
219218
var drawControl = L.supermap.plotting.drawControl(plottingLayer);
220219
drawControl.addTo(map);
@@ -226,16 +225,17 @@
226225
var plotting = L.supermap.plotting.getControl(map, serverUrl);
227226

228227
map.on('contextmenu', function (event) {
229-
if(editControl.getSelectedFeatures().length == 0){
230-
return;
228+
drawControl.handler.disable();
229+
230+
if(editControl.canPaste()){
231+
var contentMe = document.getElementById("contentMe");
232+
contentMe.style.top = event.originalEvent.clientY + "px";
233+
contentMe.style.left = event.originalEvent.clientX + "px";
234+
contentMe.style.display = "block";
235+
document.getElementById("paste").onclick = function(){
236+
editControl.paste(event.latlng);
237+
};
231238
}
232-
var contentMe = document.getElementById("contentMe");
233-
contentMe.style.top = event.originalEvent.clientY + "px";
234-
contentMe.style.left = event.originalEvent.clientX + "px";
235-
contentMe.style.display = "block";
236-
document.getElementById("paste").onclick = function(){
237-
editControl.paste(event.latlng);
238-
};
239239
}).on('mousemove', function (event) {
240240
contentMe.style.display = "none";
241241
});
@@ -493,6 +493,13 @@
493493
}
494494
}
495495

496+
// document.oncontextmenu = function (event) {
497+
// var event = event || window.event;
498+
// if(event.button == 2){
499+
// drawControl.handler.disable();
500+
// }
501+
// }
502+
496503
</script>
497504
</body>
498505
</html>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy