1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <template>
- <view class="container">
- <map
-
- :latitude="latitude"
-
- :longitude="longitude"
-
- scale="11"
-
- :markers="markers"
-
- :show-location="true"
-
- @markertap="markertap"
-
- @updated='mapUpdated'
-
- @tap='closeMapMarker'></map>
- </view>
- </template>
- <script>
- import amap from '@/js_sdk/js-amap/amap-wx.130.js'
- export default {
- data() {
- return {
-
- }
- },
- onShow() {
- },
- onLoad() {
- this.amapPlugin = new amap.AMapWX({
-
- key: this.mapKey //该key 是在高德中申请的微信小程序key
-
- });
-
- this.amapPlugin.getRegeo({
-
- type: 'gcj02', //map 组件使用的经纬度是国测局坐标, type 为 gcj02
-
- success: function(res) {
-
- const latitude = res[0].latitude;
-
- const longitude = res[0].longitude;
-
- that.longitude = longitude;
-
- that.latitude = latitude;
-
- that.mapInfo=res[0];
-
- },
-
- fail: (res) => {
-
- console.log(JSON.stringify(res));
-
- }
-
- });
- },
- methods: {
-
- }
- }
- </script>
- <style scoped>
-
- </style>
|