maplibre-preview 1.4.2 → 1.6.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -0
- data/README.md +13 -0
- data/docs/README_RU.md +13 -0
- data/lib/maplibre-preview/public/js/filters.js +14 -2
- data/lib/maplibre-preview/public/js/tilegrid.js +4 -5
- data/lib/maplibre-preview/public/vendor/d3/d3.v7.min.js +1 -10634
- data/lib/maplibre-preview/public/vendor/maplibre-contour/index.min.js +3 -1183
- data/lib/maplibre-preview/public/vendor/maplibre-gl/maplibre-gl.css +1 -783
- data/lib/maplibre-preview/public/vendor/maplibre-gl/maplibre-gl.js +31 -29458
- data/lib/maplibre-preview/version.rb +1 -1
- data/lib/maplibre-preview/views/maplibre_layout.slim +91 -17
- data/lib/maplibre-preview/views/maplibre_map.slim +273 -55
- data/spec/maplibre_preview_spec.rb +31 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 17ba0e8d475ee1bb1a213790388e255df8eab1f4a3670382c0c77b3e2967f660
|
|
4
|
+
data.tar.gz: 4091e3a89317f63690f447167f68c5bdc887d442c33aad1dc418f7ed850a8abc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 43cb047740512a57492d2e8582e704f3b1a45c61bcc7add1fb8845eea75bf66e05e67e1d86f73003ca4a50aad59204857b6dd816789f68ddc0475cc99a0da4a6
|
|
7
|
+
data.tar.gz: 8188dbf8a672afd1f42ad70d51315b4741ce1006a2111f37b84ab71c8dfc8353ac34fb8920f72111ddc50ce7bdf038c90fccabcfe66a17d598fa2589bd84ba52
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.6.0] - 2026-05-13
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- **Basemap opacity control** - added a Map Settings slider for changing preview basemap transparency without changing the tested style
|
|
7
|
+
- **Terrain exaggeration control** - added a terrain-only slider that updates `map.setTerrain({ source, exaggeration })`
|
|
8
|
+
- **MapLibre debug controls** - added Collision Boxes, Overdraw, and Raster Fade toggles for label placement, dense style, and raster/DEM diagnostics
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **Tile Boundaries naming** - renamed the Tile Grid UI to Tile Boundaries to clarify that it uses MapLibre `showTileBoundaries`
|
|
12
|
+
- **Map Settings layout** - added compact setting rows and range styling for view-mode map controls
|
|
13
|
+
|
|
14
|
+
## [1.5.1] - 2026-05-13
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
- **Map control layout** - split map settings and style controls into independent panels with separate collapse controls
|
|
18
|
+
- **Panel sizing** - adjusted map settings, filters, and layers panels to size from their visible content
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- **Filter and layer scrolling** - restored internal scrolling for large filter and layer lists after the panel layout split
|
|
22
|
+
|
|
23
|
+
## [1.5.0] - 2026-05-13
|
|
24
|
+
|
|
25
|
+
### Added
|
|
26
|
+
- **Map request cache toggle** - added a development mode that disables browser HTTP cache for style and MapLibre resource requests
|
|
27
|
+
|
|
28
|
+
## [1.4.4] - 2026-05-13
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
- **Filter labels** - normalize object-based localized labels to display `title`, `name`, or `label` instead of `[object Object]`
|
|
32
|
+
|
|
3
33
|
## [1.4.2] - 2026-04-23
|
|
4
34
|
|
|
5
35
|
### Changed
|
data/README.md
CHANGED
|
@@ -125,6 +125,19 @@ The gem uses fixed configurations for optimal compatibility:
|
|
|
125
125
|
|
|
126
126
|
**Style URL**: Pass via URL parameter `?style_url=https://example.com/style.json`
|
|
127
127
|
|
|
128
|
+
## Map Settings
|
|
129
|
+
|
|
130
|
+
The preview UI keeps focused MapLibre controls that are useful for tile, style, and terrain services:
|
|
131
|
+
|
|
132
|
+
- **Basemap opacity**: changes the injected OpenStreetMap preview layer opacity while preserving the tested style.
|
|
133
|
+
- **Terrain exaggeration**: appears for styles with `terrain` and updates `map.setTerrain({ source, exaggeration })`.
|
|
134
|
+
- **Antialias**: reloads the WebGL context with antialiasing enabled or disabled.
|
|
135
|
+
- **Cache**: disables browser cache for style and map requests when comparing freshly generated tiles/styles.
|
|
136
|
+
- **Tile Boundaries**: toggles MapLibre tile boundary overlay, including tile coordinate/zoom diagnostics in pitched views, and visible tile count diagnostics.
|
|
137
|
+
- **Collision Boxes**: toggles MapLibre symbol collision boxes for label/icon debugging.
|
|
138
|
+
- **Overdraw**: toggles MapLibre overdraw inspection for dense mixed styles and expensive layers.
|
|
139
|
+
- **Raster Fade**: toggles raster tile fade duration for raster/DEM cache and reconstruction checks.
|
|
140
|
+
|
|
128
141
|
## API Reference
|
|
129
142
|
|
|
130
143
|
### Sinatra Extension
|
data/docs/README_RU.md
CHANGED
|
@@ -125,6 +125,19 @@ Gem использует фиксированные настройки:
|
|
|
125
125
|
|
|
126
126
|
**URL стиля**: Передается через параметр URL `?style_url=https://example.com/style.json`
|
|
127
127
|
|
|
128
|
+
## Настройки карты
|
|
129
|
+
|
|
130
|
+
Интерфейс preview оставляет только те настройки MapLibre, которые полезны для сервисов тайлов, стилей и рельефа:
|
|
131
|
+
|
|
132
|
+
- **Basemap opacity**: меняет прозрачность добавленной preview-подложки OpenStreetMap, не меняя тестируемый стиль.
|
|
133
|
+
- **Terrain exaggeration**: появляется для стилей с `terrain` и обновляет `map.setTerrain({ source, exaggeration })`.
|
|
134
|
+
- **Antialias**: перезагружает WebGL context с включенным или выключенным antialiasing.
|
|
135
|
+
- **Cache**: отключает browser cache для style и map requests при проверке свежесгенерированных тайлов/стилей.
|
|
136
|
+
- **Tile Boundaries**: включает MapLibre overlay границ тайлов, включая диагностику координат/зумов тайлов при наклоне карты, и счетчик видимых тайлов.
|
|
137
|
+
- **Collision Boxes**: включает MapLibre symbol collision boxes для отладки подписей и иконок.
|
|
138
|
+
- **Overdraw**: включает MapLibre overdraw inspection для плотных mixed styles и дорогих слоев.
|
|
139
|
+
- **Raster Fade**: включает или выключает fade duration у raster tiles для проверки raster/DEM cache и reconstruction.
|
|
140
|
+
|
|
128
141
|
## Справочник API
|
|
129
142
|
|
|
130
143
|
### Расширение Sinatra
|
|
@@ -37,16 +37,28 @@ class Filters {
|
|
|
37
37
|
const languagePriority = ['en-US', 'en', 'ru'];
|
|
38
38
|
|
|
39
39
|
for (const lang of languagePriority) {
|
|
40
|
-
|
|
40
|
+
const label = this.normalizeLocalizedFilterName(locale[lang]?.[filterId]);
|
|
41
|
+
if (label) return label;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
for (const lang in locale) {
|
|
44
|
-
|
|
45
|
+
const label = this.normalizeLocalizedFilterName(locale[lang]?.[filterId]);
|
|
46
|
+
if (label) return label;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
49
|
return filterId;
|
|
48
50
|
}
|
|
49
51
|
|
|
52
|
+
normalizeLocalizedFilterName(value) {
|
|
53
|
+
if (!value) return null;
|
|
54
|
+
if (typeof value === 'string') return value;
|
|
55
|
+
if (typeof value === 'object') {
|
|
56
|
+
return value.title || value.name || value.label || null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return String(value);
|
|
60
|
+
}
|
|
61
|
+
|
|
50
62
|
applyFilterMode() {
|
|
51
63
|
if (this.isUpdating) return;
|
|
52
64
|
this.isUpdating = true;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TileGridManager - manages tile
|
|
2
|
+
* TileGridManager - manages MapLibre tile boundary overlay and tile statistics
|
|
3
3
|
*/
|
|
4
4
|
class TileGridManager {
|
|
5
5
|
constructor(options) {
|
|
@@ -27,7 +27,7 @@ class TileGridManager {
|
|
|
27
27
|
|
|
28
28
|
this.panelContainer.innerHTML = `
|
|
29
29
|
<div class="tilegrid-header">
|
|
30
|
-
<span class="tilegrid-title">Tile
|
|
30
|
+
<span class="tilegrid-title">Tile Boundaries</span>
|
|
31
31
|
<button class="tilegrid-close" onclick="tileGridManager.toggle()">×</button>
|
|
32
32
|
</div>
|
|
33
33
|
<div class="tilegrid-stats">
|
|
@@ -36,7 +36,7 @@ class TileGridManager {
|
|
|
36
36
|
</div>
|
|
37
37
|
<div class="tilegrid-controls">
|
|
38
38
|
<label class="tilegrid-checkbox-label">
|
|
39
|
-
<span>Show
|
|
39
|
+
<span>Show boundary overlay</span>
|
|
40
40
|
<input type="checkbox" id="tilegrid-borders-checkbox" checked onchange="tileGridManager.toggleBorders(this.checked)">
|
|
41
41
|
<span class="tilegrid-checkbox-custom"></span>
|
|
42
42
|
</label>
|
|
@@ -118,7 +118,7 @@ class TileGridManager {
|
|
|
118
118
|
|
|
119
119
|
const btn = document.getElementById('tilegrid-mode-btn');
|
|
120
120
|
if (btn) {
|
|
121
|
-
btn.textContent = this.isVisible ? 'Hide Tile
|
|
121
|
+
btn.textContent = this.isVisible ? 'Hide Tile Boundaries' : 'Tile Boundaries';
|
|
122
122
|
btn.className = `control-button ${this.isVisible ? 'active' : ''}`;
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -171,4 +171,3 @@ class TileGridManager {
|
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
-
|