mapbox / mapbox.js-plugins

Hosted plugins for Leaflet & Mapbox.js
mapbox.com/mapbox.js/plugins/
BSD 2-Clause "Simplified" License
13 stars 16 forks source link

arc.js has a weird rendering artifact over the north pole #42

Open mrjbq7 opened 5 months ago

mrjbq7 commented 5 months ago

In the process of investigating this issue (https://github.com/mapbox/mapbox-gl-js/issues/13121), I discovered some weird rendering artifacts when arc.GreatCircle draws a line across/near the North Pole:

<script src="https://api.mapbox.com/mapbox.js/plugins/arc.js/v0.1.0/arc.js"></script>
    let arcs = [];

    let start = { x: -122.375, y: 37.61899948120117};
    let end = { x: 55.3643989563, y: 25.2527999878};

    var generator = new arc.GreatCircle(start, end);
    var line = generator.Arc(100, { offset: 20});
    arcs.push(line.json());

    map.getSource('LineString').setData({
        'type': 'FeatureCollection',
        'features': arcs
    });
Screenshot 2024-03-18 at 11 51 49 AM