我目前正在使用传单创建网络地图。我使用leaflet.ajax从geojson导入多边形。但是新的多边形层覆盖了底图,从而导致了白色背景上的多边形。
https://virgilxw.github.io/Singapore_Election_1955/
如果您进入github页面并导航至图层菜单,则可以在“数据”下找到多边形图层。
我尝试对图层进行重新排序,但是将底图移动到多边形上方只会导致覆盖多边形。
// Default base Map
map.addLayer(layerOneMapSG_Default);
// Add geojson
var Layer1955Wards = new L.GeoJSON.AJAX("data/wards1955.geojson");
// Styled Layer Control
var baseMaps = [
{
groupName: "Base Maps",
expanded: true,
layers: {
"OneMap": layerOneMapSG_Default
}
}];
var overlays = [
{
groupName: "data",
expaned: "true",
layers: {
"Constituencies": Layer1955Wards
}
},
{
groupName: "Map Overlays",
expanded: "true",
layers: {
"1953 Topological": Layer1953Topo,
"1953 Aerial Photographs": Layer1953Aerial
}
}];
var styledLayerControlOptions = {
container_width: "300px",
container_maxHeight: "350px",
group_maxHeight: "80px",
exclusive: false
};
var styledLayerControl = L.Control.styledLayerControl(baseMaps, overlays, styledLayerControlOptions);
map.addControl(styledLayerControl, overlays);