mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
wip: fix editing Point coordinates by hand
For now we edit ui._latlng, but in an ideal world, we should edit Point coordinates and then sync to the ui Marker.
This commit is contained in:
parent
25d12420b2
commit
565f6d87b6
1 changed files with 21 additions and 20 deletions
|
@ -586,26 +586,27 @@ export class Point extends Feature {
|
||||||
return ['properties._umap_options.zoomTo']
|
return ['properties._umap_options.zoomTo']
|
||||||
}
|
}
|
||||||
|
|
||||||
// appendEditFieldsets(container) {
|
appendEditFieldsets(container) {
|
||||||
// super.appendEditFieldsets(container)
|
super.appendEditFieldsets(container)
|
||||||
// const coordinatesOptions = [
|
// FIXME edit feature geometry.coordinates instead
|
||||||
// ['_latlng.lat', { handler: 'FloatInput', label: translate('Latitude') }],
|
// (by learning FormBuilder to deal with array indexes ?)
|
||||||
// ['_latlng.lng', { handler: 'FloatInput', label: translate('Longitude') }],
|
const coordinatesOptions = [
|
||||||
// ]
|
['ui._latlng.lat', { handler: 'FloatInput', label: translate('Latitude') }],
|
||||||
// const builder = new U.FormBuilder(this, coordinatesOptions, {
|
['ui._latlng.lng', { handler: 'FloatInput', label: translate('Longitude') }],
|
||||||
// callback() {
|
]
|
||||||
// if (!this._latlng.isValid()) {
|
const builder = new U.FormBuilder(this, coordinatesOptions, {
|
||||||
// Alert.error(translate('Invalid latitude or longitude'))
|
callback: () => {
|
||||||
// builder.restoreField('_latlng.lat')
|
if (!this.ui._latlng.isValid()) {
|
||||||
// builder.restoreField('_latlng.lng')
|
Alert.error(translate('Invalid latitude or longitude'))
|
||||||
// }
|
builder.restoreField('ui._latlng.lat')
|
||||||
// this.zoomTo({ easing: false })
|
builder.restoreField('ui._latlng.lng')
|
||||||
// },
|
}
|
||||||
// callbackContext: this,
|
this.zoomTo({ easing: false })
|
||||||
// })
|
}
|
||||||
// const fieldset = DomUtil.createFieldset(container, translate('Coordinates'))
|
})
|
||||||
// fieldset.appendChild(builder.build())
|
const fieldset = DomUtil.createFieldset(container, translate('Coordinates'))
|
||||||
// }
|
fieldset.appendChild(builder.build())
|
||||||
|
}
|
||||||
|
|
||||||
zoomTo(event) {
|
zoomTo(event) {
|
||||||
if (this.datalayer.isClustered() && !this._icon) {
|
if (this.datalayer.isClustered() && !this._icon) {
|
||||||
|
|
Loading…
Reference in a new issue