You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using the 'declutter' property on my RLayerVector components within JavaScript (.js) react components with no issues as below:
importReactfrom"react";import{RLayerVector}from"rlayers";import{GeoJSON}from"ol/format";importarrowUpfrom"../image.svg";constComponent: React.FC<Props> = (props) =>{return(<RLayerVectorzIndex={5}format={newGeoJSON({featureProjection: "EPSG:3857"})}url={"source-url"}declutter={true}visible={true}style={()=>{returnnewStyle({image: newIcon({src: arrowUp,// Arrow image sourcerotation: 0,// Rotation to align with the line directionscale: 0.1,// Adjust the size of the image}),});}}/>);};
export default Component;
However I am now starting to use TypeScript (.tsx) components and the 'declutter' prop isn't available to be used within them, and the following exception is shown:
Type '{ zIndex: number; format: GeoJSON; url: string; declutter: boolean; visible: true; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<RLayerVector> & Readonly<RLayerBaseVectorProps> & Readonly<...>'.
The text was updated successfully, but these errors were encountered:
Passing OpenLayers properties that are not explicitly enumerated is not an official feature although it works indeed.
Alas, I do not see how this can be expressed with the current capabilities of TypeScript since the properties use inheritance and the TypeScript mapped types currently do not support interfaces.
I have been using the 'declutter' property on my RLayerVector components within JavaScript (.js) react components with no issues as below:
However I am now starting to use TypeScript (.tsx) components and the 'declutter' prop isn't available to be used within them, and the following exception is shown:
The text was updated successfully, but these errors were encountered: