Skip to content

Commit

Permalink
added bing
Browse files Browse the repository at this point in the history
  • Loading branch information
limex committed Nov 11, 2023
1 parent 950e723 commit 95c29df
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/background.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/background.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/options.eb4e2aed.js → dist/options.18e76187.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/options.18e76187.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/options.eb4e2aed.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion dist/options.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset="utf-8"><link rel="stylesheet" href="/options.21194506.css"></head><body> <div id="options"></div> <script src="/options.eb4e2aed.js"></script> </body></html>
<!DOCTYPE html><html><head><meta charset="utf-8"><link rel="stylesheet" href="/options.21194506.css"></head><body> <div id="options"></div> <script src="/options.18e76187.js"></script> </body></html>
4 changes: 2 additions & 2 deletions dist/popup.ef341713.js → dist/popup.5138eec1.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/popup.5138eec1.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/popup.ef341713.js.map

This file was deleted.

2 changes: 1 addition & 1 deletion dist/popup.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html><head><meta charset="utf-8"><link rel="stylesheet" href="/popup.d0afbe9b.css"></head><body> <div id="popup"></div> <script src="/popup.ef341713.js"></script> </body></html>
<!DOCTYPE html><html><head><meta charset="utf-8"><link rel="stylesheet" href="/popup.d0afbe9b.css"></head><body> <div id="popup"></div> <script src="/popup.5138eec1.js"></script> </body></html>
21 changes: 21 additions & 0 deletions src/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,27 @@ const maps_raw = [
}
},
},
{
name: "Bing",
category: MISC_CATEGORY,
default_check: true,
domain: "www.bing.com",
getUrl(lat, lon, zoom) {
// https://learn.microsoft.com/en-us/bingmaps/articles/create-a-custom-map-url#collections-categories
return "https://www.bing.com/maps?cp=" + lat + "~" + lon + "&lvl=" + zoom;
},
getLatLonZoom(url) {
// https://www.bing.com/maps?q=Grindav%C3%ADk&FORM=HDRSC6&cp=63.825761%7E-22.17778&lvl=10.7
const match = url.match(
/www\.bing\.com\/maps.*cp=(-?\d[0-9.]*)%7E(-?\d[0-9.]*)&lvl=(-?\d[0-9.]*)/
);
if (match) {
let [, lat, lon, zoom] = match;
zoom = Math.round(zoom);
return [lat, lon, zoom];
}
},
},
{
name: "OpenStreetMap",
category: OSM_CATEGORY,
Expand Down

0 comments on commit 95c29df

Please sign in to comment.