Skip to content
This repository was archived by the owner on Apr 24, 2024. It is now read-only.
This repository was archived by the owner on Apr 24, 2024. It is now read-only.

Document that null style URL is necessary when using a styleLayer and passing map options  #1339

Description

@malwoodsantoro

It's necessary to pass in null for the style URL when using map options. This isn't clear in the documentation. This is especially noticeable for users trying to migrate from Classic styles to the modern Static Tiles endpoint.

Map does not render with tile_layer.js:49 Uncaught TypeError: Cannot read property '0' of undefined error:

var map = L.mapbox.map('map', {maxZoom: 3})
    .setView([40, -74.50], 1)
    .addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'));

Map renders as expected:

var map = L.mapbox.map('map', null, {maxZoom: 3})
    .setView([40, -74.50], 1)
    .addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/streets-v11'));

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions