1. 程式人生 > >小程序地圖導航

小程序地圖導航

wid port handle map ima spa detail alt from

<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, }], },

技術分享圖片

點擊地圖跳轉到

技術分享圖片

小程序地圖導航