From 7d082eaba10b870727e5c56ad865a0b5fb333ada Mon Sep 17 00:00:00 2001 From: zhenyuWang <13641039885@163.com> Date: Tue, 2 Aug 2022 15:58:34 +0800 Subject: [PATCH] =?UTF-8?q?feat(h5=20map):=20=E9=AB=98=E5=BE=B7=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=E6=94=AF=E6=8C=81=20polygons?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/platforms/h5/view/components/map/map-polygon.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/platforms/h5/view/components/map/map-polygon.js b/src/platforms/h5/view/components/map/map-polygon.js index e0a7494ba..42cacf8c9 100644 --- a/src/platforms/h5/view/components/map/map-polygon.js +++ b/src/platforms/h5/view/components/map/map-polygon.js @@ -1,4 +1,8 @@ import { hexToRgba } from 'uni-shared' +import { MapType, getMapInfo } from '../../../helpers/location' + +const mapInfo = getMapInfo() +const ISAMAP = mapInfo.type === MapType.AMAP export default { props: { @@ -65,7 +69,7 @@ export default { const path = points.map(item => { const { latitude, longitude } = item - return new _maps.LatLng(latitude, longitude) + return ISAMAP ? [longitude, latitude] : new _maps.LatLng(latitude, longitude) }) const { r: fcR, g: fcG, b: fcB, a: fcA } = hexToRgba(fillColor) -- GitLab