diff --git a/pages.json b/pages.json index 28e6b9f..ebf6f5d 100644 --- a/pages.json +++ b/pages.json @@ -24,6 +24,15 @@ } } + ,{ + "path" : "pages/index/myLocation/myLocation", + "style" : + { + "navigationBarTitleText": "我的位置", + "enablePullDownRefresh": false + } + + } ], "globalStyle": { "navigationBarTextStyle": "black", diff --git a/pages/index/index.vue b/pages/index/index.vue index f7e4529..25c9123 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,7 +1,8 @@ @@ -20,10 +21,14 @@ export default { uni.navigateTo({ url:'pointPick/pointPick' }) - }else{ + }else if(val == 2){ uni.navigateTo({ url:'lineDraw/lineDraw' }) + }else{ + uni.navigateTo({ + url:'myLocation/myLocation' + }) } } } @@ -31,5 +36,7 @@ export default { diff --git a/pages/index/myLocation/myLocation.vue b/pages/index/myLocation/myLocation.vue new file mode 100644 index 0000000..8b3e6cf --- /dev/null +++ b/pages/index/myLocation/myLocation.vue @@ -0,0 +1,45 @@ + + + + + diff --git a/pages/index/pointPick/pointPick.vue b/pages/index/pointPick/pointPick.vue index 65d9a74..ad46e5b 100644 --- a/pages/index/pointPick/pointPick.vue +++ b/pages/index/pointPick/pointPick.vue @@ -207,7 +207,7 @@ export default { getLocation() { let this_ = this; uni.getLocation({ - type: 'wgs84', + type: 'gcj02', success: function (res) { console.log('当前位置的经度:' + res.longitude); console.log('当前位置的纬度:' + res.latitude);