Open malwoodsantoro opened 3 years ago
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.
null
Map does not render with tile_layer.js:49 Uncaught TypeError: Cannot read property '0' of undefined error:
tile_layer.js:49 Uncaught TypeError: Cannot read property '0' of undefined
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'));
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:Map renders as expected: