Open quorth0n opened 3 years ago
Attempted import error: 'Path' is not exported from 'react-leaflet'.
I'm running into the same problem with react-leaflet 3.2.0. Have any solutions been found?
No, I ended up writing my own implementation of this plugin. The code isn't terribly complex, plus if you handle updates with React's virtual DOM it will be more performant than this one. Essentially you just append SVGs for whichever pattern you're looking to create and then reference their IDs for the fill on the respective feature in leaflet.
Where or at what point did you append the SVGs, been scouring the docs to find how to do that?
Where or at what point did you append the SVGs, been scouring the docs to find how to do that?
Just in the react DOM as normal through a custom component. Where specifically in the DOM doesn't matter as long as they're in there, the fill patterns are linked "globally" by ID
@quorth0n any chances you can publish your work?
@lkazberova apologies for direct mention, but have you considered upgrading this project for the newest React Leaflet v4 or would you rather suggest to re-implement GeoJSONFillable
in new projects
@januszm hey, no prob. Will try to do it in next days :)
any changes? Got the same error. Also need add support react 18+ and types I think
Sorry to revive this, but here's a truncated example of appending the SVG, as mentioned upthread.
<Polygon
positions={[ .. ]}
fillColor='url(#pattern)'
/>
<svg>
<defs>
<pattern id='pattern'>
..
</pattern>
</defs>
</svg>
Attempted import error: 'Path' is not exported from 'react-leaflet'.