GithubHelp home page GithubHelp logo

Comments (3)

mrjbq7 avatar mrjbq7 commented on June 5, 2024

I tried to use the arc.js plugin version 0.1.0, but it has weird rendering artifacts over the north pole, and I don't understand why a LineString wouldn't render correctly anyway.

<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

from mapbox-gl-js.

chboing avatar chboing commented on June 5, 2024

You should try mapbox-gl-draw-geodesic instead. https://www.npmjs.com/package/mapbox-gl-draw-geodesic
Mapbox is not drawing geodesic by default.

For the north pole bug . . there are already some issues around here.

You'll soon notice that it's above 85N or below 85S, and probably linked to the lack of map texture there. Seems like a common thing. Google maps or others have no tiles above or below this limit.

from mapbox-gl-js.

mrjbq7 avatar mrjbq7 commented on June 5, 2024

@chboing thanks, I also looked at mapbox-gl-draw-geodesic, and it renders the lines in the correct orientation, but also has the North Pole drawing bug...

from mapbox-gl-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.