Skip to content

Conversation

@spectrachrome
Copy link
Contributor

@spectrachrome spectrachrome commented Oct 13, 2025

Note: The Africa GeoJSON example does work, just not here in this PR because of the differing root (/eodash-style-editor/pr-preview/pr-13/). As soon as the pull request is merged, the root defined in the software (/eodash-style-editor/) will be correct again and the example will load successfully.

The large size of the pull request is due to the GeoJSON example, actual code is ~4.5KLoC, about 20 kilo-lines of data.

@github-actions
Copy link

github-actions bot commented Oct 13, 2025

PR Preview Action v1.6.2

🚀 View preview at
https://eodash.github.io/eodash-style-editor/pr-preview/pr-13/

Built to branch gh-pages at 2025-11-06 17:10 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@santilland
Copy link
Contributor

Hello @spectrachrome ,

thank you for the pull request and the updates! I am experimenting a bit and try to see what things pop up, i will list the things that i saw here:

  • if i load a geojson source and from the default style that is added i:
    • try to add a tooltip definition no tooltip is enabled
    • try to add a jsonform layer control does not update with new jsonform definition
    • try to change stroke-width or anything does not update the map
  • if i try to load a geotiff it adds the default vector style definition, which creates an error
    • after that does not matter what i write in the text nothing is updated (only switching to vector sample and back to the cog example seems to help to reset things)
    • adding a jsonform defition does not update the layer control

Apart from that some potential enhancements:

  • layer control open by default, and ideally all collapseable entries open
  • i personally still find the auto formatting a bit cumbersome, i would prefer to have a button for it, as mid writing the style definition becomes non valid, maybe it would make sense to have an apply button (maybe allowing control enter to also trigger it)

**Fixed:**
- GeoTIFF layers now load correctly when added via URL input
- GeoTIFF layers now load correctly when auto-loaded from URL parameters
- Source structure now uses sources array instead of direct url property

**Changed:**
- Updated loadUrlData() to use GeoTIFF sources array format
- Updated autoSelectFromURL() to use GeoTIFF sources array format
@spectrachrome
Copy link
Contributor Author

Issues regarding the problematic URL loading have been fixed, you should now be able to edit GeoJSON and GeoTIFF properly when they are loaded from URL.

@santilland
Copy link
Contributor

Great! Thanks for the fixes!

So i tested loading a geojson and then adding a tooltip and that all worked! If i try to add a jsonform the layercontrol is not updated though, for example adding following. Also while i was trying to type this it kept on autocollapsing all jsonform objects, so i needed to open, very quickly type and hope it would not collapse again on its own, can we completely disable the autocollapsing?
I think they are useful features, but not when they are done automatically, maybe we can add a "format" and a "collapse all" button or something like that.

"jsonform": {
    "type": "object",
    "title": "Config test",
    "properties": {
      "test": {
        "title": "dropdown",
        "type": "string",
        "enum": ["test1", "test2"],
        "default": "test1"
      }
    }
  }

**Fixed:**
- Race condition where debounced style updates overwrote user input
- Cursor jumping to end when editing invalid JSON (e.g., typing ".2")
- External style changes interrupting active editing sessions
- View position not preserved during external updates

**Added:**
- Focus check that gives user editing absolute priority
- Debounce cancellation when JSON becomes invalid
- Scroll position preservation during external updates
- Editor toolbar with filled background (theme-aware)
- Manual "Fold" button for code folding control

**Removed:**
- Auto-folding behavior when expanding sections (collapseAllExcept)
- changeFold event listener and handleFoldChange function

**Changed:**
- Simplified fold button to clear and re-apply default folding
- Improved watcher structure with early returns for better performance
**Added:**
- Format button with JSON formatting functionality
- Preserves cursor and scroll position during formatting
- Re-applies default folds after formatting

**Removed:**
- EditorToolbar.vue component (functionality moved to CodeEditor)

**Fixed:**
- Disabled ACE editor smart behaviors that auto-format spacing
- Prevents automatic removal of spaces around punctuation

**Changed:**
- Toolbar now uses space-around layout for better button distribution
- Toolbar uses class instead of id selector
- Buttons use BeerCSS "small" class for consistent styling
… updates

**Fixed:**
- Code editor no longer auto-collapses JSON sections when layer control updates variables
- Layer control now updates instantly when style changes occur in the editor
- Layer control preserves form state during variable-only updates

**Changed:**
- Layer control only recreates component when jsonform schema changes, not for variable updates
- Added v-if visibility toggle mechanism for efficient layer control recreation
- Implemented state tracking to distinguish between schema and variable changes
- Removed initializeDefaultFolds() call from external update handler in code editor

**Added:**
- previousStyleState tracking in LayerControl to detect change types
- Automatic map reference storage and reconnection for layer control
- requestUpdate() call for variable-only changes to refresh without destroying component
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants