ee4d6441 by ex

添加提示

1 parent b2b4f299
...@@ -79,7 +79,8 @@ AppClient.prototype.getGPS = function (jsonStr, callback) { ...@@ -79,7 +79,8 @@ AppClient.prototype.getGPS = function (jsonStr, callback) {
79 isRes = true 79 isRes = true
80 var latitude = '' 80 var latitude = ''
81 var longitude = '' 81 var longitude = ''
82 var result = /\{([\s\S]*)\}/.exec(data); 82 var str = JSON.stringify(data)
83 var result = /\{([\s\S]*)\}/.exec(str);
83 var arr = result[1].split(',') 84 var arr = result[1].split(',')
84 latitude = arr[0].split('=')[1] 85 latitude = arr[0].split('=')[1]
85 longitude = arr[1].split('=')[1] 86 longitude = arr[1].split('=')[1]
...@@ -92,16 +93,11 @@ AppClient.prototype.getGPS = function (jsonStr, callback) { ...@@ -92,16 +93,11 @@ AppClient.prototype.getGPS = function (jsonStr, callback) {
92 var latitude = '' 93 var latitude = ''
93 var longitude = '' 94 var longitude = ''
94 var str = JSON.stringify(data) 95 var str = JSON.stringify(data)
95 try { 96 var result = /\{([\s\S]*)\}/.exec(str);
96 var result = /\{([\s\S]*)\}/.exec(str); 97 var arr = result[1].split(',')
97 var arr = result[1].split(',') 98 longitude = arr[0].split(':')[1]
98 longitude = arr[0].split(':')[1] 99 latitude = arr[1].split(':')[1]
99 latitude = arr[1].split(':')[1] 100
100 } catch (e) {
101 layer.open({
102 content: e
103 })
104 }
105 101
106 102
107 callback(latitude, longitude, responseCallback) 103 callback(latitude, longitude, responseCallback)
......
...@@ -214,7 +214,11 @@ angular.module('myApp') ...@@ -214,7 +214,11 @@ angular.module('myApp')
214 relocateControl.appendChild(relocateControlContent); 214 relocateControl.appendChild(relocateControlContent);
215 215
216 relocateControl.onclick = function() { 216 relocateControl.onclick = function() {
217 map.panTo(myMarker.position); 217 // map.panTo(myMarker.position);
218 layer.open({
219 content: '正在定位'
220 })
221 initLocation()
218 map.setZoom(15); 222 map.setZoom(15);
219 } 223 }
220 map.getContainer().appendChild(relocateControl); 224 map.getContainer().appendChild(relocateControl);
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!