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

Commit 906ee7a5 authored by jedjas12's avatar jedjas12
Browse files

Changed zoom level

parent 4793d9e6
......@@ -82,9 +82,9 @@ export default class GeoQuery extends LightningElement {
console.log(`Map clicked at lat: ${coord.lat} lon: ${coord.lng}`);
// If you zoom out far enough the world map will start to repeat accross the screan and leaflet
// will return longitudes like 190 degrees for what would technicall be -170
// will return longitudes like 190 degrees for what would technically be -170
let mlat = (((coord.lat + 90) % 180) - 90);
let mlon = (((coord.lng + 180) % 360) - 180); //TODO
let mlon = (((coord.lng + 180) % 360) - 180);
// Remember where the user actually clicked so we can put the markers in the correct spot
let latOff = Math.trunc(coord.lat / 90);
......
......@@ -15,6 +15,8 @@ export default class Map extends LightningElement {
*
* When this is complete, call initializeleaflet()
*/
connectedCallback() {
Promise.all([
loadScript(this, leaflet + '/leaflet.js'),
......@@ -29,6 +31,7 @@ export default class Map extends LightningElement {
/**
* Constructs the Leaflet map on the page and initializes this.map
*/
map = L.map('.map-root',{drawControl: true}).setView([18.7669,46.8691])
initializeLeaflet() {
const mapRoot = this.template.querySelector('.map-root');
this.map = L.map(mapRoot);
......@@ -36,6 +39,7 @@ export default class Map extends LightningElement {
L.control.scale().addTo(this.map);
this.map.setMinZoom(2);
this.map.setMaxZoom(8);
}
/**
......@@ -48,9 +52,7 @@ export default class Map extends LightningElement {
'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
{
attribution: '© ' + mapLink + ' Contributors',
//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