GEOLYTIX / xyz

An open source javascript framework for spatial data and application interfaces.
MIT License
86 stars 25 forks source link

Geometry - Configurable Labels #1346

Closed simon-leech closed 6 days ago

simon-leech commented 1 week ago

Pull Request Template

Description

  1. When populating a geometry field using an API, we need to then run update() so that any dependents are also updated.
  2. Added entry.edit.modify_label and entry.edit.delete_label that can be configured.

Type of Change

Please delete options that are not relevant, and select all options that apply.

How have you tested this?

Tested locally.

Testing Checklist

Please delete options that are not relevant, and select all options that apply.

Code Quality Checklist

Please delete options that are not relevant, and select all options that apply.

simon-leech commented 6 days ago

@dbauszus-glx Yeah i didn't think this was the best way to handle it.

My use case is a third-party API call to a drivetime that then updates a separate field. The drivetime is not shown on the map (it has no style). When the drivetime call is finished the field should be updated as it is a dependent of the geometry drivetime field.

dbauszus-glx commented 6 days ago

@simon-leech This will have to be done with the blocking capability. The geometry field entry will be ahead of the dependent field entry.

The geometry entry has the blocking and display flag. If the entry has no value it will be generated. The location view is disabled with the blocking flag. After the geometry has been created and stored the location view will re-render. Dependent fields should be synced.

dbauszus-glx commented 6 days ago

@simon-leech What you are trying to do must be controlled in the plugin.

The syncFields should be added to the finally condition of the call which requests the geometry. Whether a geometry is stored or not should not matter.

Screencast from 25-06-24 09:54:25.webm

    .finally(async () => {
      if (entry.dependents) {
        await entry.location.syncFields(entry.dependents)
      }
      entry.blocking && entry.location.view.dispatchEvent(new Event('render'))
    })