Skip to content

Does not load traffic layer by default #9

@AndreyNazarchuk

Description

@AndreyNazarchuk

This can not show traffic by default, I have to press the traffic button twice to cycle it. there does not seem to be a working method to show traffic on load.

My code looks like this:

mapboxgl.accessToken = 'redacted_privatekey_'; var map = new mapboxgl.Map({ container: 'map', style: 'mapbox://styles/mapbox/streets-v11', zoom: 8, center: [-122, 47.8], }); map.on('load', function() { map.addControl(new mapboxgl.NavigationControl()); map.addControl(new MapboxTraffic({showTraffic: true})); });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions