Skip to content
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

How to remove draw root line direction GL Mapbox #90

Closed
achalnexus opened this issue Aug 26, 2016 · 2 comments
Closed

How to remove draw root line direction GL Mapbox #90

achalnexus opened this issue Aug 26, 2016 · 2 comments

Comments

@achalnexus
Copy link

achalnexus commented Aug 26, 2016

I have draw root line direction using GL-mapbox.
then after i have remove this root line on button click.
What i to do.?
==JS Function==

mapboxgl.accessToken = 'pk.eyJ1IjoiYWNoYWxwcmFqYXBhdGkiLCJhIjoiY2lyNGkwZGsxMDFpenUybHd5bjRtMjVjeiJ9.2teTa5MmVqOW-MDpryv56w';

    var map = new mapboxgl.Map({
        //hash: true,
        container: 'map',
        style: 'mapbox://styles/achalprajapati/cis1byfch0008hgnitiwbym9c',
        center: [-117.1425, 32.63638889],
        zoom: 6
    });

    var directions = new mapboxgl.Directions({
        unit: 'metric',
        profile: 'driving',
        container: 'directions',
        proximity: [-117.3186111, 33.10388889]
    });


    directions.setOrigin([-117.1425, 32.63638889]);
    directions.addWaypoint(0, [-117.1425, 32.63638889]);
    directions.addWaypoint(1, [-117.195, 32.75416667]);
    directions.addWaypoint(2, [-116.5616667, 32.93583333]);
    directions.setDestination([-116.5616667, 32.93583333]);

    map.addControl(directions);
@mapsam
Copy link
Contributor

mapsam commented Nov 18, 2016

Hi @achalnexus - a new method removeRoutes will become available in version 3.0.0, which is near completion in #98

@mapsam
Copy link
Contributor

mapsam commented Nov 21, 2016

@achalnexus version 3.x is now out, which includes the removeRoutes method for removing the direction style from your map. Please give this a try!

If I've misunderstood your question, feel free to re-open.

@mapsam mapsam closed this as completed Nov 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants