浏览代码

feat:兼容复制热点分享链接, 经纬度兼容字符串

jinx 3 年之前
父节点
当前提交
9ed8365894
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      main.js

+ 4 - 2
main.js

@@ -80182,9 +80182,11 @@ and limitations under the License.
           (t.prototype.location = function (e) {
             if (this.filter.lon) throw new Error('location method can only be called once');
             var n = e.toArray();
+            console.log('n[0]',n)
+            console.log('n[0].typeof',typeof(n[0]))
             return (
-              (this.filter.lon = parseFloat(n[0].toFixed(t.FRACTION_DIGITS))),
-              (this.filter.lat = parseFloat(n[1].toFixed(t.FRACTION_DIGITS))),
+              (this.filter.lon =typeof(n[0])=="number"? parseFloat(n[0].toFixed(t.FRACTION_DIGITS)): parseFloat(parseFloat(n[0]).toFixed(t.FRACTION_DIGITS))),
+              (this.filter.lat = typeof(n[1])=="number"?parseFloat(n[1].toFixed(t.FRACTION_DIGITS)): parseFloat(parseFloat(n[1]).toFixed(t.FRACTION_DIGITS))),
               n.length > 2 && (this.filter.z = parseFloat(n[2].toFixed(t.FRACTION_DIGITS))),
               this.getInstance()
             );