小程序地图导航

时间:2018-10-22 11:34:58   收藏:0   阅读:399
<view class="address-map">
  <map id="map" longitude="{{jobDetail.longitude}}" latitude="{{jobDetail.latitude}}" scale="14" markers="{{markers}}" bindtap="handleMap" show-location style="width: 100%; height: 196rpx;">
  </map>
</view>

 js:


import WxParse from ‘../../vendor/wxParse/wxParse.js‘
data: {
    latitude: ‘‘,
    longitude: ‘‘,
    width: 35,
    height: 45,
    markers: [{
      latitude: ‘‘,
      longitude: ‘‘,
    }],
  },

通过点击事件打开地图界面

<view class="address-map">
  <map id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="14" markers="{{markers}}" circles="{{circles}}" show-location style="width: 100%; height: 100vh;">
  </map>
</view>

import WxParse from ‘../../vendor/wxParse/wxParse.js‘
Page({
  data: {
    jobDetail: {},
    show: 1,
    isApply: 1,
    id: 0,
    jobId: ‘‘,
    latitude: 40.002607,
    longitude: 116.487847,
    width: 100,
    height: 100,
    markers: [{
      latitude: 40.002607,
      longitude: 116.487847,
    }],
  },

技术分享图片

点击地图跳转到

技术分享图片

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!