From edf4538f16b777082c34edac73512746bcd790db Mon Sep 17 00:00:00 2001 From: qiang Date: Mon, 20 Dec 2021 19:34:39 +0800 Subject: [PATCH] fix(App): coordsType --- .../helpers/protocol/location/get-location.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/core/helpers/protocol/location/get-location.js b/src/core/helpers/protocol/location/get-location.js index 4723409f8..2fe5e8816 100644 --- a/src/core/helpers/protocol/location/get-location.js +++ b/src/core/helpers/protocol/location/get-location.js @@ -1,18 +1,15 @@ -const type = { - WGS84: 'WGS84', - GCJ02: 'GCJ02' -} +const coordTypes = ['wgs84', 'gcj02'] + export const getLocation = { type: { type: String, validator (value, params) { - value = (value || '').toUpperCase() - params.type = Object.values(type).indexOf(value) < 0 ? type.WGS84 : value - }, - default: type.WGS84 + value = (value || '').toLowerCase() + params.type = coordTypes.indexOf(value) < 0 ? coordTypes[0] : value + } }, altitude: { type: Boolean, default: false } -} +} -- GitLab