Skip to content

Conversation

@meee1
Copy link
Collaborator

@meee1 meee1 commented Oct 26, 2025

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for rendering KML GroundOverlay elements with geographic transformation. The implementation enables loading and displaying ground overlay images from KML files with proper coordinate mapping.

Key changes:

  • Added parsing and rendering logic for KML GroundOverlay elements with geographic coordinate transformation
  • Implemented image transformation to map overlay images to their specified geographic corners
  • Extended processKML method to accept temporary directory path for accessing overlay image files

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
GCSViews/FlightPlanner.cs Added GroundOverlay processing with image transformation logic and helper methods for corner sorting and coordinate mapping
ExtLibs/SharpKml/Dom/Overlays/GroundOverlay.cs Added GXLatLonQuad property to support gx:LatLonQuad KML element
ExtLibs/Maps/GMapMarkerFill.cs Added constructor overload accepting Bitmap directly for ground overlay rendering

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// has groundoverlay
var go = (GroundOverlay)Element;
var file = go.Icon?.Href?.ToString();
var latlonbox = go.GXLatLonQuad;
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should support KMLs that don't use GXLatLonQuad, and instead use simple bounds (since that's what GoogleEarthPro uses by default). I was going to suggest a patch, but then noticed that I'd also need to account for the rotation parameter, which makes things messier, and it should also need to handle antimeridian crossing. We need to add a rather long helper function somewhere to convert LatLonBox to LatLonQuad.

At the very least, we should warn the user that we only support LatLonQuad images instead of silently failing.

Copy link
Collaborator

Choose a reason for hiding this comment

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

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