百度地圖找到已經標記點位置的經緯度,利用ip去定位所在地方 //創建地圖Map實例 var map = new BMap.Map("addMap"); //中心點設置 map.centerAndZoom( new BMap.Point(116.331398,39.897445), 11); map.enableScrollWheelZoom( true); map.enableContinuousZoom(); //根據IP得到當前城市, 并定位 var point = new BMap.Point(116.331398,39.897445); map.centerAndZoom(point,12); function myFun(result){ var cityName = result.name; map.setCenter(cityName); console.log("當前定位城市:"+cityName); var lngLat = result.center; console.log( "target lngLat", lngLat); $("#addSubmit").click(function( event, wlngLat) { console.log("this listen lngLat", wlngLat);//undefined console.log( "This is addSubmit params", params); addSubmit( params, wlngLat); }); return lngLat; } var myCity = new BMap.LocalCity(); myCity.get(myFun); console.log( myCity.get( myFun));而后 我想得到已經定位了經緯度 用到其他的函數,該怎么處理呢?或者 該去怎么找到這個 已經定位好了的標記點的經緯度呢?
百度地圖找到已經標記點位置的經緯度
九州編程
2018-09-04 10:10:10