Commit graph

19 commits

Author SHA1 Message Date
Sanjay Bhangar
8fc5297f39 fix marker duplication bug when editing a newly added place 2025-08-09 17:11:18 +02:00
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
j
80d3919b46 one layer per rectangle to redouce events 2025-08-06 23:31:07 +02:00
j
1bac02d24f fixup 2025-08-06 23:18:21 +02:00
j
bc174c49dd support updating MapEditor places 2025-08-06 23:01:31 +02:00
j
f3e0632f0e more fixes 2025-08-06 21:50:00 +02:00
j
8dbfcc0ece fix raster subdomains 2025-08-06 19:30:08 +02:00
j
6a59ff5193 marker size 2025-08-06 19:29:16 +02:00
j
e917bce40d correct cross the 180th meridian (antimeridian) handling 2025-08-06 19:10:04 +02:00
j
8cebad9fb4 migrate to maplibre-gl for maps 2025-08-06 19:03:10 +02:00
j
9b5bb2cd06 fix setting place to null 2023-06-30 15:45:03 +05:30
j
7601eeb28a fall back to mapPlaceFeatureColor if type does not have a color 2023-06-24 16:09:32 +05:30
j
0396aa0679 google triggers map changed but does not return bounds if map was never visible 2023-04-27 10:54:12 +02:00
j
b11d6a81fe don't pass google api key, use Ox.Map.GoogleApiKey 2017-10-26 12:42:25 +02:00
j
9b8d45ba74 _k->K 2017-06-09 09:44:28 +02:00
j
39e4224034 pass api key to map 2017-05-29 17:56:03 +02:00
rolux
511a5267b5 Ox.Map: remove terms reformatting 2015-10-30 10:51:53 +01:00
j
470e6ac127 wait until google.maps.LatLng is available 2015-03-23 17:37:58 +05:30
rolux
51696562f1 remove unneeded Ox. prefix from path and file names 2014-09-26 15:51:50 +02:00