mirror of
https://github.com/meshcore-dev/map.meshcore.dev.git
synced 2026-04-20 22:13:50 +00:00
Merge branch 'main' of github.com:recrof/map.meshcore.dev
This commit is contained in:
commit
b85c616511
1 changed files with 12 additions and 1 deletions
13
src/map.js
13
src/map.js
|
|
@ -282,13 +282,18 @@ const baseMaps = {
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let params = { lat: 7, lon: 25, zoom: 3 };
|
||||||
let params = { lat: 7, lon: 25, zoom: 3 };
|
let params = { lat: 7, lon: 25, zoom: 3 };
|
||||||
|
|
||||||
const urlParams = Object.fromEntries(new URLSearchParams(location.search));
|
const urlParams = Object.fromEntries(new URLSearchParams(location.search));
|
||||||
|
if(Number(urlParams.lat) && Number(urlParams.lon) && Number(urlParams.zoom)) {
|
||||||
|
params = urlParams
|
||||||
if(Number(urlParams.lat) && Number(urlParams.lon) && Number(urlParams.zoom)) {
|
if(Number(urlParams.lat) && Number(urlParams.lon) && Number(urlParams.zoom)) {
|
||||||
params = urlParams
|
params = urlParams
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// console.log(params);
|
||||||
|
|
||||||
const map = window.leafletMap = leaflet.map('map', {
|
const map = window.leafletMap = leaflet.map('map', {
|
||||||
minZoom: 2,
|
minZoom: 2,
|
||||||
maxBounds: [
|
maxBounds: [
|
||||||
|
|
@ -319,6 +324,9 @@ const icons = Object.fromEntries(['none', 'recent', 'stale', 'old', 'extinct'].m
|
||||||
createApp({
|
createApp({
|
||||||
setup() {
|
setup() {
|
||||||
const app = window.app = reactive({
|
const app = window.app = reactive({
|
||||||
|
nodes: [],
|
||||||
|
nodesByType: {},
|
||||||
|
filteredNodes: [],
|
||||||
nodes: [],
|
nodes: [],
|
||||||
nodesByType: {},
|
nodesByType: {},
|
||||||
filteredNodes: [],
|
filteredNodes: [],
|
||||||
|
|
@ -526,6 +534,9 @@ createApp({
|
||||||
app.urlParams.zoom = zoom;
|
app.urlParams.zoom = zoom;
|
||||||
app.urlParams.lat = pos.lat.toFixed(4);
|
app.urlParams.lat = pos.lat.toFixed(4);
|
||||||
app.urlParams.lon = pos.lng.toFixed(4);
|
app.urlParams.lon = pos.lng.toFixed(4);
|
||||||
|
app.urlParams.zoom = zoom;
|
||||||
|
app.urlParams.lat = pos.lat.toFixed(4);
|
||||||
|
app.urlParams.lon = pos.lng.toFixed(4);
|
||||||
});
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
@ -556,4 +567,4 @@ createApp({
|
||||||
clearFilters
|
clearFilters
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}).mount('#app')
|
}).mount('#app')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue