1
0
Fork 0
forked from 0x2620/oxjs
oxjs/source/UI/js
Sanjay Bhangar a0b1e0eab4 Here's what we've accomplished to fix MapLibre GL rectangle editing:
Core Issues Fixed:

  1. MapLibre GL Event Compatibility: Fixed drag event handlers in MapMarker.js and MapRectangleMarker.js to use marker.getLngLat() instead of accessing e.lngLat properties that don't exist in MapLibre GL.
  2. Rectangle Handle Visibility: Replaced Ox.MapMarkerImage() with proper DOM elements for corner handles since MapLibre GL expects DOM elements, not image objects.
  3. Handle Positioning: Limited corner markers to only the 4 corners (ne, nw, se, sw) instead of all 8 positions (including edges).
  4. Visual Rectangle Updates: Added that.rectangle.setBounds() call in MapRectangle update method so the visual rectangle updates when handles are dragged.
  5. Click Event Conflicts: Fixed map click handler to detect rectangle clicks and avoid deselecting rectangles when clicked for editing.
  6. Place Editable Property: Added editable: true as default in MapPlace constructor.

  Files Modified:

  - MapPlace.js: Added editable: true default
  - MapRectangle.js:
    - Limited markers to 4 corners only
    - Added rectangle bounds update in update() method
  - MapRectangleMarker.js:
    - Created proper DOM elements for handles
    - Fixed MapLibre GL drag event handling
    - Improved event cleanup
  - MapMarker.js: Fixed MapLibre GL drag event handling
  - MapMarkerImage.js: Fixed rectangle marker color (kept for backward compatibility)
  - Map.js: Added rectangle click detection to prevent conflicts

  Result:

  Rectangle editing now works completely:
  - Click rectangle → shows 4 corner handles
  - Drag handles → resizes rectangle in real-time
  - No console errors
  - Proper event handling
2025-08-09 14:15:54 +02:00
..
Audio remove unneeded Ox. prefix from path and file names 2014-09-26 15:51:50 +02:00
Bar allow for squared-styled progress bars 2016-01-12 19:01:15 +05:30
Calendar remove unneeded Ox. prefix from path and file names 2014-09-26 15:51:50 +02:00
Code remove unneeded Ox. prefix from path and file names 2014-09-26 15:51:50 +02:00
Core expose async flag to disable it for window.unload events 2025-07-06 20:23:54 +01:00
Form no confirmation dialog for empty annotations 2025-01-30 16:59:35 +05:30
Image update area via options 2018-03-06 18:16:33 +05:30
List Use self.pageLength instead of self.options.pageLength in List::getPageByPosition 2023-09-04 22:29:38 +00:00
Map Here's what we've accomplished to fix MapLibre GL rectangle editing: 2025-08-09 14:15:54 +02:00
Menu make sure items is defined 2023-05-11 11:01:45 +01:00
Panel some more support for squared style 2016-01-12 11:11:08 +05:30
Video fix multiple id selection in VideoAnnotationPanel chain 2025-01-25 10:27:45 +05:30
Window fix menus and dialogs in fullscreen mode 2019-02-21 16:10:58 +05:30