简体   繁体   English

通过单击Google Maps HTML获取特定点的纬度和经度

[英]Get latitude and longitude of a certain point by a click in Google Maps HTML

我想知道是否有什么办法,当我单击使用Google Maps API以HTML格式在Google Map中创建的地图时,可以得到该点的“纬度”和“经度”并使用这些值?

Simple example to attach an event handler on the click event to return the lat, lon... 一个简单的示例,将事件处理程序附加到click事件上,以返回经纬度...

google.maps.event.addListener(map, 'click', function( event ){
  alert( "Latitude: "+event.latLng.lat()+" "+", longitude: "+event.latLng.lng() ); 
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Google地图行程中获取经度 - Get latitude longitude from google maps itinerary 如何获取经度和纬度的谷歌在Javascript地图 - how to get longitude and latitude of google maps in javascript 从 MySQL 数据库加载纬度/经度并使用 PHP、html 和 JavaScript 在谷歌地图上显示点 - Loading latitude/longitude from MySQL database and showing point on Google Maps using PHP,html and JavaScript 如何检查Google Maps API中GRoute上的纬度/经度点? - How to check if a Latitude/Longitude point is on the GRoute in Google Maps API? 使用经度和纬度在Google地图中定位位置 - Using latitude and longitude to pin point a location in google maps 使用jQuery插件的Google Maps API:如何在点击时获取标记的纬度和经度? - Google Maps API using jQuery Plugin: How to get a marker's latitude and longitude on click? 动态加载点击后的经度/纬度后,Google地图未居中 - Google Maps not centering after dynamically loading latitude/longitude on click 如何获得与Google Maps URL的纬度和经度值相同的Google Geocoder API几何值(经度和纬度) - How to get the Google Geocoder API geometry values (latitude and longitude) same as Google maps URL latitude and longitude values 经度和纬度搜索Google地图 - Longitude and Latitude search for google maps 如何将经度从HTML表单传递到Google Maps - How to pass Latitude Longitude from HTML form to Google Maps
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM