aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2024-09-11 15:29:14 +0800
committerHsieh Chin Fan <pham@topo.tw>2024-09-11 15:29:14 +0800
commit19fcf10bfac9fbf0849f08c93c38809ad9108e5f (patch)
tree2af69b6276b4f5587c1c2811ae3ca61887aaf7ea
parent461af8cd9ce4495265d585d31ac68448b247e13b (diff)
chore: Modify source of config file
-rw-r--r--default.yml57
-rw-r--r--package.json2
-rw-r--r--src/editor.mjs2
3 files changed, 2 insertions, 59 deletions
diff --git a/default.yml b/default.yml
deleted file mode 100644
index 8967dbc..0000000
--- a/default.yml
+++ /dev/null
@@ -1,57 +0,0 @@
1aliases:
2 use:
3 leaflet:
4 value: ./renderers/leaflet.mjs,
5 description: Leaflet is the leading open-source JavaScript library for mobile-friendly interactive maps. It has all the mapping features most developers ever need.
6 maplibre:
7 value: ./renderers/maplibre.mjs,
8 description: MapLibre GL JS is a TypeScript library that uses WebGL to render interactive maps from vector tiles in a browser. The customization of the map comply with the MapLibre Style Spec.
9 openlayers:
10 value: ./renderers/openlayers.mjs,
11 description: OpenLayers makes it easy to put a dynamic map in any web page. It can display map tiles, vector data and markers loaded from any source. OpenLayers has been developed to further the use of geographic information of all kinds.
12 XYZ:
13 OSM Carto: http://b.tile.openstreetmap.org/{z}/{x}/{y}.png
14 OpenCycleMap: https://a.tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=a5dd6a2f1c934394bce6b0fb077203eb
15 Rudymap: https://tile.happyman.idv.tw/map/moi_osm/{z}/{x}/{y}.png
16 Happyman gpx: https://tile.happyman.idv.tw/map/gpxtrack/{z}/{x}/{y}.png
17 Happyman moi: https://tile.happyman.idv.tw/map/moi_osm/{z}/{x}/{y}.png
18 NLSC aeril: http://wmts.nlsc.gov.tw/wmts/PHOTO2/default/GoogleMapsCompatible/{z}/{y}/{x}
19 NLSC topo: http://wmts.nlsc.gov.tw/wmts/PHOTO_MIX/default/GoogleMapsCompatible/{z}/{y}/{x}
20 TAIWAN_ ERRAIN: https://osmhacktw.github.io/terrain-rgb/tiles/{z}/{x}/{y}.png
21 WMTS:
22 SINICA: https://gis.sinica.edu.tw/tileserver/wmts
23 NLSC: https://wmts.nlsc.gov.tw/wmts
24 WMTS TAIWAN_TERRAIN: https://osmhacktw.github.io/terrain-rgb/wmts.xml
25 center:
26 Tokyo: [ 139.6917, 35.6895 ]
27 Delhi: [ 77.1025, 28.7041 ]
28 Shanghai: [ 121.4737, 31.2304 ]
29 Sao Paulo: [ -46.6333, -23.5505 ]
30 Mumbai: [ 72.8777, 19.0760 ]
31 Mexico City: [ -99.1332, 19.4326 ]
32 Beijing: [ 116.4074, 39.9042 ]
33 Osaka: [ 135.5022, 34.6937 ]
34 Cairo: [ 31.2357, 30.0444 ]
35 New York City: [ -74.0059, 40.7128 ]
36 Dhaka: [ 90.4125, 23.8103 ]
37 Karachi: [ 67.0011, 24.8607 ]
38 Buenos Aires: [ -58.3816, -34.6037 ]
39 Istanbul: [ 28.9784, 41.0082 ]
40 Kolkata: [ 88.3639, 22.5726 ]
41 Manila: [ 120.9842, 14.5995 ]
42 Lagos: [ 3.3792, 6.5244 ]
43 Rio de Janeiro: [ -43.1729, -22.9068 ]
44 Tianjin: [ 117.1767, 39.0842 ]
45 zoom:
46 Whole world: 0
47 Subcontinental area: 2
48 Large African country: 5
49 Large European country: 6
50 Wide area, large metropolitan area: 9
51 Metropolitan area: 10
52 City: 11
53 Town, or city district: 12
54 Village, or suburb: 13
55 Street: 16
56 Block, park, addresses: 17
57 A mid-sized building: 20
diff --git a/package.json b/package.json
index 3aaf640..f82c960 100644
--- a/package.json
+++ b/package.json
@@ -23,7 +23,7 @@
23 "build": "mkdir -p dist; npm run build-css; npm run build-renderers; npm run build-resources; npx rollup -c", 23 "build": "mkdir -p dist; npm run build-css; npm run build-renderers; npm run build-resources; npx rollup -c",
24 "build-css": "cp -r src/css dist", 24 "build-css": "cp -r src/css dist",
25 "build-renderers": "cp -r node_modules/mapclay/dist/renderers dist", 25 "build-renderers": "cp -r node_modules/mapclay/dist/renderers dist",
26 "build-resources": "cp node_modules/easymde/dist/easymde.min.js dist; cp node_modules/easymde/dist/easymde.min.css dist/css", 26 "build-resources": "cp node_modules/mapclay/assets/default.yml dist; cp node_modules/easymde/dist/easymde.min.js dist; cp node_modules/easymde/dist/easymde.min.css dist/css",
27 "server": "live-server --port=8080 --ignore='**/src/**js' --wait=2000 --no-browser --cors", 27 "server": "live-server --port=8080 --ignore='**/src/**js' --wait=2000 --no-browser --cors",
28 "dev": "npm run build; npm run server", 28 "dev": "npm run build; npm run server",
29 "lint": "npx eslint src" 29 "lint": "npx eslint src"
diff --git a/src/editor.mjs b/src/editor.mjs
index 5c0bb0a..1955800 100644
--- a/src/editor.mjs
+++ b/src/editor.mjs
@@ -105,7 +105,7 @@ class Suggestion {
105// }}} 105// }}}
106// {{{ Aliases for map options 106// {{{ Aliases for map options
107const aliasesForMapOptions = {} 107const aliasesForMapOptions = {}
108const defaultApply = '/default.yml' 108const defaultApply = './dist/default.yml'
109fetch(defaultApply) 109fetch(defaultApply)
110 .then(res => res.text()) 110 .then(res => res.text())
111 .then(rawText => { 111 .then(rawText => {