text: var layer;
  $(function(){
      layui.use('layer',function(){
          layer = layui.layer;
      });
      initForm();
  });
  function initForm(){
      $(".addressLongitude").val(addressLongitude);
      $(".addressLatitude").val(addressLatitude);
  }
  function saveAddress(index,layer){
      var addressName = $(".addressName").val();
      var addressDetail = $(".addressDetail").val();
      if(addressName == null || addressName == ''){
          layer.msg("坐标点名称不能为空");
          return false;
      }
      if(addressDetail == null || addressDetail == ''){
          layer.msg("详细地址不能为空");
          return false;
      }
      //将百度坐标系转化为火星坐标系
      var addressList = DbToGc(addressLongitude,addressLatitude);
      $.ajax({
          url:contextPath+"/address/add",
          type:"post",
          dataType:"json",
          data:{
              addressName: addressName,
              addressDetail: addressDetail,
              addressLatitude: addressList[1],
              addressLongitude: addressList[0]
          },
          success:function(res){
              layer.msg(res.msg);
              if(res.success){
                  $("body").oneTime("1.5s",function(){
                      layer.close(index);
                      parent.location.reload();
                  });
              }
  
          }
      })
  }
  /**
   * 百度坐标系 (BD-09) 与 火星坐标系 (GCJ-02)的转换
   * 即 百度 转 谷歌、高德
   * @param bd_lon
   * @param bd_lat
   * @returns {*[]}
   */
  function DbToGc(bd_lon, bd_lat) {
      var x_pi = 3.14159265358979324 * 3000.0 / 180.0;
      var x = bd_lon - 0.0065;
      var y = bd_lat - 0.006;
      var z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * x_pi);
      var theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * x_pi);
      var gg_lng = z * Math.cos(theta);
      var gg_lat = z * Math.sin(theta);
      return [gg_lng, gg_lat]
  }