maplibre-preview 1.2.7 → 1.3.7
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 +9 -0
 - data/README.md +2 -2
 - data/docs/README_RU.md +2 -2
 - data/lib/maplibre-preview/version.rb +1 -1
 - data/lib/maplibre-preview/views/maplibre_map.slim +35 -10
 - 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: 1e8b7e6d3882215e2027f65d54d9e06c580674d09e11c7099a8713de14979100
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 74975af297edce53fe68f87621be8104936f17969afbed60a241065f46e6c702
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 6735dbe8cce4882f933922a6f4cf9a5ce6de961e128e21f671f21f2b38067f0fb2aef5507e404c8aba7fab8fb6e8db9b3925edd618a1c399d37893b4465f458d
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: f667f936f515cbd8390abd5dadbcebfdf61a29572feed3496361a08d941f32a6d0acf6f75949c9bff537f56213d60172baebd0537f1687eee63ed2de96e8c45f
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,5 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Changelog
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            ## [1.3.7] - 2025-10-29
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            ### Added
         
     | 
| 
      
 6 
     | 
    
         
            +
            - **Antialias toggle control** - button to enable/disable antialias with localStorage persistence and page reload
         
     | 
| 
      
 7 
     | 
    
         
            +
            - **Style-based initial view** - support for `center` and `zoom` properties from style JSON according to MapLibre Style Spec
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            ### Changed
         
     | 
| 
      
 10 
     | 
    
         
            +
            - **Default map center** - updated to `[96.63, 64.81]`
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
       3 
12 
     | 
    
         
             
            ## [1.2.7] - 2025-10-20
         
     | 
| 
       4 
13 
     | 
    
         | 
| 
       5 
14 
     | 
    
         
             
            ### Fixed
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -118,8 +118,8 @@ This starts a complete web server with: 
     | 
|
| 
       118 
118 
     | 
    
         | 
| 
       119 
119 
     | 
    
         
             
            The gem uses fixed configurations for optimal compatibility:
         
     | 
| 
       120 
120 
     | 
    
         | 
| 
       121 
     | 
    
         
            -
            - **Map Center**: `[ 
     | 
| 
       122 
     | 
    
         
            -
            - **Initial Zoom**: `2`
         
     | 
| 
      
 121 
     | 
    
         
            +
            - **Map Center**: `[96.63, 64.81]` (default, can be overridden by style's `center` property)
         
     | 
| 
      
 122 
     | 
    
         
            +
            - **Initial Zoom**: `2` (default, can be overridden by style's `zoom` property)
         
     | 
| 
       123 
123 
     | 
    
         
             
            - **Basemap**: OpenStreetMap tiles with 0.8 opacity
         
     | 
| 
       124 
124 
     | 
    
         
             
            - **Library Versions**: MapLibre GL JS 5.7.3, MapLibre Contour 0.1.0, D3.js 7
         
     | 
| 
       125 
125 
     | 
    
         | 
    
        data/docs/README_RU.md
    CHANGED
    
    | 
         @@ -118,8 +118,8 @@ MapLibrePreview::App.run! 
     | 
|
| 
       118 
118 
     | 
    
         | 
| 
       119 
119 
     | 
    
         
             
            Gem использует фиксированные настройки:
         
     | 
| 
       120 
120 
     | 
    
         | 
| 
       121 
     | 
    
         
            -
            - **Центр карты**: `[ 
     | 
| 
       122 
     | 
    
         
            -
            - **Начальный зум**: `2`
         
     | 
| 
      
 121 
     | 
    
         
            +
            - **Центр карты**: `[96.63, 64.81]` (по умолчанию, можно переопределить свойством `center` в стиле)
         
     | 
| 
      
 122 
     | 
    
         
            +
            - **Начальный зум**: `2` (по умолчанию, можно переопределить свойством `zoom` в стиле)
         
     | 
| 
       123 
123 
     | 
    
         
             
            - **Базовая карта**: Тайлы OpenStreetMap с прозрачностью 0.8
         
     | 
| 
       124 
124 
     | 
    
         
             
            - **Версии библиотек**: MapLibre GL JS 5.7.3, MapLibre Contour 0.1.0, D3.js 7
         
     | 
| 
       125 
125 
     | 
    
         | 
| 
         @@ -16,6 +16,7 @@ ruby: 
     | 
|
| 
       16 
16 
     | 
    
         
             
                  button.mode-button id="mode-layers" onclick="switchMode(this, 'layers')" Layers
         
     | 
| 
       17 
17 
     | 
    
         
             
                button.control-button onclick="toggleHoverMode()" id="hover-mode-btn" Hover Mode
         
     | 
| 
       18 
18 
     | 
    
         
             
                button.control-button onclick="toggleProfileMode()" id="profile-mode-btn" style="display: none;" Elevation Profile
         
     | 
| 
      
 19 
     | 
    
         
            +
                button.control-button onclick="toggleAntialias()" id="antialias-btn" Antialias
         
     | 
| 
       19 
20 
     | 
    
         | 
| 
       20 
21 
     | 
    
         
             
                #filters-panel.control-panel.active
         
     | 
| 
       21 
22 
     | 
    
         
             
                  .control-panel-header
         
     | 
| 
         @@ -76,6 +77,7 @@ javascript: 
     | 
|
| 
       76 
77 
     | 
    
         
             
                let hoverMode = 'click';
         
     | 
| 
       77 
78 
     | 
    
         
             
                let layerStates = {};
         
     | 
| 
       78 
79 
     | 
    
         
             
                let map = null;
         
     | 
| 
      
 80 
     | 
    
         
            +
                let antialiasEnabled = localStorage.getItem('antialiasEnabled') !== 'false';
         
     | 
| 
       79 
81 
     | 
    
         
             
                let styleLoaded = false, resourcesLoaded = 0, totalResources = 0;
         
     | 
| 
       80 
82 
     | 
    
         
             
                let tilesLoaded = 0, tilesTotal = 0;
         
     | 
| 
       81 
83 
     | 
    
         
             
                let currentStyle = null;
         
     | 
| 
         @@ -175,15 +177,23 @@ javascript: 
     | 
|
| 
       175 
177 
     | 
    
         
             
                    }
         
     | 
