Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Create un MapRectangle crossing the antimeridian
Qt 6.11 is out! See what's new in the release blog

Create un MapRectangle crossing the antimeridian

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 59 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Carnacf
    wrote last edited by
    #1

    I am experiencing an issue with MapRectangle / MapPolygon in Qt Location when the geometry crosses the antimeridian (180° longitude).

    Example:

    MapRectangle {
        id: testRect
    
        topLeft {
            latitude: 86.45
            longitude: 167.65
        }
    
        bottomRight {
            latitude: 14.92
            longitude: -40.73
        }
    }
    

    The rectangle is rendered incorrectly and appears to wrap around the globe in the wrong direction. The longitude interpretation seems inverted.

    I also tried using MapPolygon:

    MapPolygon {
        path: [
            QtPositioning.coordinate(86.45, 167.65),
            QtPositioning.coordinate(86.45, -40.73),
            QtPositioning.coordinate(14.92, -40.73),
            QtPositioning.coordinate(14.92, 167.65)
        ]
    }
    

    but the polygon is still rendered incorrectly.

    Does Qt Location officially support polygons/rectangles crossing the antimeridian?

    Is splitting the geometry into two polygons the only reliable workaround?

    Qt version: 6.10

    Any guidance would be appreciated.

    1 Reply Last reply
    1

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved