mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-28 16:41:17 +01:00
Fix local update to right this
This commit is contained in:
parent
fa38667125
commit
e92dfd8284
1 changed files with 3 additions and 3 deletions
|
@ -28,14 +28,14 @@ export class ApiStyleStore {
|
|||
|
||||
notifyLocalChanges() {
|
||||
const connection = new ReconnectingWebSocket(websocketUrl)
|
||||
connection.onmessage = function(e) {
|
||||
connection.onmessage = e => {
|
||||
if(!e.data) return
|
||||
try {
|
||||
console.log('Received style update from API')
|
||||
try {
|
||||
const updatedStyle = style.ensureStyleValidity(JSON.parse(e.data))
|
||||
this.onLocalStyleChange(updatedStyle)
|
||||
} catch(err) {
|
||||
console.error('Cannot parse local file ' + e.data)
|
||||
console.error('Could not parse local style')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue