2021-07-01 18:50:35 +02:00
|
|
|
import baseStyle, { buildOptionalLayers, getLayerName, NBS } from './base';
|
2021-05-06 18:51:19 +02:00
|
|
|
import orthoStyle from './layers/ortho';
|
|
|
|
import vectorStyle from './layers/vector';
|
|
|
|
import ignLayers from './layers/ign';
|
2020-10-15 17:22:08 +02:00
|
|
|
|
2021-07-01 18:50:35 +02:00
|
|
|
export { getLayerName, NBS };
|
2021-06-30 10:28:02 +02:00
|
|
|
|
2021-07-01 18:50:35 +02:00
|
|
|
export function getMapStyle(id, layers, opacity) {
|
2021-05-06 18:51:19 +02:00
|
|
|
const style = { ...baseStyle, id };
|
2020-10-15 17:22:08 +02:00
|
|
|
|
2021-05-06 18:51:19 +02:00
|
|
|
switch (id) {
|
2020-10-15 17:22:08 +02:00
|
|
|
case 'ortho':
|
2021-05-06 18:51:19 +02:00
|
|
|
style.layers = orthoStyle;
|
|
|
|
style.name = 'Photographies aériennes';
|
2020-10-15 17:22:08 +02:00
|
|
|
break;
|
|
|
|
case 'vector':
|
2021-05-06 18:51:19 +02:00
|
|
|
style.layers = vectorStyle;
|
|
|
|
style.name = 'Carte OSM';
|
2020-10-15 17:22:08 +02:00
|
|
|
break;
|
|
|
|
case 'ign':
|
2021-05-06 18:51:19 +02:00
|
|
|
style.layers = ignLayers;
|
|
|
|
style.name = 'Carte IGN';
|
2020-10-15 17:22:08 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2021-07-01 18:50:35 +02:00
|
|
|
style.layers = style.layers.concat(buildOptionalLayers(layers, opacity));
|
2020-10-15 17:22:08 +02:00
|
|
|
|
2021-05-06 18:51:19 +02:00
|
|
|
return style;
|
2020-10-15 17:22:08 +02:00
|
|
|
}
|