bbecquet / Leaflet.RotatedMarker

Leaflet plugin to enable the rotation of map marker icons
MIT License
258 stars 102 forks source link

Make a modular leaflet plugin #11

Open hozkok opened 7 years ago

hozkok commented 7 years ago

Right now, the plugin is extending L.Marker implicitly and this is not a very modular approach. That may cause ambiguity on importing/exporting ES6 modules. Would be better to be able to import {RotatedMarker} from 'leaflet-rotatedmarker' explicitly.

A better idea might be to add a separate L.RotatedMarker plugin which extends L.Marker.

with this way, that would also be possible to add some typed library support as well (e.g. TypeScript d.ts file).

FeldrinH commented 5 months ago

For anyone who finds this looking for TypeScript support for this plugin, it is worth noting that there are type definitions available from DefinitelyTyped: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/leaflet-rotatedmarker