Moving controls out of the ol map object.

This commit is contained in:
vdv committed 2022-11-27 12:12:22 +01:00
1 parent 83e14932a4
commit 7f571882de
4 files changed
+44 -34

No files matched your search

@@ -3,6 +3,7 @@
--ion-background-color: white;
position: fixed !important;
top: 6px;
z-index: 1;
}
.back {
@@ -3,5 +3,6 @@
--ion-background-color: white;
margin-left: calc(50% - 20px) !important;
position: fixed !important;
z-index: 1;
bottom: 6px;
}
@@ -2,6 +2,7 @@
position: fixed !important;
top: 6px;
margin-left: calc(100% - 80px) !important;
z-index: 1;
}
.label {
--opacity: 0.6;
+41 -34
View File
@@ -137,39 +137,39 @@ const Map: Component = () => {
new Attribution({ collapsible: true }),
new Rotate(),
new ScaleLine({ bar: true }),
// @ts-ignore
new Control({
// @ts-ignore
element: (
<div>
<GetLocation />
</div>
),
}),
new Control({
// @ts-ignore
element: (
<div>
<Back />
</div>
),
}),
new Control({
// @ts-ignore
element: (
<div>
<Forward />
</div>
),
}),
new Control({
// @ts-ignore
element: (
<div>
<GpxImport />
</div>
),
}),
// // @ts-ignore
// new Control({
// // @ts-ignore
// element: (
// <div>
// <GetLocation />
// </div>
// ),
// }),
// new Control({
// // @ts-ignore
// element: (
// <div>
// <Back />
// </div>
// ),
// }),
// new Control({
// // @ts-ignore
// element: (
// <div>
// <Forward />
// </div>
// ),
// }),
// new Control({
// // @ts-ignore
// element: (
// <div>
// <GpxImport />
// </div>
// ),
// }),
]),
});
olMap.on(['moveend'], changeListener);
@@ -178,7 +178,14 @@ const Map: Component = () => {
});
// @ts-ignore
return <div class='ol-map' ref={target} />;
return (
<div class='ol-map' ref={target}>
<GetLocation />
<Forward />
<Back />
<GpxImport />
</div>
);
};
export default Map;