Skip to content

Add map rotation and heading controls#2506

Open
ArturoManzoli wants to merge 6 commits intobluerobotics:masterfrom
ArturoManzoli:2370-specify-map-rotation
Open

Add map rotation and heading controls#2506
ArturoManzoli wants to merge 6 commits intobluerobotics:masterfrom
ArturoManzoli:2370-specify-map-rotation

Conversation

@ArturoManzoli
Copy link
Copy Markdown
Contributor

@ArturoManzoli ArturoManzoli commented Mar 12, 2026

  • Added a control for manual map rotation on mission planning and flight modes;
  • Added a "track vehicle heading" feature as an extension form of the existing "track vehicle position" button functionality;
  • Tap map rotation button to head map back to north;
Screenshare.-.2026-03-12.7_58_28.AM.mp4

Close #2370
Relates to #2362
Close #312

Signed-off-by: Arturo Manzoli <arturomanzoli@gmail.com>
Signed-off-by: Arturo Manzoli <arturomanzoli@gmail.com>
Signed-off-by: Arturo Manzoli <arturomanzoli@gmail.com>
… rotation button

Signed-off-by: Arturo Manzoli <arturomanzoli@gmail.com>
@ArturoManzoli ArturoManzoli force-pushed the 2370-specify-map-rotation branch 2 times, most recently from c113748 to e38608a Compare March 12, 2026 11:11
Signed-off-by: Arturo Manzoli <arturomanzoli@gmail.com>
…drag

Signed-off-by: Arturo Manzoli <arturomanzoli@gmail.com>
@ArturoManzoli ArturoManzoli force-pushed the 2370-specify-map-rotation branch from e38608a to 93ac8e6 Compare March 12, 2026 11:50
@ArturoManzoli ArturoManzoli changed the title Allow users to control map rotation Add map rotation and heading controls Mar 12, 2026
Copy link
Copy Markdown
Contributor

@ES-Alexander ES-Alexander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested with a vehicle yet.

  1. It may be preferable to use a circular component instead of the current square one, to make it clearer it's for rotation, and isn't like the other click-only map buttons.
    Screenshot 2026-03-19 at 4 06 51 pm
  2. I also find the current dark arrow very hard to see over dark backgrounds. I would suggest red instead, but IIRC that's used already in the compass widget for the vehicle heading?
    Not sure what's best there, unless we maybe add a white outline to that dark triangle?
  3. We may need to add some antialiasing to the map grid lines - they show up dotted at some angles
    Screenshot 2026-03-19 at 4 09 00 pm
  4. Per discussion in the last meeting it would be good to expand this to allow syncing a map with a compass widget (likely via the data-lake), and ideally allow using the compass to control the rotation (like is being added here via a new component on the map). Not having them synced can be quite confusing, but that's an involved enough improvement that I don't think it should block this PR.

}
ControlRotate.prototype._handleMouseDrag = function (e: MouseEvent): void {
if (!this.dragging) return
const deltaX = e.clientX - this.dragstartX
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be more inclined to directly make this North -> direction of mouse/finger from the centre of the icon, instead of being incremental.

I was trying to rotate the map by rotating my mouse around the icon, and thought there was a bug that only allowed rotating through half the angles.

If you think incremental is particularly valuable then we could make it that dragging directly up/down is incremental (with all other angles being direct control), since that's what the button location provides the most space for.

* Skips loading if the plugin is already available on L.control.
* @returns {Promise<void>} Resolves when the plugin has been loaded and executed
*/
const loadLeafletRotate = async (): Promise<void> => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to use a single function for this (e.g. from some kind of map utilities file), instead of duplicating the definition between the map and mission planner?

@rafaellehmkuhl
Copy link
Copy Markdown
Member

As per the discussion here we should move the tiles fix to a dedicated PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-needed Change needs to be documented

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow users to specify map rotation, or track vehicle heading Map widget does not load all tiles after being resized

3 participants