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
Hello, I have this pretty simple code that animates a line by changing it's dash-array. While doing this, I've noticed that adding "line-opacity": 0.5 breaks the whole layer and it stops getting displayed. Does anyone have any idea why?
Here is the code snippet:
constMap=()=>{/* ------------------------------ Line Animator ----------------------------- */// Gets changed by useEffect resulting in a smooth animationconst[lineDasharray,setLineDasharray]=useState<number[]>([2,2,2,2]);/* ------------------------------ Layer Styles ------------------------------ */constlineStyle=(color?: string)=>{return{type: "line",paint: {"line-color": color ? color : "#fff","line-width": 3,"line-opacity": 0.5,},}asLayerProps;};return(<MapRootinitialViewState={{longitude: mapPosition.long,latitude: mapPosition.lat,zoom: mapPosition.zoom,}}mapStyle="foo"><Sourceid={`SingleMissionLine`}type="geojson"data={generateLine(currentMission,mapAttrib.packets)}><Layer{...lineStyle()}// Adding "line-opacity": 0.5 under paint property breaks the layer{...{paint: {"line-dasharray": lineDasharray,"line-color": "#fff","line-width": 3}}}/></Source></MapRoot>);};exportdefaultMap;
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I have this pretty simple code that animates a line by changing it's dash-array. While doing this, I've noticed that adding
"line-opacity": 0.5
breaks the whole layer and it stops getting displayed. Does anyone have any idea why?Here is the code snippet:
Beta Was this translation helpful? Give feedback.
All reactions