IEEE.org     |     IEEE Xplore Digital Library     |     IEEE Standards     |     IEEE Spectrum     |     More Sites

Commit ef10edb0 authored by jedjas12's avatar jedjas12
Browse files

Added map scale

parent 8972509a
......@@ -48,11 +48,10 @@ export default class GeoQuery extends LightningElement {
[-30.06909396443886, 26.102030238912395],
[-7.231698708367139, 74.47760116029443]]);
// Locks the map region to one earth.
// Locks the map region to one earth (prevents dragging)
map.setMaxBounds([[-90,-180],[90,180]]);
// Implement map "on click" handler
// If we could keep a reference to the map via a class variable (this.map = event.detail) this would be a lot cleaner
// to bad this map doesn't wish to cooperate at the time being.
......
......@@ -33,7 +33,8 @@ export default class Map extends LightningElement {
const mapRoot = this.template.querySelector('.map-root');
this.map = L.map(mapRoot);
this.map.fitWorld();
L.control.scale().addTo(this.map);
}
/**
......@@ -46,7 +47,9 @@ export default class Map extends LightningElement {
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
{
attribution: '© ' + mapLink + ' Contributors',
maxZoom: 18
//minZoom: 4,
maxZoom: 5,
maxNativeZoom: 5
})
.addTo(this.map);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment