@@ -2,13 +2,17 @@ import React, {
22 useEffect
33} from 'react' ;
44
5- import { ObjectEvent as OlObjectEvent } from 'ol/Object' ;
5+ import {
6+ ObjectEvent as OlObjectEvent
7+ } from 'ol/Object' ;
68
79import {
810 useTranslation
911} from 'react-i18next' ;
1012
11- import { MapUtil } from '@terrestris/ol-util/dist/MapUtil/MapUtil' ;
13+ import {
14+ MapUtil
15+ } from '@terrestris/ol-util/dist/MapUtil/MapUtil' ;
1216
1317import {
1418 BackgroundLayerChooser
@@ -18,7 +22,9 @@ import {
1822 MapComponent ,
1923 MapComponentProps
2024} from '@terrestris/react-geo/dist/Map/MapComponent/MapComponent' ;
21- import { useMap } from '@terrestris/react-util/dist/Hooks/useMap/useMap' ;
25+ import {
26+ useMap
27+ } from '@terrestris/react-util/dist/Hooks/useMap/useMap' ;
2228
2329import useAppSelector from '../../hooks/useAppSelector' ;
2430import usePlugins from '../../hooks/usePlugins' ;
@@ -27,6 +33,9 @@ import {
2733 isMapIntegration
2834} from '../../plugin' ;
2935
36+ import MapControl from '../MapControl' ;
37+ import MapToolbar from '../MapToolbar' ;
38+
3039import './index.less' ;
3140
3241export const BasicMapComponent : React . FC < Partial < MapComponentProps > > = ( {
@@ -42,6 +51,7 @@ export const BasicMapComponent: React.FC<Partial<MapComponentProps>> = ({
4251
4352 const blcVisible = useAppSelector ( state => state . backgroundLayerChooser . visible ) ;
4453 const allowEmptyBackground = useAppSelector ( state => state . backgroundLayerChooser . allowEmptyBackground ) ;
54+ const mapToolbarVisible = useAppSelector ( state => state . mapToolbarVisible . visible ) ;
4555
4656 /**
4757 * Updates external layer group name when language changes.
@@ -90,11 +100,22 @@ export const BasicMapComponent: React.FC<Partial<MapComponentProps>> = ({
90100 map = { map }
91101 { ...restProps }
92102 >
93- { blcVisible &&
94- < BackgroundLayerChooser
95- layers = { map . getAllLayers ( ) . filter ( l => l . get ( 'isBackgroundLayer' ) === true ) . reverse ( ) }
96- allowEmptyBackground = { allowEmptyBackground }
97- />
103+ {
104+ mapToolbarVisible && (
105+ < MapControl
106+ className = "toolbar-control"
107+ >
108+ < MapToolbar />
109+ </ MapControl >
110+ )
111+ }
112+ {
113+ blcVisible && (
114+ < BackgroundLayerChooser
115+ layers = { map . getAllLayers ( ) . filter ( l => l . get ( 'isBackgroundLayer' ) === true ) . reverse ( ) }
116+ allowEmptyBackground = { allowEmptyBackground }
117+ />
118+ )
98119 }
99120 {
100121 pluginComponents
0 commit comments