| 
       176 
178 
     | 
    
         
             
                };
         
     | 
| 
       177 
179 
     | 
    
         | 
| 
       178 
     | 
    
         
            -
                const createMap = (container, style) =>  
     | 
| 
       179 
     | 
    
         
            -
                     
     | 
| 
       180 
     | 
    
         
            -
                     
     | 
| 
       181 
     | 
    
         
            -
                     
     | 
| 
       182 
     | 
    
         
            -
                     
     | 
| 
       183 
     | 
    
         
            -
                     
     | 
| 
       184 
     | 
    
         
            -
                     
     | 
| 
       185 
     | 
    
         
            -
                     
     | 
| 
       186 
     | 
    
         
            -
             
     | 
| 
      
 180 
     | 
    
         
            +
                const createMap = (container, style) => {
         
     | 
| 
      
 181 
     | 
    
         
            +
                    const defaultCenter = [96.637778, 64.811389];
         
     | 
| 
      
 182 
     | 
    
         
            +
                    const defaultZoom = 2;
         
     | 
| 
      
 183 
     | 
    
         
            +
                    
         
     | 
| 
      
 184 
     | 
    
         
            +
                    const center = Array.isArray(style?.center) && style.center.length === 2 ? style.center : defaultCenter;
         
     | 
| 
      
 185 
     | 
    
         
            +
                    const zoom = typeof style?.zoom === 'number' ? style.zoom : defaultZoom;
         
     | 
| 
      
 186 
     | 
    
         
            +
                    
         
     | 
| 
      
 187 
     | 
    
         
            +
                    return new maplibregl.Map({
         
     | 
| 
      
 188 
     | 
    
         
            +
                        container,
         
     | 
| 
      
 189 
     | 
    
         
            +
                        style,
         
     | 
| 
      
 190 
     | 
    
         
            +
                        center,
         
     | 
| 
      
 191 
     | 
    
         
            +
                        zoom,
         
     | 
| 
      
 192 
     | 
    
         
            +
                        attributionControl: false,
         
     | 
| 
      
 193 
     | 
    
         
            +
                        validateStyle: false,
         
     | 
| 
      
 194 
     | 
    
         
            +
                        antialias: antialiasEnabled
         
     | 
| 
      
 195 
     | 
    
         
            +
                    });
         
     | 
| 
      
 196 
     | 
    
         
            +
                };
         
     | 
