-
Couldn't load subscription status.
- Fork 2.6k
add support for kml groundoverlay rendering #3605
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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
processKMLmethod 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.