Skip to content

Commit e248707

Browse files
committed
fix: rollup build error
1 parent 644c122 commit e248707

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

src/controls/full-screen-control.tsx

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
import React, { FC, useContext, useEffect, useState } from "react";
1+
import React, {
2+
CSSProperties,
3+
FC,
4+
useContext,
5+
useEffect,
6+
useState,
7+
} from "react";
28
import { FullScreen } from "ol/control";
39
import { Map } from "ol";
410
import { MapContext } from "../map/map-context";
5-
import style from "./control.css";
611

712
import screenfull from "screenfull";
813

@@ -74,7 +79,10 @@ export const FullScreenControl: FC<Props> = ({ CustomControl }) => {
7479
/>
7580
) : (
7681
<div
77-
className={style.control}
82+
style={{
83+
position: "relative !important" as "relative",
84+
width: "max-content",
85+
}}
7886
ref={(el) => {
7987
el && defaultControl && el.appendChild(defaultControl);
8088
}}

src/layers/image-layer.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import { Options } from "ol/layer/BaseImage";
55
import { BaseLayerProps } from "./base-layer-props";
66

77
type ImageLayerProps = BaseLayerProps & {
8-
options: Options;
9-
onLayerAdded?: (layer: OLImageLayer) => void;
8+
options: Options<any>;
9+
onLayerAdded?: (layer: OLImageLayer<any>) => void;
1010
};
1111

1212
// TODO: Refactor layer creation into a generic one.
1313
const ImageLayer: FC<ImageLayerProps> = ({ options, name, onLayerAdded }) => {
1414
const map = useContext(MapContext);
15-
const [layer, setLayer] = useState<OLImageLayer | null>(null);
15+
const [layer, setLayer] = useState<OLImageLayer<any> | null>(null);
1616

1717
useEffect(() => {
1818
if (!map) return;

src/layers/tile-layer.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { Options } from "ol/layer/BaseTile";
55
import { BaseLayerProps } from "./base-layer-props";
66

77
type Props = BaseLayerProps & {
8-
options: Options;
9-
onLayerAdded?: (layer: OLTileLayer) => void;
8+
options: Options<any>;
9+
onLayerAdded?: (layer: OLTileLayer<any>) => void;
1010
};
1111
const TileLayer: FC<Props> = ({ options, name, onLayerAdded }) => {
1212
const map = useContext(MapContext);
13-
const [layer, setLayer] = useState<OLTileLayer | null>(null);
13+
const [layer, setLayer] = useState<OLTileLayer<any> | null>(null);
1414

1515
useEffect(() => {
1616
if (!map) return;

src/layers/vector-layer.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import OLVectorLayer from "ol/layer/Vector";
44
import { Options } from "ol/layer/BaseVector";
55
import { BaseLayerProps } from "./base-layer-props";
66

7-
type Props = Options & BaseLayerProps;
7+
type Props = Options<any> & BaseLayerProps;
88
const VectorLayer: FunctionComponent<Props> = ({
99
source,
1010
style,

0 commit comments

Comments
 (0)