File tree Expand file tree Collapse file tree 4 files changed +11
-6
lines changed
Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 22
33All notable changes to this project will be documented in this file. See [ standard-version] ( https://github.com/conventional-changelog/standard-version ) for commit guidelines.
44
5+ ### [ 1.0.15] ( https://github.com/BryonLewis/vue-maplibre-compare/compare/v1.0.4...v1.0.15 ) (2025-12-12)
6+
7+ ### [ 1.0.14] ( https://github.com/BryonLewis/vue-maplibre-compare/compare/v1.0.4...v1.0.14 ) (2025-12-12)
8+
59### [ 1.0.13] ( https://github.com/BryonLewis/vue-maplibre-compare/compare/v1.0.12...v1.0.13 ) (2025-12-03)
610
711### [ 1.0.12] ( https://github.com/BryonLewis/vue-maplibre-compare/compare/v1.0.11...v1.0.12 ) (2025-12-02)
Original file line number Diff line number Diff line change 11{
22 "name" : " vue-maplibre-compare" ,
3- "version" : " 1.0.13 " ,
3+ "version" : " 1.0.15 " ,
44 "description" : " A Vue 3 component for comparing MapLibre maps side-by-side with a slider" ,
55 "type" : " module" ,
66 "main" : " ./dist/vue-maplibre-compare.umd.js" ,
Original file line number Diff line number Diff line change @@ -17,11 +17,12 @@ export function useStyleCompare(options: StyleCompareOptions) {
1717 // Store current styles
1818 let currentStyleA = baseStyleA ;
1919 let currentStyleB = baseStyleB ;
20- function updateStyle ( targetMap : 'A' | 'B' , newStyle : StyleSpecification ) {
20+ function updateStyle ( targetMap : 'A' | 'B' , newStyle : StyleSpecification | string ) {
21+ if ( typeof newStyle === 'string' ) return ;
2122 const currentStyle = targetMap === 'A' ? currentStyleA : currentStyleB ;
2223 // Check the sources and layers for the new map
2324 const currentSourceKeys = new Set ( Object . keys ( currentStyle . sources || { } ) ) ;
24- const newSourceKeys = new Set ( Object . keys ( newStyle . sources || { } ) ) ;
25+ const newSourceKeys = new Set ( Object . keys ( typeof newStyle === 'string' ? { } : newStyle ? .sources || { } ) ) ;
2526 // Get new and removed sources
2627 const sourcesToAdd = Array . from ( newSourceKeys ) . filter ( ( key ) => ! currentSourceKeys . has ( key ) ) ;
2728 const sourcesToRemove = Array . from ( currentSourceKeys ) . filter ( ( key ) => ! newSourceKeys . has ( key ) ) ;
@@ -46,7 +47,7 @@ export function useStyleCompare(options: StyleCompareOptions) {
4647 } ) ;
4748 // then add new sources
4849 sourcesToAdd . forEach ( ( sourceId ) => {
49- const sourceDef = newStyle . sources ? newStyle . sources [ sourceId ] : undefined ;
50+ const sourceDef = newStyle ? .sources ? newStyle . sources [ sourceId ] : undefined ;
5051 if ( sourceDef ) {
5152 if ( ! targetMapInstance . getSource ( sourceId ) ) {
5253 targetMapInstance . addSource ( sourceId , sourceDef ) ;
You can’t perform that action at this time.
0 commit comments