@heycar/heycars-map 2.3.1 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +0 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +4 -1
- package/dist/v2/business-components/StartEndPoint/StartEndPoint.js +1 -1
- package/dist/v2/business-components/TaxiCar/TaxiCar.js +2 -2
- package/dist/v2/chunks/{StartEndPoint.css.8242788c.js → StartEndPoint.css.9e64a1ee.js} +1 -1
- package/dist/{v3/css/StartEndPoint-d7806e8e.css → v2/css/StartEndPoint-73c01544.css} +2 -1
- package/dist/{v3/css/TaxiCar-9155f78f.css → v2/css/TaxiCar-37baac68.css} +2 -1
- package/dist/v2/hooks/useMapCoordinatify.js +5 -2
- package/dist/v2/hooks/useMapGCJ02.d.ts +3 -0
- package/dist/v2/hooks/useMapGCJ02.js +31 -2
- package/dist/v2/utils/log.js +1 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +0 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +4 -1
- package/dist/v3/business-components/StartEndPoint/StartEndPoint.js +1 -1
- package/dist/v3/business-components/TaxiCar/TaxiCar.js +2 -2
- package/dist/v3/chunks/{StartEndPoint.css.8242788c.js → StartEndPoint.css.9e64a1ee.js} +1 -1
- package/dist/{v2/css/StartEndPoint-d7806e8e.css → v3/css/StartEndPoint-73c01544.css} +2 -1
- package/dist/{v2/css/TaxiCar-9155f78f.css → v3/css/TaxiCar-37baac68.css} +2 -1
- package/dist/v3/hooks/useMapCoordinatify.js +5 -2
- package/dist/v3/hooks/useMapGCJ02.d.ts +3 -0
- package/dist/v3/hooks/useMapGCJ02.js +31 -2
- package/dist/v3/utils/log.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./v2"
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./v2"
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { reactive } from "vue-demi";
|
|
2
2
|
import { apiGetCenterPlaceFromCache } from "../../api/browser.js";
|
|
3
3
|
import { apiMemoryShouldSkipByKey } from "../../api/memory.js";
|
|
4
|
+
import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
|
|
4
5
|
import { maybeFunctionToFunction, lnglat2point } from "../../utils/transform.js";
|
|
5
6
|
const IS_FIRST_LOAD_KEY = "IS_FIRST_LOAD_KEY";
|
|
6
7
|
const useCacheCenterPlace = (props) => {
|
|
7
8
|
const { geoLoadingTitle, emptyTitle } = props;
|
|
8
9
|
const isFirstLoad = !apiMemoryShouldSkipByKey(IS_FIRST_LOAD_KEY);
|
|
9
10
|
const getDefaultCenterPlace = maybeFunctionToFunction(props.defaultCenterPlace);
|
|
11
|
+
const { unCoordinatifyPlace } = useMapCoordinatify();
|
|
12
|
+
const inputDefaultCenterPlace = getDefaultCenterPlace == null ? void 0 : getDefaultCenterPlace(apiGetCenterPlaceFromCache());
|
|
10
13
|
const defaultCenterPlace = {
|
|
11
14
|
lng: 0,
|
|
12
15
|
lat: 0,
|
|
13
16
|
name: emptyTitle,
|
|
14
17
|
displayName: emptyTitle,
|
|
15
|
-
...
|
|
18
|
+
...inputDefaultCenterPlace ? unCoordinatifyPlace(inputDefaultCenterPlace) : void 0
|
|
16
19
|
};
|
|
17
20
|
const geoDefaultPosition = defaultCenterPlace ? lnglat2point(defaultCenterPlace) : [0, 0];
|
|
18
21
|
const centerPlace = reactive({
|
|
@@ -10,7 +10,7 @@ import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
|
10
10
|
import { defineSetup } from "../../types/helper.js";
|
|
11
11
|
import { createDom } from "../../utils/dom.js";
|
|
12
12
|
import { decodeAsterisk, vec2lnglat } from "../../utils/transform.js";
|
|
13
|
-
import { p as pointInfoBoxEmphasize, a as pointIcon, b as pointLayout, c as pointSingleInfoBox, d as pointInfoBoxTitle, t as textLayout, e as arrowRight, f as pointInfoBox, g as pointInfoBoxDescription } from "../../chunks/StartEndPoint.css.
|
|
13
|
+
import { p as pointInfoBoxEmphasize, a as pointIcon, b as pointLayout, c as pointSingleInfoBox, d as pointInfoBoxTitle, t as textLayout, e as arrowRight, f as pointInfoBox, g as pointInfoBoxDescription } from "../../chunks/StartEndPoint.css.9e64a1ee.js";
|
|
14
14
|
const imgEndPoint = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSI3Mi4zMzklIiB5MT0iNTAlIiB4Mj0iMCUiIHkyPSI1MCUiIGlkPSJwcmVmaXhfX2EiPjxzdG9wIHN0b3AtY29sb3I9IiNGRjg0NDciIG9mZnNldD0iMCUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkY4QjRBIiBvZmZzZXQ9IjUwLjU5NiUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkZBOTVBIiBvZmZzZXQ9IjEwMCUiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xMiAzMC4yMTVjMi4xMzQgMCAzLjg2My0uODkzIDMuODYzLTEuOTk1IDAtMS4xLTEuNzMtMS45OTQtMy44NjMtMS45OTQtMi4xMzQgMC0zLjg2My44OTMtMy44NjMgMS45OTQgMCAxLjEwMiAxLjczIDEuOTk1IDMuODYzIDEuOTk1eiIgZmlsbC1vcGFjaXR5PSIuNSIgZmlsbD0iIzQzNDg1QSIvPjxwYXRoIGQ9Ik0xMSA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DAtMS4wMDctMS41ODEtMS44MjMtMy41MzItMS44MjMtMS45NSAwLTMuNTMyLjgxNi0zLjUzMiAxLjgyMyAwIDEuMDA3IDEuNTgxIDEuODIzIDMuNTMyIDEuODIzeiIgZmlsbC1vcGFjaXR5PSIuNSIgZmlsbD0iIzQzNDg1QSIvPjxwYXRoIGQ9Ik0xMSAyN2MyLjEyOCAwLS45LTMuNzQyIDUuNjIxLTYuNjQxIDMuMjIxLTEuOTEgNS4zNzktNS40MSA1LjM3OS05LjQxMkMyMiA0LjkwMSAxNy4wNzUgMCAxMSAwUzAgNC45MDEgMCAxMC45NDdjMCAzLjkxOCAyLjA2OCA3LjM1NSA1LjE3NyA5LjI5QzExLjc1IDIzLjI3NyA5LjA2IDI3IDExIDI3eiIgc3Ryb2tlPSIjRkZGIiBmaWxsPSJ1cmwoI3ByZWZpeF9fYSkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMS4yMTUpIi8+PHRleHQgZm9udC1mYW1pbHk9IlBpbmdGYW5nU0MtU2VtaWJvbGQsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIiBmaWxsPSIjRkZGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEuMjE1KSI+PHRzcGFuIHg9IjUiIHk9IjE1LjYyNCI+6LW3PC90c3Bhbj48L3RleHQ+PC9nPjwvc3ZnPg==";
|
|
16
16
|
const AStartEndPoint = defineSetup("AStartEndPoint", function(props, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../css/TaxiCar-
|
|
1
|
+
import "../../css/TaxiCar-37baac68.css";
|
|
2
2
|
import { h } from "vue";
|
|
3
3
|
import { computed } from "vue-demi";
|
|
4
4
|
import { ICON_TAXI_CAR_URL } from "../../api/cdn.js";
|
|
@@ -10,7 +10,7 @@ import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
|
10
10
|
import { defineSetup } from "../../types/helper.js";
|
|
11
11
|
import { createDom } from "../../utils/dom.js";
|
|
12
12
|
import { decodeAsterisk, vec2lnglat } from "../../utils/transform.js";
|
|
13
|
-
import { p as pointInfoBoxEmphasize, b as pointLayout, c as pointSingleInfoBox } from "../../chunks/StartEndPoint.css.
|
|
13
|
+
import { p as pointInfoBoxEmphasize, b as pointLayout, c as pointSingleInfoBox } from "../../chunks/StartEndPoint.css.9e64a1ee.js";
|
|
14
14
|
import { c as createRuntimeFn } from "../../chunks/vanilla-extract-recipes-createRuntimeFn.esm.bd6fc290.js";
|
|
15
15
|
const TaxiCar_css_ts_vanilla = "";
|
|
16
16
|
var carIcon = "_65j3sr1";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../css/StartEndPoint-
|
|
1
|
+
import "../css/StartEndPoint-73c01544.css";
|
|
2
2
|
import { c as createRuntimeFn } from "./vanilla-extract-recipes-createRuntimeFn.esm.bd6fc290.js";
|
|
3
3
|
const StartEndPoint_css_ts_vanilla = "";
|
|
4
4
|
var arrowRight = createRuntimeFn({ defaultClassName: "_4a4ovka", variantClassNames: { withArrow: { true: "_4a4ovkb", false: "_4a4ovkc" } }, defaultVariants: {}, compoundVariants: [] });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMapGCJ02 } from "./useMapGCJ02.js";
|
|
2
|
+
import { inChina } from "./useMapInChina.js";
|
|
2
3
|
function useMapCoordinatify() {
|
|
3
|
-
const { toCoordinateType, toLocalGcj02 } = useMapGCJ02();
|
|
4
|
+
const { toCoordinateType, toLocalGcj02, toLocalWgs84 } = useMapGCJ02();
|
|
4
5
|
const coordinatifyPoint = (value) => {
|
|
5
6
|
const [lng, lat] = value;
|
|
6
7
|
return { lng, lat, type: toCoordinateType(value) };
|
|
@@ -11,7 +12,9 @@ function useMapCoordinatify() {
|
|
|
11
12
|
if (type === inputType)
|
|
12
13
|
return [lng, lat];
|
|
13
14
|
if (type === "wgs84") {
|
|
14
|
-
|
|
15
|
+
if (!inChina([lng, lat]))
|
|
16
|
+
throw new Error(`国外经纬度收到火星坐标系数据: ${JSON.stringify(value)}`);
|
|
17
|
+
return toLocalWgs84([lng, lat]);
|
|
15
18
|
}
|
|
16
19
|
return toLocalGcj02([lng, lat]);
|
|
17
20
|
};
|
|
@@ -5,6 +5,7 @@ export declare const useAmapGCJ02: () => {
|
|
|
5
5
|
toGcj02Points: (points: Point[]) => Promise<Point[]>;
|
|
6
6
|
toLocalGcj02: (point: Point) => Point;
|
|
7
7
|
toLocalGcj02Points: (points: Point[]) => Point[];
|
|
8
|
+
toLocalWgs84: (point: Point) => Point;
|
|
8
9
|
};
|
|
9
10
|
export declare const useGmapGCJ02: () => {
|
|
10
11
|
toCoordinateType: (p: Point) => CoordinateType;
|
|
@@ -12,6 +13,7 @@ export declare const useGmapGCJ02: () => {
|
|
|
12
13
|
toGcj02Points: (points: Point[]) => Promise<Point[]>;
|
|
13
14
|
toLocalGcj02: (point: Point) => Point;
|
|
14
15
|
toLocalGcj02Points: (points: Point[]) => Point[];
|
|
16
|
+
toLocalWgs84: (point: Point) => Point;
|
|
15
17
|
};
|
|
16
18
|
export declare const useMapGCJ02: () => {
|
|
17
19
|
toCoordinateType: (p: Point) => CoordinateType;
|
|
@@ -19,4 +21,5 @@ export declare const useMapGCJ02: () => {
|
|
|
19
21
|
toGcj02Points: (points: Point[]) => Promise<Point[]>;
|
|
20
22
|
toLocalGcj02: (point: Point) => Point;
|
|
21
23
|
toLocalGcj02Points: (points: Point[]) => Point[];
|
|
24
|
+
toLocalWgs84: (point: Point) => Point;
|
|
22
25
|
};
|
|
@@ -528,13 +528,23 @@ const useAmapGCJ02 = () => {
|
|
|
528
528
|
}
|
|
529
529
|
};
|
|
530
530
|
const toLocalGcj02Points = (points) => points.map(toLocalGcj02);
|
|
531
|
+
const toLocalWgs84 = (point) => {
|
|
532
|
+
throw new Error(`高德地图为什么要转 wgs84: ${JSON.stringify(point)}`);
|
|
533
|
+
};
|
|
531
534
|
const toGcj02Points = async (points) => {
|
|
532
535
|
return toLocalGcj02Points(points);
|
|
533
536
|
};
|
|
534
537
|
function toGcj02(point) {
|
|
535
538
|
return toGcj02Points([point]).then(([result]) => result);
|
|
536
539
|
}
|
|
537
|
-
return {
|
|
540
|
+
return {
|
|
541
|
+
toCoordinateType,
|
|
542
|
+
toGcj02,
|
|
543
|
+
toGcj02Points,
|
|
544
|
+
toLocalGcj02,
|
|
545
|
+
toLocalGcj02Points,
|
|
546
|
+
toLocalWgs84
|
|
547
|
+
};
|
|
538
548
|
};
|
|
539
549
|
const useGmapGCJ02 = () => {
|
|
540
550
|
const toCoordinateType = (p) => {
|
|
@@ -553,13 +563,32 @@ const useGmapGCJ02 = () => {
|
|
|
553
563
|
}
|
|
554
564
|
};
|
|
555
565
|
const toLocalGcj02Points = (points) => points.map(toLocalGcj02);
|
|
566
|
+
const toLocalWgs84 = (point) => {
|
|
567
|
+
try {
|
|
568
|
+
if (inChina(point) && !inHongkong(point) && !inMacau(point))
|
|
569
|
+
return point;
|
|
570
|
+
return exported.transform(point, exported.GCJ02, exported.WGS1984);
|
|
571
|
+
} catch (err) {
|
|
572
|
+
const error = err;
|
|
573
|
+
console.error(`本地转换WGS84失败: ${error.message}
|
|
574
|
+
${error.stack}`);
|
|
575
|
+
return point;
|
|
576
|
+
}
|
|
577
|
+
};
|
|
556
578
|
const toGcj02 = async (point) => {
|
|
557
579
|
return toLocalGcj02Points([point])[0];
|
|
558
580
|
};
|
|
559
581
|
const toGcj02Points = async (points) => {
|
|
560
582
|
return toLocalGcj02Points(points);
|
|
561
583
|
};
|
|
562
|
-
return {
|
|
584
|
+
return {
|
|
585
|
+
toCoordinateType,
|
|
586
|
+
toGcj02,
|
|
587
|
+
toGcj02Points,
|
|
588
|
+
toLocalGcj02,
|
|
589
|
+
toLocalGcj02Points,
|
|
590
|
+
toLocalWgs84
|
|
591
|
+
};
|
|
563
592
|
};
|
|
564
593
|
const useMapGCJ02 = () => {
|
|
565
594
|
const { supplier } = useMapSupplier();
|
package/dist/v2/utils/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const availableLogKeys = /* @__PURE__ */ new Set();
|
|
2
2
|
const pkgName = "@heycar/heycars-map";
|
|
3
|
-
const pkgVersion = "2.
|
|
3
|
+
const pkgVersion = "2.4.1";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { reactive } from "vue-demi";
|
|
2
2
|
import { apiGetCenterPlaceFromCache } from "../../api/browser.js";
|
|
3
3
|
import { apiMemoryShouldSkipByKey } from "../../api/memory.js";
|
|
4
|
+
import { useMapCoordinatify } from "../../hooks/useMapCoordinatify.js";
|
|
4
5
|
import { maybeFunctionToFunction, lnglat2point } from "../../utils/transform.js";
|
|
5
6
|
const IS_FIRST_LOAD_KEY = "IS_FIRST_LOAD_KEY";
|
|
6
7
|
const useCacheCenterPlace = (props) => {
|
|
7
8
|
const { geoLoadingTitle, emptyTitle } = props;
|
|
8
9
|
const isFirstLoad = !apiMemoryShouldSkipByKey(IS_FIRST_LOAD_KEY);
|
|
9
10
|
const getDefaultCenterPlace = maybeFunctionToFunction(props.defaultCenterPlace);
|
|
11
|
+
const { unCoordinatifyPlace } = useMapCoordinatify();
|
|
12
|
+
const inputDefaultCenterPlace = getDefaultCenterPlace == null ? void 0 : getDefaultCenterPlace(apiGetCenterPlaceFromCache());
|
|
10
13
|
const defaultCenterPlace = {
|
|
11
14
|
lng: 0,
|
|
12
15
|
lat: 0,
|
|
13
16
|
name: emptyTitle,
|
|
14
17
|
displayName: emptyTitle,
|
|
15
|
-
...
|
|
18
|
+
...inputDefaultCenterPlace ? unCoordinatifyPlace(inputDefaultCenterPlace) : void 0
|
|
16
19
|
};
|
|
17
20
|
const geoDefaultPosition = defaultCenterPlace ? lnglat2point(defaultCenterPlace) : [0, 0];
|
|
18
21
|
const centerPlace = reactive({
|
|
@@ -10,7 +10,7 @@ import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
|
10
10
|
import { defineSetup } from "../../types/helper.js";
|
|
11
11
|
import { createDom } from "../../utils/dom.js";
|
|
12
12
|
import { decodeAsterisk, vec2lnglat } from "../../utils/transform.js";
|
|
13
|
-
import { p as pointInfoBoxEmphasize, a as pointIcon, b as pointLayout, c as pointSingleInfoBox, d as pointInfoBoxTitle, t as textLayout, e as arrowRight, f as pointInfoBox, g as pointInfoBoxDescription } from "../../chunks/StartEndPoint.css.
|
|
13
|
+
import { p as pointInfoBoxEmphasize, a as pointIcon, b as pointLayout, c as pointSingleInfoBox, d as pointInfoBoxTitle, t as textLayout, e as arrowRight, f as pointInfoBox, g as pointInfoBoxDescription } from "../../chunks/StartEndPoint.css.9e64a1ee.js";
|
|
14
14
|
const imgEndPoint = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PGxpbmVhckdyYWRpZW50IHgxPSI3Mi4zMzklIiB5MT0iNTAlIiB4Mj0iMCUiIHkyPSI1MCUiIGlkPSJwcmVmaXhfX2EiPjxzdG9wIHN0b3AtY29sb3I9IiNGRjg0NDciIG9mZnNldD0iMCUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkY4QjRBIiBvZmZzZXQ9IjUwLjU5NiUiLz48c3RvcCBzdG9wLWNvbG9yPSIjRkZBOTVBIiBvZmZzZXQ9IjEwMCUiLz48L2xpbmVhckdyYWRpZW50PjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxwYXRoIGQ9Ik0xMiAzMC4yMTVjMi4xMzQgMCAzLjg2My0uODkzIDMuODYzLTEuOTk1IDAtMS4xLTEuNzMtMS45OTQtMy44NjMtMS45OTQtMi4xMzQgMC0zLjg2My44OTMtMy44NjMgMS45OTQgMCAxLjEwMiAxLjczIDEuOTk1ID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1ydWxlPSJldmVub2RkIj48cGF0aCBkPSJNMTIgMzAuMjE1YzEuOTUgMCAzLjUzMi0uODE2IDMuNTMyLTEuODIzIDAtMS4wMDctMS41ODEtMS44MjMtMy41MzItMS44MjMtMS45NSAwLTMuNTMyLjgxNi0zLjUzMiAxLjgyMyAwIDEuMDA3IDEuNTgxIDEuODIzIDMuNTMyIDEuODIzeiIgZmlsbC1vcGFjaXR5PSIuNSIgZmlsbD0iIzQzNDg1QSIvPjxwYXRoIGQ9Ik0xMSAyN2MyLjEyOCAwLS45LTMuNzQyIDUuNjIxLTYuNjQxIDMuMjIxLTEuOTEgNS4zNzktNS40MSA1LjM3OS05LjQxMkMyMiA0LjkwMSAxNy4wNzUgMCAxMSAwUzAgNC45MDEgMCAxMC45NDdjMCAzLjkxOCAyLjA2OCA3LjM1NSA1LjE3NyA5LjI5QzExLjc1IDIzLjI3NyA5LjA2IDI3IDExIDI3eiIgc3Ryb2tlPSIjRkZGIiBmaWxsPSJ1cmwoI3ByZWZpeF9fYSkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEgMS4yMTUpIi8+PHRleHQgZm9udC1mYW1pbHk9IlBpbmdGYW5nU0MtU2VtaWJvbGQsIFBpbmdGYW5nIFNDIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIiBmaWxsPSIjRkZGIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxIDEuMjE1KSI+PHRzcGFuIHg9IjUiIHk9IjE1LjYyNCI+6LW3PC90c3Bhbj48L3RleHQ+PC9nPjwvc3ZnPg==";
|
|
16
16
|
const AStartEndPoint = defineSetup("AStartEndPoint", function(props, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../css/TaxiCar-
|
|
1
|
+
import "../../css/TaxiCar-37baac68.css";
|
|
2
2
|
import { createVNode } from "vue";
|
|
3
3
|
import { computed } from "vue-demi";
|
|
4
4
|
import { ICON_TAXI_CAR_URL } from "../../api/cdn.js";
|
|
@@ -10,7 +10,7 @@ import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
|
10
10
|
import { defineSetup } from "../../types/helper.js";
|
|
11
11
|
import { createDom } from "../../utils/dom.js";
|
|
12
12
|
import { decodeAsterisk, vec2lnglat } from "../../utils/transform.js";
|
|
13
|
-
import { p as pointInfoBoxEmphasize, b as pointLayout, c as pointSingleInfoBox } from "../../chunks/StartEndPoint.css.
|
|
13
|
+
import { p as pointInfoBoxEmphasize, b as pointLayout, c as pointSingleInfoBox } from "../../chunks/StartEndPoint.css.9e64a1ee.js";
|
|
14
14
|
import { c as createRuntimeFn } from "../../chunks/vanilla-extract-recipes-createRuntimeFn.esm.bd6fc290.js";
|
|
15
15
|
const TaxiCar_css_ts_vanilla = "";
|
|
16
16
|
var carIcon = "_65j3sr1";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../css/StartEndPoint-
|
|
1
|
+
import "../css/StartEndPoint-73c01544.css";
|
|
2
2
|
import { c as createRuntimeFn } from "./vanilla-extract-recipes-createRuntimeFn.esm.bd6fc290.js";
|
|
3
3
|
const StartEndPoint_css_ts_vanilla = "";
|
|
4
4
|
var arrowRight = createRuntimeFn({ defaultClassName: "_4a4ovka", variantClassNames: { withArrow: { true: "_4a4ovkb", false: "_4a4ovkc" } }, defaultVariants: {}, compoundVariants: [] });
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMapGCJ02 } from "./useMapGCJ02.js";
|
|
2
|
+
import { inChina } from "./useMapInChina.js";
|
|
2
3
|
function useMapCoordinatify() {
|
|
3
|
-
const { toCoordinateType, toLocalGcj02 } = useMapGCJ02();
|
|
4
|
+
const { toCoordinateType, toLocalGcj02, toLocalWgs84 } = useMapGCJ02();
|
|
4
5
|
const coordinatifyPoint = (value) => {
|
|
5
6
|
const [lng, lat] = value;
|
|
6
7
|
return { lng, lat, type: toCoordinateType(value) };
|
|
@@ -11,7 +12,9 @@ function useMapCoordinatify() {
|
|
|
11
12
|
if (type === inputType)
|
|
12
13
|
return [lng, lat];
|
|
13
14
|
if (type === "wgs84") {
|
|
14
|
-
|
|
15
|
+
if (!inChina([lng, lat]))
|
|
16
|
+
throw new Error(`国外经纬度收到火星坐标系数据: ${JSON.stringify(value)}`);
|
|
17
|
+
return toLocalWgs84([lng, lat]);
|
|
15
18
|
}
|
|
16
19
|
return toLocalGcj02([lng, lat]);
|
|
17
20
|
};
|
|
@@ -5,6 +5,7 @@ export declare const useAmapGCJ02: () => {
|
|
|
5
5
|
toGcj02Points: (points: Point[]) => Promise<Point[]>;
|
|
6
6
|
toLocalGcj02: (point: Point) => Point;
|
|
7
7
|
toLocalGcj02Points: (points: Point[]) => Point[];
|
|
8
|
+
toLocalWgs84: (point: Point) => Point;
|
|
8
9
|
};
|
|
9
10
|
export declare const useGmapGCJ02: () => {
|
|
10
11
|
toCoordinateType: (p: Point) => CoordinateType;
|
|
@@ -12,6 +13,7 @@ export declare const useGmapGCJ02: () => {
|
|
|
12
13
|
toGcj02Points: (points: Point[]) => Promise<Point[]>;
|
|
13
14
|
toLocalGcj02: (point: Point) => Point;
|
|
14
15
|
toLocalGcj02Points: (points: Point[]) => Point[];
|
|
16
|
+
toLocalWgs84: (point: Point) => Point;
|
|
15
17
|
};
|
|
16
18
|
export declare const useMapGCJ02: () => {
|
|
17
19
|
toCoordinateType: (p: Point) => CoordinateType;
|
|
@@ -19,4 +21,5 @@ export declare const useMapGCJ02: () => {
|
|
|
19
21
|
toGcj02Points: (points: Point[]) => Promise<Point[]>;
|
|
20
22
|
toLocalGcj02: (point: Point) => Point;
|
|
21
23
|
toLocalGcj02Points: (points: Point[]) => Point[];
|
|
24
|
+
toLocalWgs84: (point: Point) => Point;
|
|
22
25
|
};
|
|
@@ -528,13 +528,23 @@ const useAmapGCJ02 = () => {
|
|
|
528
528
|
}
|
|
529
529
|
};
|
|
530
530
|
const toLocalGcj02Points = (points) => points.map(toLocalGcj02);
|
|
531
|
+
const toLocalWgs84 = (point) => {
|
|
532
|
+
throw new Error(`高德地图为什么要转 wgs84: ${JSON.stringify(point)}`);
|
|
533
|
+
};
|
|
531
534
|
const toGcj02Points = async (points) => {
|
|
532
535
|
return toLocalGcj02Points(points);
|
|
533
536
|
};
|
|
534
537
|
function toGcj02(point) {
|
|
535
538
|
return toGcj02Points([point]).then(([result]) => result);
|
|
536
539
|
}
|
|
537
|
-
return {
|
|
540
|
+
return {
|
|
541
|
+
toCoordinateType,
|
|
542
|
+
toGcj02,
|
|
543
|
+
toGcj02Points,
|
|
544
|
+
toLocalGcj02,
|
|
545
|
+
toLocalGcj02Points,
|
|
546
|
+
toLocalWgs84
|
|
547
|
+
};
|
|
538
548
|
};
|
|
539
549
|
const useGmapGCJ02 = () => {
|
|
540
550
|
const toCoordinateType = (p) => {
|
|
@@ -553,13 +563,32 @@ const useGmapGCJ02 = () => {
|
|
|
553
563
|
}
|
|
554
564
|
};
|
|
555
565
|
const toLocalGcj02Points = (points) => points.map(toLocalGcj02);
|
|
566
|
+
const toLocalWgs84 = (point) => {
|
|
567
|
+
try {
|
|
568
|
+
if (inChina(point) && !inHongkong(point) && !inMacau(point))
|
|
569
|
+
return point;
|
|
570
|
+
return exported.transform(point, exported.GCJ02, exported.WGS1984);
|
|
571
|
+
} catch (err) {
|
|
572
|
+
const error = err;
|
|
573
|
+
console.error(`本地转换WGS84失败: ${error.message}
|
|
574
|
+
${error.stack}`);
|
|
575
|
+
return point;
|
|
576
|
+
}
|
|
577
|
+
};
|
|
556
578
|
const toGcj02 = async (point) => {
|
|
557
579
|
return toLocalGcj02Points([point])[0];
|
|
558
580
|
};
|
|
559
581
|
const toGcj02Points = async (points) => {
|
|
560
582
|
return toLocalGcj02Points(points);
|
|
561
583
|
};
|
|
562
|
-
return {
|
|
584
|
+
return {
|
|
585
|
+
toCoordinateType,
|
|
586
|
+
toGcj02,
|
|
587
|
+
toGcj02Points,
|
|
588
|
+
toLocalGcj02,
|
|
589
|
+
toLocalGcj02Points,
|
|
590
|
+
toLocalWgs84
|
|
591
|
+
};
|
|
563
592
|
};
|
|
564
593
|
const useMapGCJ02 = () => {
|
|
565
594
|
const { supplier } = useMapSupplier();
|
package/dist/v3/utils/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const availableLogKeys = /* @__PURE__ */ new Set();
|
|
2
2
|
const pkgName = "@heycar/heycars-map";
|
|
3
|
-
const pkgVersion = "2.
|
|
3
|
+
const pkgVersion = "2.4.1";
|
|
4
4
|
const isEnableLog = (name) => {
|
|
5
5
|
const searchParam = new URLSearchParams(location.search);
|
|
6
6
|
return searchParam.has(`log-${name}`);
|