Skip to content

Commit

Permalink
Added a scale control to the controls toggled on and off.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy Townsend committed Jul 15, 2024
1 parent 7ea13cd commit a0f1846
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions map/Scripts/leaflet_embed_small.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ var map;
var layersControl;
var layersControl_shown = false;
var zoomControl;
var scaleControl;
var ajaxRequest;
var current_zoom = 9;
var current_layer;
Expand Down Expand Up @@ -474,12 +475,14 @@ function toggle_controls()
{
layersControl.removeFrom( map );
zoomControl.removeFrom( map );
scaleControl.removeFrom( map );
layersControl_shown = false;
}
else
{
layersControl.addTo( map );
zoomControl.addTo( map );
scaleControl = L.control.scale().addTo( map );
layersControl_shown = true;
}
}
Expand Down

0 comments on commit a0f1846

Please sign in to comment.