Raruto / leaflet-rotate

Leaflet plugin that allows to add rotation functionality to map tiles
GNU General Public License v3.0
77 stars 21 forks source link

Is this a plugin i add to leaflet package or a standalone replacement? #50

Closed laurencefass closed 5 months ago

laurencefass commented 5 months ago

Is this a plugin i add to leaflet package or a standalone replacement? This install instructions looks like a fork (complete replacement).

Im a bit confused by repos - I think I used one of your forks a few years ago - leaflet-rotate-map? Though I cant see it on github anymore.

Any advice is appreciated.

Thanks

Raruto commented 5 months ago

It's a companion plugin to leaflet:

It is also listed in here: https://leafletjs.com/plugins.html#tileimage-display

👋 Raruto

laurencefass commented 5 months ago

Thanks for your reply. Im trying to upgrade from using leaflet-rotate-map which i was using to replace leaflet so its great you have created this plugin!

The problem I am currently facing is that react-leaflet v4 doesnt include the setBearing function (and possibly others exposed by your plugin?)

I realise its beyond scope of the query, but do you know of a way to access the leaflet object from the react-leaflet abstractions so I can use your functions directly?

(if i find a way myself I will post here as may be useful to others)

Raruto commented 5 months ago

You've already asked for this before..

laurencefass commented 5 months ago

Ah yes I remember now the sandbox. There have been a few version bumps since, however with a bit of experimentation I found that I can access map.setBearing in Typescript with the simple addition of

import "leaflet-rotate";

without any refs. if I remove the import I get setBearing not defined errors. Im not going to delve further into why this works, but it does!

Thanks again for your help.