我在比桌面小得多的屏幕上渲染传单时遇到问题, 谁能帮我解决这个问题,这就是我如何尝试构建和使用我的地图
var cities = L.layerGroup(locationArray);
var mbUrl = 'https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=blablahblah';
var grayscale = L.tileLayer(mbUrl, {id: 'mapbox.light'}),
streets = L.tileLayer(mbUrl, {id: 'mapbox.streets'});
if(map) {
map.remove();
}
map = L.map('searchMap', {
center: [
35.7011398,
51.3892971
],
zoom: 5,
layers: [streets, cities]
});
var baseLayers = {
"Grayscale": grayscale,
"Streets": streets
};
var overlays = {
"Cities": cities
};
L.control.layers(baseLayers, overlays).addTo(map);
//Check Location exist
if(locationArrayBound.length) {
//Fit Bounds
map.fitBounds(locationArrayBound).setMaxZoom(15);
}