/* * @Author: gaorf30153 gaorf30153@hundsun.com * @Date: 2024-07-30 16:13:41 * @LastEditors: gaorf30153 gaorf30153@hundsun.com * @LastEditTime: 2024-08-08 18:25:13 * @FilePath: \wxminipro\plugin\pages\signing\map\map.js * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE */ // plugin/pages/signing/map/map.js Page({ /** * 页面的初始数据 */ data: { longitude: 0, latitude: 0, current: {}, scale: 18, markersList: [], }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { let netWork = JSON.parse(options.params) this.data.markersList[0] = { longitude: netWork.longitude, latitude: netWork.latitude, title: netWork.branchName, } this.setData({ current: netWork, longitude: netWork.longitude, latitude: netWork.latitude, markersList: this.data.markersList, }) }, goMap() { let mapObj = wx.createMapContext("map") mapObj.openMapApp({ longitude: this.data.longitude, latitude: this.data.latitude, destination: this.data.current.branchAddress, }) }, })