Skip to content

Commit

Permalink
feat: parse params types
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Mar 28, 2023
1 parent 06e4cc4 commit 42fd231
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/map/map.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
'use strict';

const gPos = 'pb';
const gQuery = 'q';
const params = new URLSearchParams(document.location.search);

if (params.has(gPos)) {
console.log('pb: ' + params.get(gPos));
} else if (params.has(gQuery)) {
console.log('q: ' + params.get(gQuery));
} else {
console.log('?: ' + params);
}

const map = L.map('map').setView([51.505, -0.09], 13);
let marker = L.marker([51.5, -0.09]).addTo(map);
marker.bindPopup('Position').openPopup();
Expand Down

0 comments on commit 42fd231

Please sign in to comment.