diff --git a/src/components/map/Map.tsx b/src/components/map/Map.tsx index 4820ea5..cbb340c 100644 --- a/src/components/map/Map.tsx +++ b/src/components/map/Map.tsx @@ -20,6 +20,7 @@ import { useGeographic as olUseGeographic } from 'ol/proj'; import 'ol/ol.css'; import './Map.css'; +import { Collection } from 'ol'; const Map: Component = () => { const [getMap, setMap] = createSignal(null); @@ -62,6 +63,12 @@ const Map: Component = () => { }); }; + const controls = new Collection([ + new Attribution({ collapsible: true }), + new Rotate(), + new ScaleLine({ bar: true }), + // new Control({ element: getLocation.current ?? undefined }), + ]); const olMap = new OlMap({ view: new View({ center: [+state().lon, +state().lat], @@ -75,7 +82,7 @@ const Map: Component = () => { //new VectorLayer({ source: newSource }), ], target: target, - // controls, + controls, }); olMap.on(['moveend'], changeListener); setMap(olMap);