0

友人と私は、Google マップを使用して達成しようとしているプロジェクトを持っています。人々が私たちのウェブサイトにアクセスして、カスタム Google マップの任意の場所にマーカーを追加/ドラッグできるようにしたいと考えています。真似できるものはないかといろいろ探しましたが、だめでした。

誰かが私たちを助けてくれるなら。また、答えを教えてくれる人を探しているのではなく、正しい方向に導いてくれる人を求めています。それが私たちに渡されるよりも、私たちはむしろこれを行う方法を学びたいと思っています.

ありがとう!

4

1 に答える 1

1

Pretty simple, you can set an click event on the map that gives you the latitude and longitude of the click, and use that to create a marker. And when you do, set the draggable property to true. That allows users to drag it around, and when it lands it will fire another event.

Some info that might be helpful: https://developers.google.com/maps/documentation/javascript/events https://developers.google.com/maps/documentation/javascript/overlays#Markers https://developers.google.com/maps/documentation/javascript/reference#Marker (check out events section)

于 2012-08-08T18:22:51.823 に答える