Skip to content

Commit

Permalink
fix: rollup build error
Browse files Browse the repository at this point in the history
  • Loading branch information
meucamille committed Feb 14, 2024
1 parent 644c122 commit e248707
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
14 changes: 11 additions & 3 deletions src/controls/full-screen-control.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import React, { FC, useContext, useEffect, useState } from "react";
import React, {
CSSProperties,
FC,
useContext,
useEffect,
useState,
} from "react";
import { FullScreen } from "ol/control";
import { Map } from "ol";
import { MapContext } from "../map/map-context";
import style from "./control.css";

import screenfull from "screenfull";

Expand Down Expand Up @@ -74,7 +79,10 @@ export const FullScreenControl: FC<Props> = ({ CustomControl }) => {
/>
) : (
<div
className={style.control}
style={{
position: "relative !important" as "relative",
width: "max-content",
}}
ref={(el) => {
el && defaultControl && el.appendChild(defaultControl);
}}
Expand Down
6 changes: 3 additions & 3 deletions src/layers/image-layer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { Options } from "ol/layer/BaseImage";
import { BaseLayerProps } from "./base-layer-props";

type ImageLayerProps = BaseLayerProps & {
options: Options;
onLayerAdded?: (layer: OLImageLayer) => void;
options: Options<any>;
onLayerAdded?: (layer: OLImageLayer<any>) => void;
};

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

useEffect(() => {
if (!map) return;
Expand Down
6 changes: 3 additions & 3 deletions src/layers/tile-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { Options } from "ol/layer/BaseTile";
import { BaseLayerProps } from "./base-layer-props";

type Props = BaseLayerProps & {
options: Options;
onLayerAdded?: (layer: OLTileLayer) => void;
options: Options<any>;
onLayerAdded?: (layer: OLTileLayer<any>) => void;
};
const TileLayer: FC<Props> = ({ options, name, onLayerAdded }) => {
const map = useContext(MapContext);
const [layer, setLayer] = useState<OLTileLayer | null>(null);
const [layer, setLayer] = useState<OLTileLayer<any> | null>(null);

useEffect(() => {
if (!map) return;
Expand Down
2 changes: 1 addition & 1 deletion src/layers/vector-layer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import OLVectorLayer from "ol/layer/Vector";
import { Options } from "ol/layer/BaseVector";
import { BaseLayerProps } from "./base-layer-props";

type Props = Options & BaseLayerProps;
type Props = Options<any> & BaseLayerProps;
const VectorLayer: FunctionComponent<Props> = ({
source,
style,
Expand Down

0 comments on commit e248707

Please sign in to comment.