Here are the imports I have in my TypeScript source file:
import {Vector as sourceVector} from "ol/source";
import {Vector} from "ol/layer";
This is how Vector is exported in ol/source:
export { default as Vector } from './source/Vector';
And in ol/layer:
export { default as Vector } from './layer/Vector';
Is it possible to refactor the imports so they look like this:
import {Vector as source.Vector} from "ol/source";
import {Vector as layer.Vector} from "ol/layer";
Unfortunately, I do not have any control over the design decisions and naming conventions used in ol/source and ol/layer. However, I need to import and use both types in the same source code:
ngAfterViewInit(): void {
const markerSource = new sourceVector({});
this.map = new Map({
layers: [
new TileLayer({
source: new OSM(),
}),
new Vector({ source: markerSource }),
],
view: new View({
center: fromLonLat([11.57548, 48.137552]),
zoom: 13,
}),
target: this.myMap.nativeElement,
});