Open ghost opened 8 years ago
Some years later but maybe can others too. You can use .tiles method like this :
.tiles(function(map){
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}', {
attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.mapbox.com/">Mapbox</a>',
maxZoom: 18,
id: 'mapbox.streets',
accessToken: '<AccessToken>'
}).addTo(map);
})
Is it possible to change the basemap tiles before calling render on the map? Defining the base map tile layer under
layers
in the.mapOptions
accessor doesn't seem to work and results in a blank map with no basemap or geojson data.