mirror of
https://github.com/umap-project/umap.git
synced 2025-05-12 00:51:48 +02:00
Compare commits
6 commits
d85fc648b1
...
05e3f5ce3d
Author | SHA1 | Date | |
---|---|---|---|
![]() |
05e3f5ce3d | ||
![]() |
c417e94698 | ||
![]() |
e53d208d7c | ||
![]() |
e20648104b | ||
![]() |
0c9d5325ba | ||
![]() |
90be14ae89 |
6 changed files with 17 additions and 6 deletions
|
@ -329,7 +329,7 @@ class Feature {
|
|||
}
|
||||
for (const key of keys) {
|
||||
const value = this.properties[key]
|
||||
if (value) return value.trim()
|
||||
if (value) return String(value).trim()
|
||||
}
|
||||
return this.datalayer.getName().trim()
|
||||
}
|
||||
|
|
|
@ -144,11 +144,10 @@ export class DataLayer extends ServerStored {
|
|||
if (fields.includes('options.type')) {
|
||||
this.resetLayer()
|
||||
}
|
||||
this.hide()
|
||||
for (const field of fields) {
|
||||
this.layer.onEdit(field, builder)
|
||||
}
|
||||
this.show()
|
||||
this.redraw()
|
||||
break
|
||||
case 'remote-data':
|
||||
this.fetchRemoteData()
|
||||
|
@ -652,8 +651,7 @@ export class DataLayer extends ServerStored {
|
|||
|
||||
redraw() {
|
||||
if (!this.isVisible()) return
|
||||
this.hide()
|
||||
this.show()
|
||||
this.eachFeature((feature) => feature.redraw())
|
||||
}
|
||||
|
||||
edit() {
|
||||
|
|
|
@ -269,8 +269,12 @@ export const LeafletMap = BaseMap.extend({
|
|||
this.renderUI()
|
||||
},
|
||||
|
||||
renderUI: function () {
|
||||
pullProperties() {
|
||||
setOptions(this, this._umap.properties)
|
||||
},
|
||||
|
||||
renderUI: function () {
|
||||
this.pullProperties()
|
||||
if (this.options.scrollWheelZoom) {
|
||||
this.scrollWheelZoom.enable()
|
||||
this.dragging.enable()
|
||||
|
|
|
@ -47,6 +47,7 @@ export class MapUpdater extends BaseUpdater {
|
|||
this.updateObjectValue(this._umap, key, value)
|
||||
}
|
||||
|
||||
this._umap.onPropertiesUpdated([key])
|
||||
this._umap.render([key])
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1329,6 +1329,10 @@ export default class Umap extends ServerStored {
|
|||
}
|
||||
}
|
||||
|
||||
onPropertiesUpdated(fields = []) {
|
||||
this._leafletMap.pullProperties()
|
||||
}
|
||||
|
||||
render(fields = []) {
|
||||
// Propagate will remove the fields it has already
|
||||
// processed
|
||||
|
|
|
@ -302,6 +302,10 @@ U.TileLayerChooser = L.Control.extend({
|
|||
if (options?.edit) {
|
||||
this.map._umap.properties.tilelayer = tilelayer.toJSON()
|
||||
this.map._umap.isDirty = true
|
||||
this.map._umap.sync.update(
|
||||
'properties.tilelayer',
|
||||
this.map._umap.properties.tilelayer
|
||||
)
|
||||
}
|
||||
},
|
||||
this
|
||||
|
|
Loading…
Reference in a new issue