Skip to content

Commit e70a142

Browse files
committed
feat: add parameters to vector layer
- updateWhileInteracting - updateWhileAimating - event as parameter into postrender
1 parent 7e4d62c commit e70a142

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/layers/vector-layer.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import { BaseLayerProps } from "./base-layer-props";
66

77
interface VectorLayerProps {
88
onLayerChangeVisible?: (visible: boolean) => void;
9-
onPostRender?: () => void;
9+
onPostRender?: (evt: any) => void;
10+
updateWhileAnimating?: boolean;
11+
updateWhileInteracting?: boolean;
1012
}
1113

1214
type Props = Options<any> & BaseLayerProps & VectorLayerProps;
@@ -16,6 +18,8 @@ const VectorLayer: FunctionComponent<Props> = ({
1618
zIndex = 0,
1719
name,
1820
visible,
21+
updateWhileAnimating,
22+
updateWhileInteracting,
1923
onLayerChangeVisible,
2024
onPostRender,
2125
}) => {
@@ -28,6 +32,8 @@ const VectorLayer: FunctionComponent<Props> = ({
2832
source,
2933
style,
3034
visible,
35+
updateWhileAnimating,
36+
updateWhileInteracting,
3137
});
3238
vectorLayer.setProperties({ name });
3339

@@ -39,7 +45,7 @@ const VectorLayer: FunctionComponent<Props> = ({
3945
}
4046

4147
if (onPostRender) {
42-
vectorLayer.on("postrender", (evt) => onPostRender());
48+
vectorLayer.on("postrender", (evt) => onPostRender(evt));
4349
}
4450

4551
map.addLayer(vectorLayer);

0 commit comments

Comments
 (0)