@heycar/heycars-map 2.16.0-downgrade4 → 2.16.0-downgrade5
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/v2/App.js +4 -3
- package/dist/v2/components/MapProvider/MapProvider.d.ts +1 -1
- package/dist/v2/components/MapProvider/MapProvider.js +1 -1
- package/dist/v2/hooks/useMapPlace.js +10 -1
- package/dist/v2/hooks/useMapSupplier.d.ts +1 -0
- package/dist/v2/utils/compatibleWatchPosition.js +1 -0
- package/dist/v2/utils/log.js +1 -1
- package/dist/v2/utils/typeChecking.js +1 -0
- package/dist/v3/App.js +4 -3
- package/dist/v3/components/MapProvider/MapProvider.d.ts +2 -1
- package/dist/v3/components/MapProvider/MapProvider.js +1 -1
- package/dist/v3/hooks/useMapPlace.js +10 -1
- package/dist/v3/hooks/useMapSupplier.d.ts +1 -0
- package/dist/v3/utils/compatibleWatchPosition.js +1 -0
- package/dist/v3/utils/log.js +1 -1
- package/dist/v3/utils/typeChecking.js +1 -0
- package/package.json +1 -1
package/dist/v2/App.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
2
|
import { defineComponent, ref } from "vue-demi";
|
|
3
3
|
import { MapProvider } from "./components/MapProvider/MapProvider.js";
|
|
4
|
-
import {
|
|
4
|
+
import { DemoBusinessRecomendPlace } from "./Demo/DemoBusinessRecomendPlace.js";
|
|
5
5
|
const gmapApiKey = {}.VITE_GMAP_API_KEY;
|
|
6
6
|
const gmapId = {}.VITE_GMAP_MAP_ID;
|
|
7
7
|
const amapApiKey = {}.VITE_AMAP_API_KEY;
|
|
@@ -42,14 +42,15 @@ const App = defineComponent({
|
|
|
42
42
|
// ZONE_FORBIDDEN_BORDER_COLOR: "#F41717",
|
|
43
43
|
},
|
|
44
44
|
"renderLoadFailedTitle": () => supplierRef.value === "gmap" ? "未能成功访问谷歌地图" : "高德地图加载失败",
|
|
45
|
-
"renderLoadFailedDescription": () => supplierRef.value === "gmap" ? "请确认您的网络能正常访问谷歌地图, \n或切回高德地图" : void 0
|
|
45
|
+
"renderLoadFailedDescription": () => supplierRef.value === "gmap" ? "请确认您的网络能正常访问谷歌地图, \n或切回高德地图" : void 0,
|
|
46
|
+
"reportLog": () => console.log("reportLog function is called")
|
|
46
47
|
},
|
|
47
48
|
"on": {
|
|
48
49
|
"success": () => console.log(`${supplierRef.value} load success`),
|
|
49
50
|
"fail": () => console.log(`${supplierRef.value} load failed`),
|
|
50
51
|
"downloadOptimizeEnd": () => console.log(`${supplierRef.value} load download optimize end`)
|
|
51
52
|
}
|
|
52
|
-
}, [h(
|
|
53
|
+
}, [h(DemoBusinessRecomendPlace)]);
|
|
53
54
|
}
|
|
54
55
|
});
|
|
55
56
|
export {
|
|
@@ -5,7 +5,7 @@ import { type GmapLoaderProps, type UseMapLoaderProps } from "../../hooks/useMap
|
|
|
5
5
|
import { type MapSupplierPayolad } from "../../hooks/useMapSupplier";
|
|
6
6
|
import type { AmapMap } from "../../types/interface";
|
|
7
7
|
import { type AmapProps } from "../Amap";
|
|
8
|
-
export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "gaodeDirectionDrivingProxyUrl" | "gaodeDirectionWalkingProxyUrl" | "googleDirectionsProxyUrl" | "googleRoutesProxyUrl" | "googleSnapRoadProxyUrl" | "themeVariables" | "renderLoadFailedTitle" | "renderLoadFailedDescription" | "hkGovernRegeoProxyUrl">;
|
|
8
|
+
export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "gaodeDirectionDrivingProxyUrl" | "gaodeDirectionWalkingProxyUrl" | "googleDirectionsProxyUrl" | "googleRoutesProxyUrl" | "googleSnapRoadProxyUrl" | "themeVariables" | "renderLoadFailedTitle" | "renderLoadFailedDescription" | "reportLog" | "hkGovernRegeoProxyUrl">;
|
|
9
9
|
export declare const MapProvider: import("vue-demi").DefineComponent<import("vue3").ComponentObjectPropsOptions<MapProviderProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<MapProviderProps, Required<MapProviderProps>>, "success" | "fail" | "downloadOptimizeEnd", MapProviderProps>;
|
|
10
10
|
export interface HeycarMapProps extends Pick<GmapLoaderProps, "fallback" | "loading">, Pick<AmapProps, "center" | "zoom"> {
|
|
11
11
|
mapRef?: SetMap<AmapMap> | SetMap<google.maps.Map>;
|
|
@@ -50,7 +50,7 @@ const MapProvider = defineLagecySetup("MapProvider", function(props, {
|
|
|
50
50
|
var _a;
|
|
51
51
|
return h("div", [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
52
52
|
};
|
|
53
|
-
}).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleRoutesProxyUrl", "googleSnapRoadProxyUrl", "themeVariables", "renderLoadFailedTitle", "renderLoadFailedDescription", "hkGovernRegeoProxyUrl"]);
|
|
53
|
+
}).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleRoutesProxyUrl", "googleSnapRoadProxyUrl", "themeVariables", "renderLoadFailedTitle", "renderLoadFailedDescription", "reportLog", "hkGovernRegeoProxyUrl"]);
|
|
54
54
|
const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
55
55
|
slots,
|
|
56
56
|
emit,
|
|
@@ -128,7 +128,7 @@ const useGmapPlace = (props) => {
|
|
|
128
128
|
const { signal: inputSignal, onChange, emptyPlaceName } = props;
|
|
129
129
|
const defaultPoint = [...props.pointRef.value];
|
|
130
130
|
const pointRef = ref(defaultPoint);
|
|
131
|
-
const { readyPromise, language } = useMapSupplier();
|
|
131
|
+
const { readyPromise, language, reportLog } = useMapSupplier();
|
|
132
132
|
const { idx: placeKey, update } = useUpdate();
|
|
133
133
|
const place = reactive({
|
|
134
134
|
lng: pointRef.value[0],
|
|
@@ -159,6 +159,15 @@ const useGmapPlace = (props) => {
|
|
|
159
159
|
readyPromise.then(() => {
|
|
160
160
|
const geocoder = new google.maps.Geocoder();
|
|
161
161
|
const pipeTw = createPipeTw(language === "zh-TW");
|
|
162
|
+
reportLog == null ? void 0 : reportLog({
|
|
163
|
+
operation: "google_regeo",
|
|
164
|
+
eventType: "ServiceLogic",
|
|
165
|
+
message: {
|
|
166
|
+
lng,
|
|
167
|
+
lat,
|
|
168
|
+
language
|
|
169
|
+
}
|
|
170
|
+
});
|
|
162
171
|
geocoder.geocode({ language, location: { lng, lat } }).finally(() => clearTimeout(timer)).then(({ results }) => {
|
|
163
172
|
const name = results[0].formatted_address ? results[0].formatted_address : emptyPlaceName;
|
|
164
173
|
const displayName = gmapPlaceName2DisplayName(name, results[0].address_components);
|
|
@@ -16,6 +16,7 @@ export interface MapSupplierPayolad extends UseMapLoaderProps {
|
|
|
16
16
|
themeVariables?: MapThemeVariables;
|
|
17
17
|
renderLoadFailedTitle?: (status: Status) => string | undefined;
|
|
18
18
|
renderLoadFailedDescription?: (status: Status) => string | undefined;
|
|
19
|
+
reportLog?: (data: any) => void;
|
|
19
20
|
}
|
|
20
21
|
export declare const useMapSupplier: () => MapSupplierPayolad;
|
|
21
22
|
export declare const provideMapSupplier: (payload: MapSupplierPayolad) => void;
|
|
@@ -219,6 +219,7 @@ function androidWatchPosition(onSuccess, onError, option, getLocationFn) {
|
|
|
219
219
|
if (isHandled)
|
|
220
220
|
return;
|
|
221
221
|
isHandled = true;
|
|
222
|
+
console.log("==GeoLocation assert==", geoLocationPosition, typeof HEYCAR_GEOLOCATION_GET_CURRENT_POSITION === "function");
|
|
222
223
|
geoErrorMessage = void 0;
|
|
223
224
|
resolve(geoLocationPosition);
|
|
224
225
|
},
|
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.16.0-
|
|
3
|
+
const pkgVersion = "2.16.0-downgrade5";
|
|
4
4
|
const spaceLogSessionKey = "wiajlf;jwiatitruiq3jrlw";
|
|
5
5
|
const enableSessionLogKey = (key) => {
|
|
6
6
|
const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
|
|
@@ -150,6 +150,7 @@ function toGeolocationGetCurrentPosition(fn, fnName = fn.name) {
|
|
|
150
150
|
});
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
|
+
console.log("==外部注入 geoPosition==", position);
|
|
153
154
|
onSuccess(position);
|
|
154
155
|
};
|
|
155
156
|
const asseertedOnError = (error) => onError(toGeolocationPositionError(error, prefix));
|
package/dist/v3/App.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createVNode } from "vue";
|
|
2
2
|
import { defineComponent, ref } from "vue-demi";
|
|
3
3
|
import { MapProvider } from "./components/MapProvider/MapProvider.js";
|
|
4
|
-
import {
|
|
4
|
+
import { DemoBusinessRecomendPlace } from "./Demo/DemoBusinessRecomendPlace.js";
|
|
5
5
|
const gmapApiKey = {}.VITE_GMAP_API_KEY;
|
|
6
6
|
const gmapId = {}.VITE_GMAP_MAP_ID;
|
|
7
7
|
const amapApiKey = {}.VITE_AMAP_API_KEY;
|
|
@@ -44,9 +44,10 @@ const App = /* @__PURE__ */ defineComponent({
|
|
|
44
44
|
"renderLoadFailedDescription": () => supplierRef.value === "gmap" ? "请确认您的网络能正常访问谷歌地图, \n或切回高德地图" : void 0,
|
|
45
45
|
"onSuccess": () => console.log(`${supplierRef.value} load success`),
|
|
46
46
|
"onFail": () => console.log(`${supplierRef.value} load failed`),
|
|
47
|
-
"onDownloadOptimizeEnd": () => console.log(`${supplierRef.value} load download optimize end`)
|
|
47
|
+
"onDownloadOptimizeEnd": () => console.log(`${supplierRef.value} load download optimize end`),
|
|
48
|
+
"reportLog": () => console.log("reportLog function is called")
|
|
48
49
|
}, {
|
|
49
|
-
default: () => [createVNode(
|
|
50
|
+
default: () => [createVNode(DemoBusinessRecomendPlace, null, null)]
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
53
|
});
|
|
@@ -5,10 +5,11 @@ import { Status, type GmapLoaderProps, type UseMapLoaderProps } from "../../hook
|
|
|
5
5
|
import { type MapSupplierPayolad } from "../../hooks/useMapSupplier";
|
|
6
6
|
import type { AmapMap } from "../../types/interface";
|
|
7
7
|
import { type AmapProps } from "../Amap";
|
|
8
|
-
export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "gaodeDirectionDrivingProxyUrl" | "gaodeDirectionWalkingProxyUrl" | "googleDirectionsProxyUrl" | "googleRoutesProxyUrl" | "googleSnapRoadProxyUrl" | "themeVariables" | "renderLoadFailedTitle" | "renderLoadFailedDescription" | "hkGovernRegeoProxyUrl">;
|
|
8
|
+
export type MapProviderProps = UseMapLoaderProps & Pick<MapSupplierPayolad, "gmapId" | "gmapRasterId" | "gaodeDirectionDrivingProxyUrl" | "gaodeDirectionWalkingProxyUrl" | "googleDirectionsProxyUrl" | "googleRoutesProxyUrl" | "googleSnapRoadProxyUrl" | "themeVariables" | "renderLoadFailedTitle" | "renderLoadFailedDescription" | "reportLog" | "hkGovernRegeoProxyUrl">;
|
|
9
9
|
export declare const MapProvider: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<MapProviderProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<MapProviderProps, Required<MapProviderProps>>, "success" | "fail" | "downloadOptimizeEnd", import("vue-demi").PublicProps, MapProviderProps, MapProviderProps, import("vue-demi").SlotsType<{
|
|
10
10
|
renderLoadFailedTitle?: ((status: Status) => string | undefined) | undefined;
|
|
11
11
|
renderLoadFailedDescription?: ((status: Status) => string | undefined) | undefined;
|
|
12
|
+
reportLog?: ((data: any) => void) | undefined;
|
|
12
13
|
} & {
|
|
13
14
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
14
15
|
}>>;
|
|
@@ -53,7 +53,7 @@ const MapProvider = defineLagecySetup("MapProvider", function(props, {
|
|
|
53
53
|
var _a;
|
|
54
54
|
return createVNode("div", null, [(_a = slots.default) == null ? void 0 : _a.call(slots)]);
|
|
55
55
|
};
|
|
56
|
-
}).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleRoutesProxyUrl", "googleSnapRoadProxyUrl", "themeVariables", "renderLoadFailedTitle", "renderLoadFailedDescription", "hkGovernRegeoProxyUrl"]);
|
|
56
|
+
}).props(["amapKey", "amapSecret", "amapServiceHost", "gmapId", "gmapRasterId", "gmapKey", "supplier", "language", "gaodeDirectionDrivingProxyUrl", "gaodeDirectionWalkingProxyUrl", "googleDirectionsProxyUrl", "googleRoutesProxyUrl", "googleSnapRoadProxyUrl", "themeVariables", "renderLoadFailedTitle", "renderLoadFailedDescription", "reportLog", "hkGovernRegeoProxyUrl"]);
|
|
57
57
|
const HeycarMap = defineLagecySetup("HeycarMap", function(props, {
|
|
58
58
|
slots,
|
|
59
59
|
emit,
|
|
@@ -128,7 +128,7 @@ const useGmapPlace = (props) => {
|
|
|
128
128
|
const { signal: inputSignal, onChange, emptyPlaceName } = props;
|
|
129
129
|
const defaultPoint = [...props.pointRef.value];
|
|
130
130
|
const pointRef = ref(defaultPoint);
|
|
131
|
-
const { readyPromise, language } = useMapSupplier();
|
|
131
|
+
const { readyPromise, language, reportLog } = useMapSupplier();
|
|
132
132
|
const { idx: placeKey, update } = useUpdate();
|
|
133
133
|
const place = reactive({
|
|
134
134
|
lng: pointRef.value[0],
|
|
@@ -159,6 +159,15 @@ const useGmapPlace = (props) => {
|
|
|
159
159
|
readyPromise.then(() => {
|
|
160
160
|
const geocoder = new google.maps.Geocoder();
|
|
161
161
|
const pipeTw = createPipeTw(language === "zh-TW");
|
|
162
|
+
reportLog == null ? void 0 : reportLog({
|
|
163
|
+
operation: "google_regeo",
|
|
164
|
+
eventType: "ServiceLogic",
|
|
165
|
+
message: {
|
|
166
|
+
lng,
|
|
167
|
+
lat,
|
|
168
|
+
language
|
|
169
|
+
}
|
|
170
|
+
});
|
|
162
171
|
geocoder.geocode({ language, location: { lng, lat } }).finally(() => clearTimeout(timer)).then(({ results }) => {
|
|
163
172
|
const name = results[0].formatted_address ? results[0].formatted_address : emptyPlaceName;
|
|
164
173
|
const displayName = gmapPlaceName2DisplayName(name, results[0].address_components);
|
|
@@ -16,6 +16,7 @@ export interface MapSupplierPayolad extends UseMapLoaderProps {
|
|
|
16
16
|
themeVariables?: MapThemeVariables;
|
|
17
17
|
renderLoadFailedTitle?: (status: Status) => string | undefined;
|
|
18
18
|
renderLoadFailedDescription?: (status: Status) => string | undefined;
|
|
19
|
+
reportLog?: (data: any) => void;
|
|
19
20
|
}
|
|
20
21
|
export declare const useMapSupplier: () => MapSupplierPayolad;
|
|
21
22
|
export declare const provideMapSupplier: (payload: MapSupplierPayolad) => void;
|
|
@@ -219,6 +219,7 @@ function androidWatchPosition(onSuccess, onError, option, getLocationFn) {
|
|
|
219
219
|
if (isHandled)
|
|
220
220
|
return;
|
|
221
221
|
isHandled = true;
|
|
222
|
+
console.log("==GeoLocation assert==", geoLocationPosition, typeof HEYCAR_GEOLOCATION_GET_CURRENT_POSITION === "function");
|
|
222
223
|
geoErrorMessage = void 0;
|
|
223
224
|
resolve(geoLocationPosition);
|
|
224
225
|
},
|
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.16.0-
|
|
3
|
+
const pkgVersion = "2.16.0-downgrade5";
|
|
4
4
|
const spaceLogSessionKey = "wiajlf;jwiatitruiq3jrlw";
|
|
5
5
|
const enableSessionLogKey = (key) => {
|
|
6
6
|
const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
|
|
@@ -150,6 +150,7 @@ function toGeolocationGetCurrentPosition(fn, fnName = fn.name) {
|
|
|
150
150
|
});
|
|
151
151
|
return;
|
|
152
152
|
}
|
|
153
|
+
console.log("==外部注入 geoPosition==", position);
|
|
153
154
|
onSuccess(position);
|
|
154
155
|
};
|
|
155
156
|
const asseertedOnError = (error) => onError(toGeolocationPositionError(error, prefix));
|