Skip to content

Commit

Permalink
feat: implement leaflet with page embed
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Mar 26, 2023
1 parent 56fef8f commit 8053e5c
Show file tree
Hide file tree
Showing 12 changed files with 712 additions and 10 deletions.
9 changes: 1 addition & 8 deletions replace.js → background.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ const matcher = new RegExp(

function redirect(req) {
if (req.url.match(matcher)) {
const params = new URLSearchParams(req.url.split('?')[1]);

console.log(req);
console.log(params);

return {
redirectUrl: 'https://www.openstreetmap.org/export/embed.html?bbox=-12.041015625000002%2C44.32384807250689%2C27.465820312500004%2C57.397624055000456&layer=mapnik'
};
return { redirectUrl: browser.extension.getURL('map/map.html?' + req.url.split('?')[1]) };
}
}

Expand Down
7 changes: 5 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
],
"background": {
"scripts": [
"replace.js"
"background.js"
]
}
},
"web_accessible_resources": [
"map/map.html"
]
}
Binary file added map/leaflet/images/layers-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added map/leaflet/images/layers.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added map/leaflet/images/marker-icon-2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added map/leaflet/images/marker-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added map/leaflet/images/marker-shadow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 8053e5c

Please sign in to comment.