JeremyHeleine / Photo-Sphere-Viewer

A JavaScript library to display Photo Sphere panoramas.
854 stars 952 forks source link

drag and drop marker #105

Open freedom2012 opened 4 years ago

freedom2012 commented 4 years ago

hello,how can i drag and drop marker or how can i use THREE to achieve it?

SviMik commented 4 years ago

It is doable, however you'll need to add new events to the library (_onMouseDown, _onMouseUp) and edit the _onMouseMove event to handle it. Then you can get the mouse coordinates and convert them to lat/lon (an example of conversion can be found in the _click event). Once you have the callbacks, simply update the marker position with updateMarker().