Slight refactoring

This commit is contained in:
vdv committed 2022-11-22 15:41:47 +01:00
1 parent 0d8bc3b2f1
commit 0f8f892688
4 files changed
+9 -6

No files matched your search

File renamed without changes.
@@ -2,9 +2,11 @@ import React, { useEffect, useRef } from 'react';
import OlMap from 'ol/Map';
import View from 'ol/View';
import TileLayer from 'ol/layer/Tile';
import OSM from 'ol/source/OSM';
import Attribution from 'ol/control/Attribution';
import OSM, { ATTRIBUTION } from 'ol/source/OSM';
import './Map.css'
import './Map.css';
import Collection from 'ol/Collection';
export interface MapProperties {}
@@ -12,6 +14,7 @@ export const Map: React.FC<MapProperties> = (props: MapProperties) => {
const target = useRef<HTMLDivElement>(null);
useEffect(() => {
const controls = new Collection([new Attribution({ collapsible: true })]);
const map = new OlMap({
view: new View({
center: [0, 0],
@@ -23,6 +26,7 @@ export const Map: React.FC<MapProperties> = (props: MapProperties) => {
}),
],
target: target.current ?? undefined,
controls,
});
}, []);
+1
View File
@@ -0,0 +1 @@
export { default } from './Map';