Skip to content

Commit

Permalink
Cleaner map controls, fix opacity label alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed May 2, 2024
1 parent 59e1049 commit d735582
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 66 deletions.
11 changes: 2 additions & 9 deletions app/static/app/js/components/Map.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import '../css/Map.scss';
import 'leaflet/dist/leaflet.css';
import Leaflet from 'leaflet';
import async from 'async';
import '../vendor/leaflet/L.Control.MousePosition.css';
import '../vendor/leaflet/L.Control.MousePosition';
import '../vendor/leaflet/Leaflet.Autolayers/css/leaflet.auto-layers.css';
import '../vendor/leaflet/Leaflet.Autolayers/leaflet-autolayers';
// import '../vendor/leaflet/L.TileLayer.NoGap';
Expand Down Expand Up @@ -385,7 +383,7 @@ class Map extends React.Component {

this.map = Leaflet.map(this.container, {
scrollWheelZoom: true,
positionControl: true,
positionControl: false,
zoomControl: false,
minZoom: 0,
maxZoom: 24
Expand All @@ -401,10 +399,6 @@ class Map extends React.Component {
mapView: this
});

let scaleControl = Leaflet.control.scale({
maxWidth: 250,
}).addTo(this.map);

//add zoom control with your options
let zoomControl = Leaflet.control.zoom({
position:'bottomleft'
Expand Down Expand Up @@ -580,7 +574,6 @@ _('Example:'),
tiles: tiles,
controls:{
autolayers: this.autolayers,
scale: scaleControl,
zoom: zoomControl
}
});
Expand Down Expand Up @@ -630,7 +623,7 @@ _('Example:'),
<div style={{height: "100%"}} className="map">
<ErrorMessage bind={[this, 'error']} />
<div className="opacity-slider theme-secondary hidden-xs">
{_("Opacity:")} <input type="range" step="1" value={this.state.opacity} onChange={this.updateOpacity} />
<div className="opacity-slider-label">{_("Opacity:")}</div> <input type="range" step="1" value={this.state.opacity} onChange={this.updateOpacity} />
</div>

<Standby
Expand Down
5 changes: 5 additions & 0 deletions app/static/app/js/css/Map.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
margin-left: -100px;
z-index: 999;
padding-bottom: 6px;
.opacity-slider-label{
display: inline-block;
position: relative;
top: 2px;
}
}

.leaflet-touch .leaflet-control-layers-toggle, .leaflet-control-layers-toggle{
Expand Down
9 changes: 0 additions & 9 deletions app/static/app/js/vendor/leaflet/L.Control.MousePosition.css

This file was deleted.

48 changes: 0 additions & 48 deletions app/static/app/js/vendor/leaflet/L.Control.MousePosition.js

This file was deleted.

0 comments on commit d735582

Please sign in to comment.