在GMap上单击鼠标即可检索坐标 [英] retrieve co-ordinates on mouse click on GMap

查看:262
本文介绍了在GMap上单击鼠标即可检索坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我已经编写了以下代码来创建和修改可调整大小的圆形 geofence .现在,我想在地图上检索鼠标单击事件的坐标. Pl紧急帮助 ...在此先感谢

Hi all,

i have written the following code to create and modify a resizable circular geofence. now, i want to retrieve the co-ordinates on click event of the mouse over the map. Pl help urgently...thanks in advance

if (GBrowserIsCompatible()) 
        { 
            var lat1 = document.getElementById("txtlat1").value;
            var lng1 = document.getElementById("txtlng1").value;
        
            var map_center = new GLatLng(lat1, lng1); // 19.09353  72.854891
        
            map = new GMap2(document.getElementById("map_canvas")); //New GMap object 
            map.setCenter(map_center); 
            var ui = new GMapUIOptions(); //Map UI options 
            ui.maptypes = { normal:true, satellite:true, hybrid:true, physical:false } 
            ui.zoom = {scrollwheel:true, doubleclick:true}; 
            ui.controls = { largemapcontrol3d:true, maptypecontrol:true, scalecontrol:true }; 
            map.setUI(ui); //Set Map UI options 

推荐答案

检查这些

在点击时从Google地图检索坐标 [ ^ ]
Check these

Retrieve Coordinates from Google Maps on Click[^]


这篇关于在GMap上单击鼠标即可检索坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