Skip to content

Commit

Permalink
added maps, impoved build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
limex committed Apr 3, 2024
1 parent f5a5214 commit 1b01bfb
Show file tree
Hide file tree
Showing 16 changed files with 73 additions and 35 deletions.
19 changes: 19 additions & 0 deletions deploy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { cpSync, rmSync } = require('fs');

// Replace 'dist' with the actual build output folder
const sourceFolder = 'dist';

// Replace '/path/to/production/folder' with the target production folder
const targetFolder = '/Users/guntherbosch/Chrome.Extensions/OpenMapSwitcher/dist-v2/';

try {
// Empty the target folder before copying
rmSync(targetFolder, { recursive: true, force: true });
console.log(`Successfully emptied ${targetFolder}`);

// Copy files from source folder to target folder
cpSync(sourceFolder, targetFolder, { recursive: true });
console.log(`Successfully copied files from ${sourceFolder} to ${targetFolder}`);
} catch (error) {
console.error('Error copying files:', error.message);
}
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.

2 changes: 1 addition & 1 deletion dist/manifest.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"OpenSwitchMaps_limex","version":"1.6.0","description":"Switch map services and Tools for OpenStreetMap contributors","homepage_url":"https://github.com/limex/OpenSwitchMaps","permissions":["activeTab","tabs","storage"],"background":{"scripts":["background.js"]},"page_action":{"default_popup":"popup.html","default_icon":{"128":"icon128.png"}},"icons":{"128":"icon128.png"},"options_ui":{"page":"options.html"},"manifest_version":2}
{"name":"OpenSwitchMaps_limex","version":"1.6.5","description":"Switch map services and Tools for OpenStreetMap contributors","homepage_url":"https://github.com/limex/OpenSwitchMaps","permissions":["activeTab","tabs","storage"],"background":{"scripts":["background.js"]},"page_action":{"default_popup":"popup.html","default_icon":{"128":"icon128.png"}},"icons":{"128":"icon128.png"},"options_ui":{"page":"options.html"},"manifest_version":2}
4 changes: 2 additions & 2 deletions dist/options.c112da62.js → dist/options.6a1e1d69.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/options.6a1e1d69.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/options.c112da62.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.c112da62.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.6a1e1d69.js"></script> </body></html>
4 changes: 2 additions & 2 deletions dist/popup.756723e4.js → dist/popup.3ffcac9c.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/popup.3ffcac9c.js.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion dist/popup.756723e4.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.756723e4.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.3ffcac9c.js"></script> </body></html>
40 changes: 20 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "openswitchmapslimex",
"version": "1.6.0",
"version": "1.6.5",
"description": "Switch map services and Tools for OpenStreetMap contributors",
"scripts": {
"dev": "parcel watch src/manifest.json",
"build": "parcel build src/manifest.json"
"build": " rm -r dist && sh inc_patch.sh && parcel build src/manifest.json && node deploy.js"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "OpenSwitchMaps_limex",
"version": "1.6.0",
"version": "1.6.5",
"description": "Switch map services and Tools for OpenStreetMap contributors",
"homepage_url": "https://github.com/limex/OpenSwitchMaps",
"permissions": [
Expand Down
21 changes: 20 additions & 1 deletion src/maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ const maps_raw = [
);
if (match) {
let [, zoom, lat, lon] = match;
zoom = Math.round(zoom);
// zoom = Math.round(zoom);
return [lat, lon, zoom];
}
},
Expand Down Expand Up @@ -616,6 +616,25 @@ const maps_raw = [
}
},
},
{
// https://www.norgeskart.no/#!?project=norgeskart&layers=1002&zoom=13&lat=6649044.14&lon=262775.36
name: "Norgeskart",
category: OUTDOOR_CATEGORY,
default_check: true,
domain: "www.norgeskart.no",
description: "Outdoor, POI",
getUrl(lat, lon, zoom) {
return "https://www.norgeskart.no/#!?project=norgeskart&layers=1002,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023&zoom=" + zoom + "&lat=" + lat + "&lon=" + lon;
},
getLatLonZoom(url) {
const match = url.match(/www\.norgeskart\.no.*#.*layers=1002.*([0-9.]*)\/(-?\d[0-9.]*)\/(-?\d[0-9.]*)/);

if (match) {
const [, zoom, lat, lon] = match;
return [lat, normalizeLon(lon), Math.round(Number(zoom))];
}
},
},
{
name: "Flussinfo",
category: WATER_CATEGORY,
Expand Down

0 comments on commit 1b01bfb

Please sign in to comment.