Moving controls out of the ol map object.
This commit is contained in:
1 parent
83e14932a4
commit
7f571882de
4 files changed
+44
-34
No files matched your search
+41
-34
@@ -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;
|
||||
Reference in new issue
Block a user