Skip to content

Commit a0a8b27

Browse files
committed
Remove unused attribution keys, rename map config keys
1 parent b324dd1 commit a0a8b27

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/components/GrampsjsMap.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ import {sharedStyles} from '../SharedStyles.js'
1616
import {GrampsjsAppStateMixin} from '../mixins/GrampsjsAppStateMixin.js'
1717

1818
const defaultConfig = {
19-
glStyle: 'https://www.openhistoricalmap.org/map-styles/main/main.json',
20-
glAttribution:
21-
'<a href="https://maplibre.org/" target="_blank">MapLibre</a> | <a href="https://www.openhistoricalmap.org/">OpenHistoricalMap</a> contributors',
22-
baseStyle: 'https://tiles.openfreemap.org/styles/liberty',
23-
baseAttribution: '<a href="https://openfreemap.org">OpenFreeMap</a>',
19+
mapOhmStyle: 'https://www.openhistoricalmap.org/map-styles/main/main.json',
20+
mapBaseStyle: 'https://tiles.openfreemap.org/styles/liberty',
2421
}
2522

2623
const {maplibregl} = window
@@ -91,7 +88,7 @@ class GrampsjsMap extends GrampsjsAppStateMixin(LitElement) {
9188
const mapel = this.shadowRoot.getElementById(this.mapid)
9289
const config = {...defaultConfig, ...window.grampsjsConfig}
9390
const styleUrl =
94-
this._currentStyle === 'base' ? config.baseStyle : config.glStyle
91+
this._currentStyle === 'base' ? config.mapBaseStyle : config.mapOhmStyle
9592
this._map = new maplibregl.Map({
9693
container: mapel,
9794
style: styleUrl,
@@ -187,7 +184,7 @@ class GrampsjsMap extends GrampsjsAppStateMixin(LitElement) {
187184
const config = {...defaultConfig, ...window.grampsjsConfig}
188185
const {style} = e.detail
189186
this._currentStyle = style
190-
const styleUrl = style === 'base' ? config.baseStyle : config.glStyle
187+
const styleUrl = style === 'base' ? config.mapBaseStyle : config.mapOhmStyle
191188
this._map.setStyle(styleUrl)
192189
if (this._currentStyle === 'ohm') {
193190
this._map.on('styledata', () => {

0 commit comments

Comments
 (0)