mariusandra / pigeon-maps

ReactJS Maps without external dependencies
https://pigeon-maps.js.org/
MIT License
3.44k stars 142 forks source link

small feature: generalize the DOM element for tiles beyond just image elements #140

Closed bdon closed 2 years ago

bdon commented 3 years ago

this adds a new parameter/prop to Map for passing in a component class for the tiles; it defaults to the existing img elements. This is useful if you want to tile other DOM elements like div, svg or canvas.

This is implemented as a small refactoring and may not be complete; it would be better to move Img-specific attributes such as srcSet into ImgTile instead of being generic to all Tiles. But I'd like to gauge interest in pursing this idea. Thanks for this library!

mariusandra commented 2 years ago

Hey @bdon , thanks for the contribution! I'll merge it in and update the docs accordingly.

mariusandra commented 2 years ago

I had to clean up some types as well, and now 0.20.0 is out with a new tileComponent prop. Thanks again!