Skip to content

Commit

Permalink
avoid adding duplicate file names
Browse files Browse the repository at this point in the history
  • Loading branch information
Gebuz committed Nov 7, 2024
1 parent a82059c commit b287d4b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/).

## [2.2.1] - 2024-11-07

### Fixed

- No longer incorrectly adds a new layer if one with the same name already exists.

## [2.2.0] - 2024-10-31

### Added
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vector-tiles-frontend",
"version": "2.2.0",
"version": "2.2.1",
"description": "Webapplikation til at vise vector tiles med forskellige styles.",
"main": "./public/index.html",
"type": "module",
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ document.addEventListener('vt:add-style', event => {
const title = event.detail.title
if (!stylefile || !title) return
createStylefile(stylefile, title).then(layerGroup => {
map.addLayer(layerGroup)
showLayer(layerGroup)
document.getElementById('map-menu').setLayers(map.getLayers())
// Save style to localStorage
const saveSuccess = saveStyle(title, stylefile)
if (!saveSuccess) {
return
}
map.addLayer(layerGroup)
showLayer(layerGroup)
document.getElementById('map-menu').setLayers(map.getLayers())
})
})

Expand Down

0 comments on commit b287d4b

Please sign in to comment.