maparoni / GeoProjector

Native Swift library for drawing map projections
MIT License
8 stars 0 forks source link

Issue when drawing shapes spanning anti-meridian #21

Open nighthawk opened 10 months ago

nighthawk commented 10 months ago

Two GeoJSON files attaches for Alaska and New Zealand.

They fail to draw correctly when using this snippet:

    // now draw each individually
    let drawer = GeoDrawer(
      size: .init(rect.size),
      projection: Projections.Mercator(reference: boundingBox.center),
      zoomTo: boundingBox
    )
    let contents = GeoDrawer.Content.shapeContent(for: overlays, fill: fill, stroke: stroke, fallback: fallback)
    drawer.draw(contents, in: context)