// pages/nav/nav.js
Page({

    /**
     * Page initial data
     */
    data: {

    },

    /**
     * Lifecycle function--Called when page load
     */
    onLoad(options) {
      this.setData({
        latitude: parseFloat(options.latitude),
        longitude: parseFloat(options.longitude),
      });
    },

    /**
     * Lifecycle function--Called when page is initially rendered
     */
    onReady() {
      this.open_location();
    },

    /**
     * Lifecycle function--Called when page show
     */
    onShow() {

    },

    /**
     * Lifecycle function--Called when page hide
     */
    onHide() {

    },

    /**
     * Lifecycle function--Called when page unload
     */
    onUnload() {

    },

    /**
     * Page event handler function--Called when user drop down
     */
    onPullDownRefresh() {

    },

    /**
     * Called when page reach bottom
     */
    onReachBottom() {

    },

    /**
     * Called when user click on the top right corner to share
     */
    onShareAppMessage() {

    },

  open_location() {
    console.log("open location");
    var args = {
      latitude: this.data.latitude,
      longitude: this.data.longitude,
    };
    console.log(args);
    wx.openLocation(args);
  }
})
