如何通过谷歌地图获得点击点

How to get point of click by Google Map?

本文关键字:何通过 谷歌地图      更新时间:2023-09-26

我一直在开发一些应用程序,我需要把谷歌地图放在我的网站上。我用这个代码做了它:

<?php
echo "<iframe width='425' height='350' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src='http://maps.google.ru/maps?hl=ru&amp;ie=UTF8&amp;ll=55.354135,40.297852&amp;spn=27.388971,86.572266&amp;t=h&amp;z=4&amp;output=embed'></iframe><br /><small><a href='http://maps.google.ru/maps?hl=ru&amp;ie=UTF8&amp;ll=55.354135,40.297852&amp;spn=27.388971,86.572266&amp;t=h&amp;z=4&amp;source=embed' style='color:#0000FF;text-align:left'>Show map increased</a></small>";
echo "<form method='POST'><input type='text' /><input type='submit' /></form>";
?>

你可以看到我也使用"形式"。这很重要,因为若用户点击地图,那个么表单中的标签应该显示点击的坐标。但我不懂Java Script。请告诉我,我该怎么做?非常感谢。

您需要学习Javascript。使用谷歌地图API。这个例子非常接近你想要的。