File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -361,7 +361,10 @@ <h5>Appearance</h5>
361
361
< gf-form-switch class ="gf-form " label ="Show Zoom Control " label-class ="width-10 " checked ="ctrl.panel.showZoomControl " on-change ="ctrl.restart() "> </ gf-form-switch >
362
362
< gf-form-switch class ="gf-form " label ="Mouse Wheel Zoom " label-class ="width-10 " checked ="ctrl.panel.mouseWheelZoom " on-change ="ctrl.toggleMouseWheelZoom() "> </ gf-form-switch >
363
363
</ div >
364
-
364
+ < gf-form-switch class ="gf-form " label ="Dragging " label-class ="width-10 " checked ="ctrl.panel.dragging " on-change ="ctrl.toggleDragging() "> </ gf-form-switch >
365
+ </ div >
366
+ < gf-form-switch class ="gf-form " label ="Double Click Zoom " label-class ="width-10 " checked ="ctrl.panel.doubleClickZoom " on-change ="ctrl.toggleDoubleClickZoom() "> </ gf-form-switch >
367
+ </ div >
365
368
<!-- Legend -->
366
369
< div class ="gf-form-subgroup ">
367
370
< gf-form-switch class ="gf-form " label ="Show Legend " label-class ="width-10 " checked ="ctrl.panel.showLegend " on-change ="ctrl.toggleLegend() "> </ gf-form-switch >
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ export default class WorldMap {
47
47
attributionControl : this . ctrl . settings . showAttribution ,
48
48
} ) ;
49
49
this . setMouseWheelZoom ( ) ;
50
+ this . setDragging ( ) ;
51
+ this . setDoubleClickZoom ( ) ;
50
52
51
53
const selectedTileServer = tileServers [ this . ctrl . tileServer ] ;
52
54
( window as any ) . L . tileLayer ( selectedTileServer . url , {
@@ -445,6 +447,22 @@ export default class WorldMap {
445
447
}
446
448
}
447
449
450
+ setDragging ( ) {
451
+ if ( ! this . ctrl . settings . dragging ) {
452
+ this . map . dragging . disable ( ) ;
453
+ } else {
454
+ this . map . dragging . enable ( ) ;
455
+ }
456
+ }
457
+
458
+ setDoubleClickZoom ( ) {
459
+ if ( ! this . ctrl . settings . doubleClickZoom ) {
460
+ this . map . doubleClickZoom . disable ( ) ;
461
+ } else {
462
+ this . map . doubleClickZoom . enable ( ) ;
463
+ }
464
+ }
465
+
448
466
addCircles ( circles ) {
449
467
// Todo: Optionally add fixed custom attributions to the circle layer.
450
468
const attribution = undefined ;
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ const panelDefaults = {
40
40
customAttribution : false ,
41
41
customAttributionText : null ,
42
42
mouseWheelZoom : false ,
43
+ dragging : true ,
44
+ doubleClickZoom : true ,
43
45
esGeoPoint : null ,
44
46
// Todo: Investigate: Is "Count" a reasonable default here
45
47
// or does it confuse the operator?
@@ -504,6 +506,16 @@ export default class WorldmapCtrl extends MetricsPanelCtrl {
504
506
this . render ( ) ;
505
507
}
506
508
509
+ toggleDragging ( ) {
510
+ this . map . setDragging ( ) ;
511
+ this . render ( ) ;
512
+ }
513
+
514
+ toggleDoubleClickZoom ( ) {
515
+ this . map . setDoubleClickZoom ( ) ;
516
+ this . render ( ) ;
517
+ }
518
+
507
519
toggleCustomAttribution ( ) {
508
520
if ( this . settings . customAttribution ) {
509
521
const attributionControl = this . map . map . attributionControl ;
You can’t perform that action at this time.
0 commit comments