|
214 | 214 | });
|
215 | 215 | L.supermap.tiledMapLayer(url).addTo(map);
|
216 | 216 | var plottingLayer = L.supermap.plotting.plottingLayer("plot", serverUrl);
|
217 |
| - plottingLayer.spatialAnalystUrl=host+"/iserver/services/spatialanalyst-sample/restjsr/spatialanalyst"; |
218 | 217 | plottingLayer.addTo(map);
|
219 | 218 | var drawControl = L.supermap.plotting.drawControl(plottingLayer);
|
220 | 219 | drawControl.addTo(map);
|
|
226 | 225 | var plotting = L.supermap.plotting.getControl(map, serverUrl);
|
227 | 226 |
|
228 | 227 | 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 | + }; |
231 | 238 | }
|
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 |
| - }; |
239 | 239 | }).on('mousemove', function (event) {
|
240 | 240 | contentMe.style.display = "none";
|
241 | 241 | });
|
|
493 | 493 | }
|
494 | 494 | }
|
495 | 495 |
|
| 496 | + // document.oncontextmenu = function (event) { |
| 497 | + // var event = event || window.event; |
| 498 | + // if(event.button == 2){ |
| 499 | + // drawControl.handler.disable(); |
| 500 | + // } |
| 501 | + // } |
| 502 | + |
496 | 503 | </script>
|
497 | 504 | </body>
|
498 | 505 | </html>
|
|
0 commit comments