aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--assets/default.yml118
-rw-r--r--package.json2
-rw-r--r--src/editor.mjs2
3 files changed, 120 insertions, 2 deletions
diff --git a/assets/default.yml b/assets/default.yml
new file mode 100644
index 0000000..e8a428c
--- /dev/null
+++ b/assets/default.yml
@@ -0,0 +1,118 @@
1aliases:
2 use:
3 Leaflet:
4 value: ./dist/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: ./dist/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: ./dist/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 width:
13 One-Third: 33%
14 Half: 50%
15 Three-Quarter: 75%
16 Full: 100%
17 height:
18 Small: 200px
19 Medium: 30vh
20 Huge: 75vh
21 center:
22 ARGENTINA Buenos Aires: [ -58.3816, -34.6037 ]
23 BANGLADESH Dhaka: [ 90.4125, 23.8103 ]
24 BRAZIL Sao Paulo: [ -46.6333, -23.5505 ]
25 CHINA Beijing: [ 116.4074, 39.9042 ]
26 CHINA Shanghai: [ 121.4737, 31.2304 ]
27 EGYPT Cairo: [ 31.2357, 30.0444 ]
28 INDIA Delhi: [ 77.1025, 28.7041 ]
29 INDIA Mumbai: [ 72.8777, 19.0760 ]
30 JAPAN Osaka: [ 135.5022, 34.6937 ]
31 MEXICO Mexico City: [ -99.1332, 19.4326 ]
32 NIGERIA Lagos: [ 3.3792, 6.5244 ]
33 PAKISTAN Karachi: [ 67.0011, 24.8607 ]
34 PILLIPPINES Manila: [ 120.9842, 14.5995 ]
35 TAIWAN Changhua County: [120.5445, 24.0756]
36 TAIWAN Hsinchu County: [121.0128, 24.8267]
37 TAIWAN Hualien County: [121.6112, 23.9911]
38 TAIWAN Kaohsiung City: [120.2667, 22.6333]
39 TAIWAN Keelung City: [121.741, 25.131]
40 TAIWAN Miaoli County: [120.8152, 24.5734]
41 TAIWAN Nantou County: [120.9818101, 23.9512034]
42 TAIWAN New Taipei City: [121.457, 25.062]
43 TAIWAN Pingtung County: [120.5502695, 22.5468588]
44 TAIWAN Taichung City: [120.6736, 24.1477]
45 TAIWAN Tainan City: [120.2067478, 22.9963617]
46 TAIWAN Taipei City: [121.5182451, 25.0504781]
47 TAIWAN Taitung County: [121.1508031, 22.7706117]
48 TAIWAN Taoyuan City: [121.297, 24.994]
49 TAIWAN Yilan County: [121.7627819, 24.7637321]
50 TURKEY Istanbul: [ 28.9784, 41.0082 ]
51 USA New York City: [ -74.0059, 40.7128 ]
52 zoom:
53 Whole world: 0
54 Subcontinental area: 2
55 Large African country: 5
56 Large European country: 6
57 Wide area, large metropolitan area: 9
58 Metropolitan area: 10
59 City: 11
60 Town, or city district: 12
61 Village, or suburb: 13
62 Street: 16
63 Block, park, addresses: 17
64 Building: 20
65 XYZ:
66 OSM Carto: https://tile.openstreetmap.org/{z}/{x}/{y}.png
67 OSM Bright: https://tile.openstreetmap.jp/styles/osm-bright/512/{z}/{x}/{y}.png
68 OSM DE: https://tile.openstreetmap.de/{z}/{x}/{y}.png
69 OSM CH: https://tile.osm.ch/switzerland/{z}/{x}/{y}.png
70 OSM FR: https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png
71 OSM FR Hot: https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png
72 OSM BZH: https://tile.openstreetmap.bzh/br/{z}/{x}/{y}.png
73 OSM BZH CA: https://tile.openstreetmap.bzh/ca/{z}/{x}/{y}.png
74 MemoMaps: https://tileserver.memomaps.de/tilegen/{z}/{x}/{y}.png
75 OpenTopoMap: https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png
76 Stadia Alidade Smooth: https://tiles.stadiamaps.com/tiles/alidade_smooth/{z}/{x}/{y}{r}.{ext}
77 Staida Alidade Smooth Dark: https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}{r}.{ext}
78 Stadia OSM Bright: https://tiles.stadiamaps.com/tiles/osm_bright/{z}/{x}/{y}{r}.{ext}
79 Stadia Outdoors: https://tiles.stadiamaps.com/tiles/outdoors/{z}/{x}/{y}{r}.{ext}
80 Stadia Toner: https://tiles.stadiamaps.com/tiles/stamen_toner/{z}/{x}/{y}{r}.{ext}
81 Stadis Toner Light: https://tiles.stadiamaps.com/tiles/stamen_toner_lite/{z}/{x}/{y}{r}.{ext}
82 Stadia Water Color: https://tiles.stadiamaps.com/tiles/stamen_watercolor/{z}/{x}/{y}.{ext}
83 Stadia Terrain: https://tiles.stadiamaps.com/tiles/stamen_terrain/{z}/{x}/{y}{r}.{ext}
84 Stadia Terrain Background: https://tiles.stadiamaps.com/tiles/stamen_terrain_background/{z}/{x}/{y}{r}.{ext}
85 BaseMap DE Color: https://sgx.geodatenzentrum.de/wmts_basemapde/tile/1.0.0/de_basemapde_web_raster_farbe/default/GLOBAL_WEBMERCATOR/{z}/{y}/{x}.png
86 BaseMap DE Grey: https://sgx.geodatenzentrum.de/wmts_basemapde/tile/1.0.0/de_basemapde_web_raster_grau/default/GLOBAL_WEBMERCATOR/{z}/{y}/{x}.png
87 Cycloms: https://{s}.tile-cyclosm.openstreetmap.fr/cyclosm/{z}/{x}/{y}.png
88 FreeMap SK: https://{s}.freemap.sk/T/{z}/{x}/{y}.jpeg
89 MtbMap: http://tile.mtbmap.cz/mtbmap_tiles/{z}/{x}/{y}.png
90 MapTiler Basic: https://tile.openstreetmap.jp/styles/maptiler-basic-en/512/{z}/{x}/{y}.png
91 MapTiler Toner: https://tile.openstreetmap.jp/styles/maptiler-toner-ja/512/{z}/{x}/{y}.png
92 OpenMapTiles: https://tile.openstreetmap.jp/styles/openmaptiles/512/{z}/{x}/{y}.png
93 TAIWAN Rudymap: https://tile.happyman.idv.tw/map/moi_osm/{z}/{x}/{y}.png
94 TAIWAN Happyman GPX: https://tile.happyman.idv.tw/map/gpxtrack/{z}/{x}/{y}.png
95 TAIWAN Happyman MOI: https://tile.happyman.idv.tw/map/moi_osm/{z}/{x}/{y}.png
96 TAIWAN TERRAIN RGB: https://osmhacktw.github.io/terrain-rgb/tiles/{z}/{x}/{y}.png
97 ESRI World Topo: https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}
98 ESRI World Imagery: https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}
99 ESRI World Shaded Relief: https://server.arcgisonline.com/ArcGIS/rest/services/World_Shaded_Relief/MapServer/tile/{z}/{y}/{x}
100 ESRI World Ocean: https://server.arcgisonline.com/ArcGIS/rest/services/Ocean/World_Ocean_Base/MapServer/tile/{z}/{y}/{x}
101 ESRI World Light Gray: https://server.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/{z}/{y}/{x}
102 ESRI NatGeo World: https://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/{z}/{y}/{x}
103 WMTS:
104 TAIWAN NLSC: https://wmts.nlsc.gov.tw/wmts
105 TAIWAN TERRAIN-RGB: https://osmhacktw.github.io/terrain-rgb/wmts.xml
106 TAIWAN TAIPEI-GOV: https://www.historygis.udd.gov.taipei/wmts
107 TAIWAN SINICA: https://gis.sinica.edu.tw/tileserver/wmts
108 TAIWAN SINICA_TAOYUAN: https://gis.sinica.edu.tw/taoyuan/wmts
109 TAIWAN SINICA_TAICHUNG: https://gis.sinica.edu.tw/taichung/wmts
110 TAIWAN SINICA_CHIAYI: https://gis.sinica.edu.tw/chiayi/wmts
111 TAIWAN SINICA_HUALIAN: https://gis.sinica.edu.tw/hualien/wmts
112 TAIWAN SINICA_SHANGHAI: http://gis.sinica.edu.tw/shanghai/wmts
113 TAIWAN SINICA_BEIJING: http://gis.sinica.edu.tw/beijing/wmts
114 TAIWAN SINICA_WORLD: https://gis.sinica.edu.tw/worldmap/wmts-proxy
115 TAIWAN SINICA_CCTS: https://gis.sinica.edu.tw/ccts/wmts
116 TAIWAN NCU_REMOTE: https://data.csrsr.ncu.edu.tw/SP/wmts
117 TAIWAN NCU_REMOTE_TW: https://data.csrsr.ncu.edu.tw/SP_TW_FC/wmts
118 TAIWAN CHIAYI-GOV: https://3dmap.chiayi.gov.tw/wmts/
diff --git a/package.json b/package.json
index 933090f..5aa39de 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,7 @@
22 "build": "mkdir -p dist; npm run build-css; npm run build-renderers; npm run build-resources; npx rollup -c", 22 "build": "mkdir -p dist; npm run build-css; npm run build-renderers; npm run build-resources; npx rollup -c",
23 "build-css": "rm -rf dist/css; cp -r src/css dist; cp node_modules/easymde/dist/easymde.min.css dist/css/", 23 "build-css": "rm -rf dist/css; cp -r src/css dist; cp node_modules/easymde/dist/easymde.min.css dist/css/",
24 "build-renderers": "rm -rf dist/renderers; cp -r node_modules/mapclay/dist/renderers dist", 24 "build-renderers": "rm -rf dist/renderers; cp -r node_modules/mapclay/dist/renderers dist",
25 "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", 25 "build-resources": "cp node_modules/easymde/dist/easymde.min.js dist; cp node_modules/easymde/dist/easymde.min.css dist/css",
26 "server": "live-server --port=8080 --ignore='**/src/**js' --wait=2000 --no-browser --cors", 26 "server": "live-server --port=8080 --ignore='**/src/**js' --wait=2000 --no-browser --cors",
27 "dev": "npm run server", 27 "dev": "npm run server",
28 "lint": "npx standard", 28 "lint": "npx standard",
diff --git a/src/editor.mjs b/src/editor.mjs
index 84144af..64d5cf6 100644
--- a/src/editor.mjs
+++ b/src/editor.mjs
@@ -514,7 +514,7 @@ const rendererOptions = {}
514// }}} 514// }}}
515// Aliases for map options {{{ 515// Aliases for map options {{{
516const aliasesForMapOptions = {} 516const aliasesForMapOptions = {}
517const defaultApply = './dist/default.yml' 517const defaultApply = '/assets/default.yml'
518fetch(defaultApply) 518fetch(defaultApply)
519 .then(res => res.text()) 519 .then(res => res.text())
520 .then(rawText => { 520 .then(rawText => {