任何人都可以提供将其与function forEachLayer(text, cb) {
this.map.getStyle().layers.forEach((layer) => {
if (!layer.id.includes(text)) return;
cb(layer);
});
}
// Changing the map base style
export function changeStyle(style) {
const savedLayers = [];
const savedSources = {};
const layerGroups = [
'layer-type-1',
'layer-type-2'
];
layerGroups.forEach((layerGroup) => {
this.forEachLayer(layerGroup, (layer) => {
savedSources[layer.source] = this.map.getSource(layer.source).serialize();
savedLayers.push(layer);
});
});
this.map.setStyle(`mapbox://styles/mapbox/${style}`);
setTimeout(() => {
Object.entries(savedSources).forEach(([id, source]) => {
this.map.addSource(id, source);
});
savedLayers.forEach((layer) => {
this.map.addLayer(layer);
});
}, 1000);
}
库一起使用的方法。我按如下方式使用它,即
Simple.Odata.Client
出现以下错误,即上下文URL
'http://api/data/v8.2/ $ metadata#EntityDefinitions('contact')/ Attributes / Microsoft.Dynamics.CRM.PicklistAttributeMetadata(LogicalName,OptionSet,GlobalOptionSet,OptionSet(Options))/ $ entity' 无效。