@openhistoricalmap/map-styles 0.9.10 → 0.9.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.html +19 -0
- package/package.json +5 -3
- package/wkg/index.html +18 -0
package/README.md
CHANGED
|
@@ -45,7 +45,7 @@ We use the hosted version of the [Maputnik visual editor](https://maputnik.githu
|
|
|
45
45
|
1. clone this repo to your computer or [download the latest release](https://github.com/OpenHistoricalMap/map-styles/releases).
|
|
46
46
|
`git clone git@github.com:OpenHistoricalMap/map-styles.git`
|
|
47
47
|
2. run `npm install` from the root directory.
|
|
48
|
-
3. run `npm run start` in the root directory; this will start
|
|
48
|
+
3. run `npm run start` in the root directory; this will start `browsersync` and open a new tab or window in your browser. Everything except for the OHM vector tile sources (style files, glyphs, sprites) will be running locally on port 8888.
|
|
49
49
|
4. open the style file you wish to work on in Maputnik.; it will be `historical/historical.json` or an equivalent path for a different style.
|
|
50
50
|
5. if you're submitting changes to OpenHistoricalMap please begin by creating an issue that describes them at our [issues repository](https://github.com/OpenHistoricalMap/issues/), which is different from [where you'd submit your pull request](https://github.com/OpenHistoricalMap/map-styles).
|
|
51
51
|
6. when you're satisfied with your local changes, repopulate the `dist` directory by running `npm run build`; the build step replaces references to `localhost` with the production values of the OpenHistoricalMap servers for `glyph` and `sprite` serving; this is required prior to deploying to OHM's staging and production servers. If you're hosting your own fonts or icons you'll need to edit these for your custom use.
|
package/index.html
CHANGED
|
@@ -50,5 +50,24 @@
|
|
|
50
50
|
|
|
51
51
|
</script>
|
|
52
52
|
|
|
53
|
+
<script id="__bs_script__">//<![CDATA[
|
|
54
|
+
(function() {
|
|
55
|
+
try {
|
|
56
|
+
var script = document.createElement('script');
|
|
57
|
+
if ('async') {
|
|
58
|
+
script.async = true;
|
|
59
|
+
}
|
|
60
|
+
script.src = 'http://HOST:3001/browser-sync/browser-sync-client.js?v=3.0.4'.replace("HOST", location.hostname);
|
|
61
|
+
if (document.body) {
|
|
62
|
+
document.body.appendChild(script);
|
|
63
|
+
} else if (document.head) {
|
|
64
|
+
document.head.appendChild(script);
|
|
65
|
+
}
|
|
66
|
+
} catch (e) {
|
|
67
|
+
console.error("Browsersync: could not append script tag", e);
|
|
68
|
+
}
|
|
69
|
+
})()
|
|
70
|
+
//]]></script>
|
|
71
|
+
|
|
53
72
|
</body>
|
|
54
73
|
</html>
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openhistoricalmap/map-styles",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.11",
|
|
4
4
|
"description": "A collection of map styles for OpenHistoricalMap",
|
|
5
5
|
"main": "''",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "scripts/prepare.js",
|
|
9
|
-
"start": "
|
|
9
|
+
"start": "browser-sync start --server --port 8888 --https --startPath '#7.33/40.487/-73.554' --files ['historical/*', 'railway/*', 'japanese_scroll/*', 'woodblock/*']"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
@@ -25,8 +25,10 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"camelcase": "^8.0.0",
|
|
27
27
|
"fs-extra": "^11.3.0",
|
|
28
|
-
"http-server": "^14.1.1",
|
|
29
28
|
"maplibre-gl": "^5.1.0",
|
|
30
29
|
"maplibre-gl-style-flipper": "^1.0.7"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"browser-sync": "^3.0.4"
|
|
31
33
|
}
|
|
32
34
|
}
|
package/wkg/index.html
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
<head>
|
|
3
|
+
<script src="https://unpkg.com/maplibre-gl@^5.3.0/dist/maplibre-gl.js"></script>
|
|
4
|
+
<link href="https://unpkg.com/maplibre-gl@^5.3.0/dist/maplibre-gl.css" rel="stylesheet" />
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<div id="map" style="width:100%;height:100%"></div>
|
|
8
|
+
<script>
|
|
9
|
+
var map = new maplibregl.Map({
|
|
10
|
+
container: 'map', // container id
|
|
11
|
+
style: 'https://unpkg.com/@openhistoricalmap/map-styles@latest/dist/woodblock/woodblock.json', // style URL
|
|
12
|
+
center: [0, 0], // starting position [lng, lat]
|
|
13
|
+
zoom: 1 // starting zoom
|
|
14
|
+
});
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|