|
|
@@ -579,6 +579,8 @@
|
|
|
|
|
|
<script src="${ctx}/mobile/layer-mobile/layer.js"></script>
|
|
|
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
|
|
|
+ <script src="https://3gimg.qq.com/lightmap/components/geolocation/geolocation.min.js"></script>
|
|
|
+
|
|
|
<script>
|
|
|
let showError = false;
|
|
|
var latitude = "";
|
|
|
@@ -596,17 +598,32 @@
|
|
|
|
|
|
wx.ready(function(){
|
|
|
showError = true;
|
|
|
- wx.getLocation({
|
|
|
- type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
|
|
- success: function (res) {
|
|
|
- latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
|
|
|
- longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
|
|
|
- $("#isLocation").hide();
|
|
|
- },
|
|
|
- fail:function(){
|
|
|
- $("#isLocation").show();
|
|
|
- }
|
|
|
- });
|
|
|
+// wx.getLocation({
|
|
|
+// type: 'wgs84', // 默认为wgs84的gps坐标,如果要返回直接给openLocation用的火星坐标,可传入'gcj02'
|
|
|
+// success: function (res) {
|
|
|
+// latitude = res.latitude; // 纬度,浮点数,范围为90 ~ -90
|
|
|
+// longitude = res.longitude; // 经度,浮点数,范围为180 ~ -180。
|
|
|
+// $("#isLocation").hide();
|
|
|
+// },
|
|
|
+// fail:function(){
|
|
|
+// $("#isLocation").show();
|
|
|
+// }
|
|
|
+// });
|
|
|
+ if(window["qq"] == undefined) return;
|
|
|
+ var geolocation = new qq.maps.Geolocation("CXFBZ-R27RF-MSQJV-JVWS4-3BAXQ-XXBN6", "myapp");
|
|
|
+ geolocation.getLocation(function(pos){//老版本的定位不支持ios10,使用腾讯地图的api可以支持
|
|
|
+ var addr = pos.addr;
|
|
|
+ latitude = pos.lat;
|
|
|
+ longitude = pos.lng;
|
|
|
+ var province = pos.province;
|
|
|
+ var city = pos.city;
|
|
|
+ var district = pos.district;
|
|
|
+ if(!district){
|
|
|
+ district = "";
|
|
|
+ }
|
|
|
+ addr = province+";"+city+";"+district+";"+addr;
|
|
|
+ addr = addr+"#("+lat+","+lnt+")";
|
|
|
+ });
|
|
|
});
|
|
|
|
|
|
wx.error(function(res){
|