tileserver-gl-light 5.2.1 → 5.3.0-pre.0
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/CHANGELOG.md +5 -0
- package/package.json +22 -12
- package/public/resources/fonts/OpenSans-Bold.ttf +0 -0
- package/public/resources/fonts/OpenSans-Italic.ttf +0 -0
- package/public/resources/fonts/OpenSans-Regular.ttf +0 -0
- package/public/resources/leaflet-hash.js +162 -0
- package/public/resources/leaflet.css +661 -0
- package/public/resources/leaflet.js +6 -0
- package/public/resources/leaflet.js.map +1 -0
- package/public/resources/mapbox-gl-rtl-text.js +1 -0
- package/public/resources/maplibre-gl-inspect.css +40 -0
- package/public/resources/maplibre-gl-inspect.js +2877 -0
- package/public/resources/maplibre-gl-inspect.js.map +1 -0
- package/public/resources/maplibre-gl.css +1 -0
- package/public/resources/maplibre-gl.js +59 -0
- package/public/resources/maplibre-gl.js.map +1 -0
- package/public/templates/data.tmpl +3 -0
- package/public/templates/viewer.tmpl +22 -1
- package/src/render.js +1 -2
- package/src/serve_data.js +1 -1
- package/src/serve_rendered.js +1 -1
- package/src/server.js +1 -1
- package/.dockerignore +0 -8
- package/.eslintignore +0 -1
- package/.eslintrc.cjs +0 -36
- package/.gitattributes +0 -11
- package/.github/dependabot.yml +0 -19
- package/.github/workflows/automerger.yml +0 -17
- package/.github/workflows/ci.yml +0 -56
- package/.github/workflows/codeql.yml +0 -37
- package/.github/workflows/ct.yml +0 -86
- package/.github/workflows/pipeline.yml +0 -43
- package/.github/workflows/release.yml +0 -175
- package/.hadolint.yml +0 -3
- package/.nvmrc +0 -1
- package/.prettierignore +0 -1
- package/.readthedocs.yaml +0 -18
- package/Dockerfile +0 -84
- package/Dockerfile_build +0 -38
- package/Dockerfile_test +0 -62
- package/ISSUE_TEMPLATE.md +0 -21
- package/PUBLISHING.md +0 -112
- package/changelog_for_version.md +0 -3
- package/commitlint.config.cjs +0 -3
- package/docker-entrypoint.sh +0 -7
- package/lint-staged.config.cjs +0 -4
- package/prettier.config.cjs +0 -13
- package/publish.js +0 -66
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# tileserver-gl changelog
|
|
2
2
|
|
|
3
|
+
## 5.3.0-pre.0
|
|
4
|
+
* Fix - Include public\resources js files on npm publish by specifying included files in package.json (https://github.com/maptiler/tileserver-gl/pull/1490) by @acalcutt
|
|
5
|
+
* Fix - Various Updates and Fix RTL Plugin Load (https://github.com/maptiler/tileserver-gl/pull/1489) by @okimiko
|
|
6
|
+
* Updates Maplibre-gl-js to v5 and adds globe support.
|
|
7
|
+
|
|
3
8
|
## 5.2.1
|
|
4
9
|
* Fix invalid Delete of 'prepare' Script required for Light Build (https://github.com/maptiler/tileserver-gl/pull/1489) by @okimiko
|
|
5
10
|
|
package/package.json
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tileserver-gl-light",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0-pre.0",
|
|
4
4
|
"description": "Map tile server for JSON GL styles - serving vector tiles",
|
|
5
5
|
"main": "src/main.js",
|
|
6
6
|
"bin": "src/main.js",
|
|
7
7
|
"type": "module",
|
|
8
|
+
"files": [
|
|
9
|
+
"docs",
|
|
10
|
+
"src",
|
|
11
|
+
"public",
|
|
12
|
+
"test",
|
|
13
|
+
"package.json",
|
|
14
|
+
"CHANGELOG.md",
|
|
15
|
+
"README.md",
|
|
16
|
+
"LICENSE"
|
|
17
|
+
],
|
|
8
18
|
"scripts": {
|
|
9
19
|
"prepare": "npm run copy:maplibre && npm run copy:maplibre-inspect && npm run copy:mapbox-rtl-text && npm run copy:leaflet && npm run copy:leaflet-hash",
|
|
10
20
|
"copy:maplibre": "copyfiles -EVf node_modules/maplibre-gl/dist/maplibre-gl.js node_modules/maplibre-gl/dist/maplibre-gl.js.map node_modules/maplibre-gl/dist/maplibre-gl.css public/resources/",
|
|
@@ -28,29 +38,29 @@
|
|
|
28
38
|
"@mapbox/mapbox-gl-rtl-text": "0.3.0",
|
|
29
39
|
"@mapbox/mbtiles": "0.12.1",
|
|
30
40
|
"@mapbox/polyline": "^1.2.1",
|
|
31
|
-
"@mapbox/sphericalmercator": "
|
|
41
|
+
"@mapbox/sphericalmercator": "2.0.1",
|
|
32
42
|
"@mapbox/vector-tile": "2.0.3",
|
|
33
|
-
"@maplibre/maplibre-gl-inspect": "1.7.
|
|
34
|
-
"@maplibre/maplibre-gl-style-spec": "
|
|
43
|
+
"@maplibre/maplibre-gl-inspect": "1.7.1",
|
|
44
|
+
"@maplibre/maplibre-gl-style-spec": "23.1.0",
|
|
35
45
|
"@sindresorhus/fnv1a": "3.1.0",
|
|
36
46
|
"advanced-pool": "0.3.3",
|
|
37
|
-
"axios": "^1.8.
|
|
38
|
-
"chokidar": "
|
|
47
|
+
"axios": "^1.8.4",
|
|
48
|
+
"chokidar": "4.0.3",
|
|
39
49
|
"clone": "2.1.2",
|
|
40
|
-
"color": "
|
|
41
|
-
"commander": "
|
|
50
|
+
"color": "5.0.0",
|
|
51
|
+
"commander": "13.1.0",
|
|
42
52
|
"copyfiles": "2.4.1",
|
|
43
53
|
"cors": "2.8.5",
|
|
44
|
-
"express": "5.0
|
|
54
|
+
"express": "5.1.0",
|
|
45
55
|
"handlebars": "4.7.8",
|
|
46
56
|
"http-shutdown": "1.2.2",
|
|
47
57
|
"leaflet": "1.9.4",
|
|
48
58
|
"leaflet-hash": "0.2.1",
|
|
49
|
-
"maplibre-gl": "
|
|
59
|
+
"maplibre-gl": "5.3.1",
|
|
50
60
|
"morgan": "1.10.0",
|
|
51
61
|
"pbf": "4.0.1",
|
|
52
|
-
"pmtiles": "3.0
|
|
53
|
-
"proj4": "2.
|
|
62
|
+
"pmtiles": "4.3.0",
|
|
63
|
+
"proj4": "2.15.0",
|
|
54
64
|
"sanitize-filename": "1.6.3",
|
|
55
65
|
"semver": "^7.6.3",
|
|
56
66
|
"tileserver-gl-styles": "2.0.0"
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
(function(window) {
|
|
2
|
+
var HAS_HASHCHANGE = (function() {
|
|
3
|
+
var doc_mode = window.documentMode;
|
|
4
|
+
return ('onhashchange' in window) &&
|
|
5
|
+
(doc_mode === undefined || doc_mode > 7);
|
|
6
|
+
})();
|
|
7
|
+
|
|
8
|
+
L.Hash = function(map) {
|
|
9
|
+
this.onHashChange = L.Util.bind(this.onHashChange, this);
|
|
10
|
+
|
|
11
|
+
if (map) {
|
|
12
|
+
this.init(map);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
L.Hash.parseHash = function(hash) {
|
|
17
|
+
if(hash.indexOf('#') === 0) {
|
|
18
|
+
hash = hash.substr(1);
|
|
19
|
+
}
|
|
20
|
+
var args = hash.split("/");
|
|
21
|
+
if (args.length == 3) {
|
|
22
|
+
var zoom = parseInt(args[0], 10),
|
|
23
|
+
lat = parseFloat(args[1]),
|
|
24
|
+
lon = parseFloat(args[2]);
|
|
25
|
+
if (isNaN(zoom) || isNaN(lat) || isNaN(lon)) {
|
|
26
|
+
return false;
|
|
27
|
+
} else {
|
|
28
|
+
return {
|
|
29
|
+
center: new L.LatLng(lat, lon),
|
|
30
|
+
zoom: zoom
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
} else {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
L.Hash.formatHash = function(map) {
|
|
39
|
+
var center = map.getCenter(),
|
|
40
|
+
zoom = map.getZoom(),
|
|
41
|
+
precision = Math.max(0, Math.ceil(Math.log(zoom) / Math.LN2));
|
|
42
|
+
|
|
43
|
+
return "#" + [zoom,
|
|
44
|
+
center.lat.toFixed(precision),
|
|
45
|
+
center.lng.toFixed(precision)
|
|
46
|
+
].join("/");
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
L.Hash.prototype = {
|
|
50
|
+
map: null,
|
|
51
|
+
lastHash: null,
|
|
52
|
+
|
|
53
|
+
parseHash: L.Hash.parseHash,
|
|
54
|
+
formatHash: L.Hash.formatHash,
|
|
55
|
+
|
|
56
|
+
init: function(map) {
|
|
57
|
+
this.map = map;
|
|
58
|
+
|
|
59
|
+
// reset the hash
|
|
60
|
+
this.lastHash = null;
|
|
61
|
+
this.onHashChange();
|
|
62
|
+
|
|
63
|
+
if (!this.isListening) {
|
|
64
|
+
this.startListening();
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
removeFrom: function(map) {
|
|
69
|
+
if (this.changeTimeout) {
|
|
70
|
+
clearTimeout(this.changeTimeout);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (this.isListening) {
|
|
74
|
+
this.stopListening();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
this.map = null;
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
onMapMove: function() {
|
|
81
|
+
// bail if we're moving the map (updating from a hash),
|
|
82
|
+
// or if the map is not yet loaded
|
|
83
|
+
|
|
84
|
+
if (this.movingMap || !this.map._loaded) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
var hash = this.formatHash(this.map);
|
|
89
|
+
if (this.lastHash != hash) {
|
|
90
|
+
location.replace(hash);
|
|
91
|
+
this.lastHash = hash;
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
|
|
95
|
+
movingMap: false,
|
|
96
|
+
update: function() {
|
|
97
|
+
var hash = location.hash;
|
|
98
|
+
if (hash === this.lastHash) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
var parsed = this.parseHash(hash);
|
|
102
|
+
if (parsed) {
|
|
103
|
+
this.movingMap = true;
|
|
104
|
+
|
|
105
|
+
this.map.setView(parsed.center, parsed.zoom);
|
|
106
|
+
|
|
107
|
+
this.movingMap = false;
|
|
108
|
+
} else {
|
|
109
|
+
this.onMapMove(this.map);
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
// defer hash change updates every 100ms
|
|
114
|
+
changeDefer: 100,
|
|
115
|
+
changeTimeout: null,
|
|
116
|
+
onHashChange: function() {
|
|
117
|
+
// throttle calls to update() so that they only happen every
|
|
118
|
+
// `changeDefer` ms
|
|
119
|
+
if (!this.changeTimeout) {
|
|
120
|
+
var that = this;
|
|
121
|
+
this.changeTimeout = setTimeout(function() {
|
|
122
|
+
that.update();
|
|
123
|
+
that.changeTimeout = null;
|
|
124
|
+
}, this.changeDefer);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
|
|
128
|
+
isListening: false,
|
|
129
|
+
hashChangeInterval: null,
|
|
130
|
+
startListening: function() {
|
|
131
|
+
this.map.on("moveend", this.onMapMove, this);
|
|
132
|
+
|
|
133
|
+
if (HAS_HASHCHANGE) {
|
|
134
|
+
L.DomEvent.addListener(window, "hashchange", this.onHashChange);
|
|
135
|
+
} else {
|
|
136
|
+
clearInterval(this.hashChangeInterval);
|
|
137
|
+
this.hashChangeInterval = setInterval(this.onHashChange, 50);
|
|
138
|
+
}
|
|
139
|
+
this.isListening = true;
|
|
140
|
+
},
|
|
141
|
+
|
|
142
|
+
stopListening: function() {
|
|
143
|
+
this.map.off("moveend", this.onMapMove, this);
|
|
144
|
+
|
|
145
|
+
if (HAS_HASHCHANGE) {
|
|
146
|
+
L.DomEvent.removeListener(window, "hashchange", this.onHashChange);
|
|
147
|
+
} else {
|
|
148
|
+
clearInterval(this.hashChangeInterval);
|
|
149
|
+
}
|
|
150
|
+
this.isListening = false;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
L.hash = function(map) {
|
|
154
|
+
return new L.Hash(map);
|
|
155
|
+
};
|
|
156
|
+
L.Map.prototype.addHash = function() {
|
|
157
|
+
this._hash = L.hash(this);
|
|
158
|
+
};
|
|
159
|
+
L.Map.prototype.removeHash = function() {
|
|
160
|
+
this._hash.removeFrom();
|
|
161
|
+
};
|
|
162
|
+
})(window);
|