Zverik / leaflet-streetview

Buttons for opening Street View services
Do What The F*ck You Want To Public License
24 stars 5 forks source link

Link into permalink (coordinates specified) on i.e suncalc.org or peakfinder.org #1

Open Krukarius opened 4 years ago

Krukarius commented 4 years ago

Hi,

Your job is perfect.

I am wondering how to make another links such the Street View options

The details of this query is based here:

https://gis.stackexchange.com/questions/339126/link-to-another-url-permalink-in-leaflet

Is it feasible through a similar code?

Zverik commented 4 years ago

Well yes, you can take the code for buttons and tweak it a bit. I based mine off two plugins for mapbbcode: "FunctionButtons" and "PermalinkAttribution". The idea is basically to listen to map's move event and update the link with the map.getCenter() coordinates.

Krukarius commented 4 years ago

Hi,

I have found and downloaded the file PermalinkAttribution.js, which is relevant for my purpose.

Because I am quite new in js. Could you tell me how to attach it to the main .js code?

Have you got some example working?

Thanks in advance

Krukarius commented 4 years ago

Hi,

I was struggling to make this code running.

After incorporation:

L.Control.PermalinkAttribution({position:'topright'}).addTo(map);

to my code, no results. Could you clarify what to do? Thank you in advance