| 
       187 
197 
     | 
    
         | 
| 
       188 
198 
     | 
    
         
             
                const addBasemapToStyle = (originalStyle) => {
         
     | 
| 
       189 
199 
     | 
    
         
             
                    const modifiedStyle = JSON.parse(JSON.stringify(originalStyle));
         
     | 
| 
         @@ -389,7 +399,7 @@ javascript: 
     | 
|
| 
       389 
399 
     | 
    
         | 
| 
       390 
400 
     | 
    
         
             
                const setupPerformanceMonitoring = () => {
         
     | 
| 
       391 
401 
     | 
    
         
             
                    [startPerformanceMonitoring, () => requestAnimationFrame(countFrame),
         
     | 
| 
       392 
     | 
    
         
            -
                        updateHoverModeButton, updateBasemapButton].forEach(fn => fn());
         
     | 
| 
      
 402 
     | 
    
         
            +
                        updateHoverModeButton, updateBasemapButton, updateAntialiasButton].forEach(fn => fn());
         
     | 
| 
       393 
403 
     | 
    
         
             
                };
         
     | 
| 
       394 
404 
     | 
    
         | 
| 
       395 
405 
     | 
    
         
             
                const toggleBasemap = () => {
         
     | 
| 
         @@ -831,6 +841,20 @@ javascript: 
     | 
|
| 
       831 
841 
     | 
    
         
             
                    requestAnimationFrame(countFrame);
         
     | 
| 
       832 
842 
     | 
    
         
             
                };
         
     | 
| 
       833 
843 
     | 
    
         | 
| 
      
 844 
     | 
    
         
            +
                const toggleAntialias = () => {
         
     | 
| 
      
 845 
     | 
    
         
            +
                    antialiasEnabled = !antialiasEnabled;
         
     | 
| 
      
 846 
     | 
    
         
            +
                    localStorage.setItem('antialiasEnabled', antialiasEnabled.toString());
         
     | 
| 
      
 847 
     | 
    
         
            +
                    window.location.reload();
         
     | 
| 
      
 848 
     | 
    
         
            +
                };
         
     | 
| 
      
 849 
     | 
    
         
            +
             
     | 
| 
      
 850 
     | 
    
         
            +
                const updateAntialiasButton = () => {
         
     | 
| 
      
 851 
     | 
    
         
            +
                    const btn = document.getElementById('antialias-btn');
         
     | 
| 
      
 852 
     | 
    
         
            +
                    if (!btn) return;
         
     | 
| 
      
 853 
     | 
    
         
            +
                    
         
     | 
| 
      
 854 
     | 
    
         
            +
                    btn.textContent = `Antialias: ${antialiasEnabled ? 'ON' : 'OFF'}`;
         
     | 
| 
      
 855 
     | 
    
         
            +
                    btn.className = `control-button ${antialiasEnabled ? 'active' : 'inactive'}`;
         
     | 
| 
      
 856 
     | 
    
         
            +
                };
         
     | 
| 
      
 857 
     | 
    
         
            +
             
     | 
| 
       834 
858 
     | 
    
         
             
                window.switchMode = switchMode;
         
     | 
| 
       835 
859 
     | 
    
         
             
                window.toggleBasemap = toggleBasemap;
         
     | 
| 
       836 
860 
     | 
    
         
             
                window.toggleHoverMode = toggleHoverMode;
         
     | 
| 
         @@ -838,6 +862,7 @@ javascript: 
     | 
|
| 
       838 
862 
     | 
    
         
             
                window.toggleAllLayers = toggleAllLayers;
         
     | 
| 
       839 
863 
     | 
    
         
             
                window.togglePerformancePanel = togglePerformancePanel;
         
     | 
| 
       840 
864 
     | 
    
         
             
                window.toggleProfileMode = toggleProfileMode;
         
     | 
| 
      
 865 
     | 
    
         
            +
                window.toggleAntialias = toggleAntialias;
         
     | 
| 
       841 
866 
     | 
    
         
             
                window.hideProfile = hideProfile;
         
     | 
| 
       842 
867 
     | 
    
         | 
| 
       843 
868 
     | 
    
         
             
                initializeMap();
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: maplibre-preview
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.3.7
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Alexander Ludov
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire:
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2025-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2025-10-29 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rack
         
     |