@heycar/heycars-map 0.2.6 → 0.2.7
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/business-components/BusinessQuotingMap/BusinessQuotingMap.d.ts +2 -3
- package/dist/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +2 -3
- package/dist/business-components/FitView/FitView.d.ts +3 -1
- package/dist/index.cjs +53 -53
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1250 -1160
- package/dist/style.css +1 -1
- package/dist/types/interface.d.ts +1 -0
- package/package.json +1 -1
- package/src/App.tsx +3 -3
- package/src/business-components/BusinessQuotingMap/BusinessQuotingMap.tsx +4 -4
- package/src/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.tsx +98 -101
- package/src/business-components/FitView/FitView.tsx +10 -2
- package/src/components/Demo/DemoBusinessQuoting.tsx +1 -2
- package/src/components/Demo/DemoBusinessTaxiService.tsx +0 -1
- package/src/hooks/useMapFitView.ts +18 -16
- package/src/index.ts +2 -0
- package/src/types/interface.ts +1 -0
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.rgf09w0{width:7.1045vw;height:10.93vw;display:flex}._15rq2xn0{display:flex;flex-direction:column;align-items:center;margin-bottom:-1.6vw}._15rq2xn1{padding:2.13vw 4.5vw 2.67vw 4.27vw;display:flex;align-items:center;background:linear-gradient(90deg,#79AFFF 0%,#5C8DFF 32%,#507FFF 75%,#4471FF 100%);border-radius:3.2vw}._15rq2xn2{font-size:3.47vw;font-family:PingFangSC-Semibold,PingFang SC;font-weight:600;color:#fff;line-height:4.8vw;white-space:nowrap}._15rq2xn3{font-size:2.93vw;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:#eafaf8;line-height:4.27vw;white-space:nowrap;opacity:.8}._15rq2xn4{margin-left:3.2vw;width:1.44vw;height:2.4vw}._15rq2xn5{width:.8vw;height:4vw;background:#4C80FF;border-radius:0vw 0vw 26.67vw 26.67vw;z-index:1}._15rq2xn6{margin-top:-1.5vw;width:3.2vw;height:3.2vw}.
|
|
1
|
+
.rgf09w0{width:7.1045vw;height:10.93vw;display:flex}._15rq2xn0{display:flex;flex-direction:column;align-items:center;margin-bottom:-1.6vw}._15rq2xn1{padding:2.13vw 4.5vw 2.67vw 4.27vw;display:flex;align-items:center;background:linear-gradient(90deg,#79AFFF 0%,#5C8DFF 32%,#507FFF 75%,#4471FF 100%);border-radius:3.2vw}._15rq2xn2{font-size:3.47vw;font-family:PingFangSC-Semibold,PingFang SC;font-weight:600;color:#fff;line-height:4.8vw;white-space:nowrap}._15rq2xn3{font-size:2.93vw;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:#eafaf8;line-height:4.27vw;white-space:nowrap;opacity:.8}._15rq2xn4{margin-left:3.2vw;width:1.44vw;height:2.4vw}._15rq2xn5{width:.8vw;height:4vw;background:#4C80FF;border-radius:0vw 0vw 26.67vw 26.67vw;z-index:1}._15rq2xn6{margin-top:-1.5vw;width:3.2vw;height:3.2vw}._4a4ovk0{margin-bottom:-.4vw;display:flex;flex-direction:column;align-items:center}._4a4ovk1{padding:1.07vw 2.4vw 1.6vw 2.67vw;background:#FFFFFF;box-shadow:0 .53vw 2.4vw #3f3f3f33;border-radius:2.13vw}._4a4ovk2{padding:2.67vw 2.67vw 2.4vw 3.2vw;background:#FFFFFF;box-shadow:0 0 2.67vw #4e556c26;border-radius:4.8vw;font-size:3.2vw;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:#1e1e1e;line-height:4.53vw;white-space:nowrap}._4a4ovk3{font-size:3.2vw;font-family:PingFangSC-Medium,PingFang SC;font-weight:500;color:#1e1e1e;line-height:4.53vw;white-space:nowrap}._4a4ovk4{font-size:2.4vw;font-family:PingFangSC-Regular,PingFang SC;font-weight:400;color:#7e7e7e;line-height:3.47vw;white-space:nowrap}._4a4ovk5{color:#4471ff;font-family:PingFangSC-Medium,PingFang SC;font-weight:500}._4a4ovk6{margin-top:1.33vw;width:6.192vw;height:7.998vw}._4a4ovk7{margin-top:2.4vw;width:6.192vw;height:7.998vw}._1l6offo0{display:flex}._1l6offo1{width:4.53vw;height:4.53vw;margin-bottom:-2.265vw}._1l6offo2{width:16.27vw;height:16.27vw;margin-bottom:-8.135vw}.fhyw80{display:flex;align-items:center}.fhyw81{flex-direction:row-reverse}.fhyw83{margin-right:-2.265vw}.fhyw84{margin-left:-2.265vw}.fhyw85{margin-bottom:-2.265vw}.fhyw86{margin-right:calc(50% - 2.265vw)}.fhyw87{margin-left:calc(50% - 2.265vw)}.fhyw88{display:flex;width:4.53vw;height:4.53vw}.fhyw89{opacity:0}.fhyw8b{font-size:3.47vw;font-family:PingFangSC-Semibold,PingFang SC;font-weight:600;color:#243e66;line-height:4.53vw;white-space:nowrap}._65j3sr1{margin-top:1.87vw;margin-bottom:-5.5vw;width:6vw;height:11vw}@keyframes rrvp0y0{0%{transform:scale(0);opacity:1}33.33%{transform:scale(.5);opacity:1}66.66%{transform:scale(1);opacity:0}to{transform:scale(1);opacity:0}}@keyframes rrvp0y1{0%{transform:scale(0);opacity:0}33.33%{transform:scale(0);opacity:1}66.66%{transform:scale(.5);opacity:1}to{transform:scale(1);opacity:0}}.rrvp0y2{display:flex;margin-bottom:-30.935vw;width:61.87vw;height:61.87vw;animation-name:rrvp0y0;animation-duration:3s;animation-iteration-count:infinite;animation-timing-function:linear}.rrvp0y3{animation-name:rrvp0y1}
|
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { defineComponent } from "vue-demi";
|
|
2
|
-
import {
|
|
2
|
+
import { DemoBusinessTaxiService } from "./components/Demo/DemoBusinessTaxiService";
|
|
3
3
|
|
|
4
4
|
export const App = defineComponent({
|
|
5
5
|
setup() {
|
|
6
6
|
// return () => <Hello class={"helloclass2"} qyc={2} style={{ color: "red" }} />;
|
|
7
7
|
// return () => <ABusinessDemo />;
|
|
8
8
|
// return () => <SearchDemo />;
|
|
9
|
-
|
|
10
|
-
return () => <DemoBusinessQuoting />;
|
|
9
|
+
return () => <DemoBusinessTaxiService />;
|
|
10
|
+
// return () => <DemoBusinessQuoting />;
|
|
11
11
|
// return () => <HeycarDemo />;
|
|
12
12
|
},
|
|
13
13
|
});
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { HeycarMap, HeycarMapProps } from "../../components/MapProvider";
|
|
2
|
-
import type { MapMountedProps } from "../../hooks/useMap";
|
|
3
2
|
import type { MROP } from "../../hooks/useOverlay";
|
|
4
3
|
import { defineLagecySetup } from "../../types/helper";
|
|
5
4
|
import type { Place } from "../../types/interface";
|
|
6
5
|
import { place2point } from "../../utils/transform";
|
|
7
6
|
import { DrivingLine } from "../DrivingLine";
|
|
8
7
|
import { DrivingRoute } from "../DrivingRoute";
|
|
8
|
+
import { FitViewOnce } from "../FitView";
|
|
9
9
|
import { StartEndPoint } from "../StartEndPoint";
|
|
10
10
|
|
|
11
11
|
export type BusinessQuotingMapProps = Omit<HeycarMapProps, "center" | "zoom"> &
|
|
12
|
-
MROP &
|
|
13
|
-
MapMountedProps & {
|
|
12
|
+
Required<MROP> & {
|
|
14
13
|
from: Place;
|
|
15
14
|
to: Place;
|
|
16
15
|
renderDescription: (titleProps: { distance: number; duration: number }) => string;
|
|
@@ -42,7 +41,8 @@ export const BusinessQuotingMap = defineLagecySetup((props: BusinessQuotingMapPr
|
|
|
42
41
|
description={renderDescription({ distance, duration })}
|
|
43
42
|
/>,
|
|
44
43
|
]}
|
|
45
|
-
|
|
44
|
+
/>
|
|
45
|
+
<FitViewOnce registerOverlay={registerOverlay} />
|
|
46
46
|
</HeycarMap>
|
|
47
47
|
);
|
|
48
48
|
};
|
|
@@ -222,8 +222,7 @@ const SectionEndService = defineSetup((props: SectionEndServiceProps, { emit })
|
|
|
222
222
|
});
|
|
223
223
|
|
|
224
224
|
export type BusinessTaxiServiceMapProps = Omit<HeycarMapProps, "center" | "zoom"> &
|
|
225
|
-
MROP &
|
|
226
|
-
MapMountedProps & {
|
|
225
|
+
Required<MROP> & {
|
|
227
226
|
from: Place;
|
|
228
227
|
to: Place;
|
|
229
228
|
// @example 正在为您搜索附近司机
|
|
@@ -237,109 +236,107 @@ export type BusinessTaxiServiceMapProps = Omit<HeycarMapProps, "center" | "zoom"
|
|
|
237
236
|
renderInServiceTitle: (titleProps: { distance: number; duration: number }) => string;
|
|
238
237
|
getDriverPosition: () => Promise<Point>;
|
|
239
238
|
};
|
|
240
|
-
export const BusinessTaxiServiceMap = defineLagecySetup(
|
|
241
|
-
|
|
239
|
+
export const BusinessTaxiServiceMap = defineLagecySetup((props: BusinessTaxiServiceMapProps) => {
|
|
240
|
+
const {
|
|
241
|
+
from,
|
|
242
|
+
interval,
|
|
243
|
+
registerOverlay,
|
|
244
|
+
mapRef,
|
|
245
|
+
getDriverPosition,
|
|
246
|
+
renderStartSerivceTitle,
|
|
247
|
+
renderInServiceTitle,
|
|
248
|
+
} = props;
|
|
249
|
+
const { setFitView } = registerOverlay;
|
|
250
|
+
const { geoPosition } = useGeoLocation({ geoDefaultPosition: place2point(from) });
|
|
251
|
+
const carPositionRef = ref<Point>(place2point(props.from));
|
|
252
|
+
watch(
|
|
253
|
+
() => props.driverStatus,
|
|
254
|
+
(status, _, onCleanup) => {
|
|
255
|
+
if (!STATUS_NEED_CAR_POSITION.includes(status)) return;
|
|
256
|
+
const timer = setInterval(() => {
|
|
257
|
+
getDriverPosition().then((pos) => (carPositionRef.value = pos));
|
|
258
|
+
}, interval);
|
|
259
|
+
onCleanup(() => clearInterval(timer));
|
|
260
|
+
},
|
|
261
|
+
{ immediate: true }
|
|
262
|
+
);
|
|
263
|
+
return () => {
|
|
242
264
|
const {
|
|
265
|
+
driverStatus,
|
|
243
266
|
from,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
renderInServiceTitle,
|
|
267
|
+
to,
|
|
268
|
+
dispatchingTitle,
|
|
269
|
+
bookDispatchingTitle,
|
|
270
|
+
bookDispatchedTitle,
|
|
271
|
+
driverArrivedTitle,
|
|
250
272
|
} = props;
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
273
|
+
const carPosition = carPositionRef.value;
|
|
274
|
+
return (
|
|
275
|
+
<HeycarMap center={place2point(from)} zoom={13} mapRef={mapRef}>
|
|
276
|
+
{driverStatus === "dispatching" ? (
|
|
277
|
+
<SectionDispatching
|
|
278
|
+
from={from}
|
|
279
|
+
title={dispatchingTitle}
|
|
280
|
+
registerOverlay={registerOverlay}
|
|
281
|
+
onMapMounted={setFitView}
|
|
282
|
+
/>
|
|
283
|
+
) : driverStatus === "book-dispatching" ? (
|
|
284
|
+
<SectionDispatching
|
|
285
|
+
from={from}
|
|
286
|
+
title={bookDispatchingTitle}
|
|
287
|
+
registerOverlay={registerOverlay}
|
|
288
|
+
onMapMounted={setFitView}
|
|
289
|
+
/>
|
|
290
|
+
) : driverStatus === "dispatched" ||
|
|
291
|
+
driverStatus === "driverStartService" ||
|
|
292
|
+
driverStatus === "book-driverStartService" ? (
|
|
293
|
+
<SectionDriverStartService
|
|
294
|
+
from={from}
|
|
295
|
+
carPosition={carPosition}
|
|
296
|
+
passengerPosition={geoPosition.value}
|
|
297
|
+
renderTitle={renderStartSerivceTitle}
|
|
298
|
+
registerOverlay={registerOverlay}
|
|
299
|
+
onMapMounted={setFitView}
|
|
300
|
+
/>
|
|
301
|
+
) : driverStatus === "book-dispatched" ? (
|
|
302
|
+
<SectionBookDispatched
|
|
303
|
+
from={from}
|
|
304
|
+
passengerPosition={geoPosition.value}
|
|
305
|
+
title={bookDispatchedTitle}
|
|
306
|
+
registerOverlay={registerOverlay}
|
|
307
|
+
onMapMounted={setFitView}
|
|
308
|
+
/>
|
|
309
|
+
) : driverStatus === "inService" ? (
|
|
310
|
+
<SectionInService
|
|
311
|
+
to={to}
|
|
312
|
+
carPosition={carPosition}
|
|
313
|
+
renderTitle={renderInServiceTitle}
|
|
314
|
+
registerOverlay={registerOverlay}
|
|
315
|
+
onMapMounted={setFitView}
|
|
316
|
+
/>
|
|
317
|
+
) : driverStatus === "driverArrived" ? (
|
|
318
|
+
<SectionDriverArrived
|
|
319
|
+
from={from}
|
|
320
|
+
carPosition={carPosition}
|
|
321
|
+
passengerPosition={geoPosition.value}
|
|
322
|
+
title={driverArrivedTitle}
|
|
323
|
+
registerOverlay={registerOverlay}
|
|
324
|
+
onMapMounted={setFitView}
|
|
325
|
+
/>
|
|
326
|
+
) : driverStatus === "canceled" ? (
|
|
327
|
+
<SectionCanceled from={from} to={to} registerOverlay={registerOverlay} />
|
|
328
|
+
) : driverStatus === "endService" ? (
|
|
329
|
+
<SectionEndService
|
|
330
|
+
from={from}
|
|
331
|
+
to={to}
|
|
332
|
+
registerOverlay={registerOverlay}
|
|
333
|
+
onMapMounted={setFitView}
|
|
334
|
+
/>
|
|
335
|
+
) : null}
|
|
336
|
+
</HeycarMap>
|
|
264
337
|
);
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
driverStatus,
|
|
268
|
-
from,
|
|
269
|
-
to,
|
|
270
|
-
dispatchingTitle,
|
|
271
|
-
bookDispatchingTitle,
|
|
272
|
-
bookDispatchedTitle,
|
|
273
|
-
driverArrivedTitle,
|
|
274
|
-
} = props;
|
|
275
|
-
const carPosition = carPositionRef.value;
|
|
276
|
-
return (
|
|
277
|
-
<HeycarMap center={place2point(from)} zoom={13} mapRef={mapRef}>
|
|
278
|
-
{driverStatus === "dispatching" ? (
|
|
279
|
-
<SectionDispatching
|
|
280
|
-
from={from}
|
|
281
|
-
title={dispatchingTitle}
|
|
282
|
-
registerOverlay={registerOverlay}
|
|
283
|
-
onMapMounted={handleMounted}
|
|
284
|
-
/>
|
|
285
|
-
) : driverStatus === "book-dispatching" ? (
|
|
286
|
-
<SectionDispatching
|
|
287
|
-
from={from}
|
|
288
|
-
title={bookDispatchingTitle}
|
|
289
|
-
registerOverlay={registerOverlay}
|
|
290
|
-
onMapMounted={handleMounted}
|
|
291
|
-
/>
|
|
292
|
-
) : driverStatus === "dispatched" ||
|
|
293
|
-
driverStatus === "driverStartService" ||
|
|
294
|
-
driverStatus === "book-driverStartService" ? (
|
|
295
|
-
<SectionDriverStartService
|
|
296
|
-
from={from}
|
|
297
|
-
carPosition={carPosition}
|
|
298
|
-
passengerPosition={geoPosition.value}
|
|
299
|
-
renderTitle={renderStartSerivceTitle}
|
|
300
|
-
registerOverlay={registerOverlay}
|
|
301
|
-
onMapMounted={handleMounted}
|
|
302
|
-
/>
|
|
303
|
-
) : driverStatus === "book-dispatched" ? (
|
|
304
|
-
<SectionBookDispatched
|
|
305
|
-
from={from}
|
|
306
|
-
passengerPosition={geoPosition.value}
|
|
307
|
-
title={bookDispatchedTitle}
|
|
308
|
-
registerOverlay={registerOverlay}
|
|
309
|
-
onMapMounted={handleMounted}
|
|
310
|
-
/>
|
|
311
|
-
) : driverStatus === "inService" ? (
|
|
312
|
-
<SectionInService
|
|
313
|
-
to={to}
|
|
314
|
-
carPosition={carPosition}
|
|
315
|
-
renderTitle={renderInServiceTitle}
|
|
316
|
-
registerOverlay={registerOverlay}
|
|
317
|
-
onMapMounted={handleMounted}
|
|
318
|
-
/>
|
|
319
|
-
) : driverStatus === "driverArrived" ? (
|
|
320
|
-
<SectionDriverArrived
|
|
321
|
-
from={from}
|
|
322
|
-
carPosition={carPosition}
|
|
323
|
-
passengerPosition={geoPosition.value}
|
|
324
|
-
title={driverArrivedTitle}
|
|
325
|
-
registerOverlay={registerOverlay}
|
|
326
|
-
onMapMounted={handleMounted}
|
|
327
|
-
/>
|
|
328
|
-
) : driverStatus === "canceled" ? (
|
|
329
|
-
<SectionCanceled from={from} to={to} registerOverlay={registerOverlay} />
|
|
330
|
-
) : driverStatus === "endService" ? (
|
|
331
|
-
<SectionEndService
|
|
332
|
-
from={from}
|
|
333
|
-
to={to}
|
|
334
|
-
registerOverlay={registerOverlay}
|
|
335
|
-
onMapMounted={handleMounted}
|
|
336
|
-
/>
|
|
337
|
-
) : null}
|
|
338
|
-
</HeycarMap>
|
|
339
|
-
);
|
|
340
|
-
};
|
|
341
|
-
}
|
|
342
|
-
).props([
|
|
338
|
+
};
|
|
339
|
+
}).props([
|
|
343
340
|
"bookDispatchedTitle",
|
|
344
341
|
"bookDispatchingTitle",
|
|
345
342
|
"dispatchingTitle",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useMap } from "../../hooks/useMap";
|
|
1
|
+
import { onMapMounted, useMap } from "../../hooks/useMap";
|
|
2
2
|
import { useMapFitView, UseMapFitViewOutput, UseMapFitViewProps } from "../../hooks/useMapFitView";
|
|
3
|
-
import type { AmapOverlay, GmapOverlay } from "../../hooks/useOverlay";
|
|
3
|
+
import type { AmapOverlay, GmapOverlay, MROP } from "../../hooks/useOverlay";
|
|
4
4
|
import { defineSetup, VNodeChild } from "../../types/helper";
|
|
5
5
|
|
|
6
6
|
type FitViewRenderProps = UseMapFitViewOutput<AmapOverlay> | UseMapFitViewOutput<GmapOverlay>;
|
|
@@ -12,3 +12,11 @@ export const FitView = defineSetup(function FitView(props: FitViewProps, { slots
|
|
|
12
12
|
const ctx = useMapFitView({ ...props, mapRef });
|
|
13
13
|
return () => <div>{slots.render?.(ctx)}</div>;
|
|
14
14
|
});
|
|
15
|
+
|
|
16
|
+
export type FitViewOnceProps = Required<MROP>;
|
|
17
|
+
export const FitViewOnce = defineSetup(function FitViewOnce(props: FitViewOnceProps, { slots }) {
|
|
18
|
+
const { registerOverlay } = props;
|
|
19
|
+
const { setFitView } = registerOverlay;
|
|
20
|
+
onMapMounted(setFitView);
|
|
21
|
+
return () => <div>{slots.default?.()}</div>;
|
|
22
|
+
});
|
|
@@ -24,7 +24,7 @@ export const DemoBusinessQuoting = defineSetup(function DemoBusinessTaxiService(
|
|
|
24
24
|
});
|
|
25
25
|
|
|
26
26
|
const SomeQuotingPage = defineSetup(function SomeQuotingPage() {
|
|
27
|
-
const { setMap,
|
|
27
|
+
const { setMap, registerFitVeiw } = useBusinessQuotingMap();
|
|
28
28
|
return () => (
|
|
29
29
|
<BusinessQuotingMap
|
|
30
30
|
class={css.demo}
|
|
@@ -33,7 +33,6 @@ const SomeQuotingPage = defineSetup(function SomeQuotingPage() {
|
|
|
33
33
|
renderDescription={({ distance, duration }) => `全程 *${distance}公里* 约行驶 *${duration}*`}
|
|
34
34
|
mapRef={setMap}
|
|
35
35
|
registerOverlay={registerFitVeiw}
|
|
36
|
-
onMapMounted={setFitView}
|
|
37
36
|
/>
|
|
38
37
|
);
|
|
39
38
|
});
|
|
@@ -27,14 +27,6 @@ export const useAmapFitView = (props: UseMapFitViewProps<AMap.Map>) => {
|
|
|
27
27
|
const { mapRef, autoFitTimeout } = props;
|
|
28
28
|
const overlayGroup: Set<AmapOverlay> = new Set();
|
|
29
29
|
let timer: number | undefined = undefined;
|
|
30
|
-
const registerFitVeiw: RegisterOverlay<AmapOverlay> = {
|
|
31
|
-
add: (overlay: AmapOverlay) => {
|
|
32
|
-
overlayGroup.add(overlay);
|
|
33
|
-
},
|
|
34
|
-
remove: (overlay: AmapOverlay) => {
|
|
35
|
-
overlayGroup.delete(overlay);
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
30
|
const setFitView = () => {
|
|
39
31
|
const map = mapRef.value;
|
|
40
32
|
if (!map) return;
|
|
@@ -43,6 +35,15 @@ export const useAmapFitView = (props: UseMapFitViewProps<AMap.Map>) => {
|
|
|
43
35
|
console.log([...overlayGroup]);
|
|
44
36
|
map.setFitView([...overlayGroup], false, [top * vw, bottom * vw, left * vw, right * vw]);
|
|
45
37
|
};
|
|
38
|
+
const registerFitVeiw: RegisterOverlay<AmapOverlay> = {
|
|
39
|
+
add: (overlay: AmapOverlay) => {
|
|
40
|
+
overlayGroup.add(overlay);
|
|
41
|
+
},
|
|
42
|
+
remove: (overlay: AmapOverlay) => {
|
|
43
|
+
overlayGroup.delete(overlay);
|
|
44
|
+
},
|
|
45
|
+
setFitView,
|
|
46
|
+
};
|
|
46
47
|
const handleMoveEndOrZomEnd = () => {
|
|
47
48
|
if (!autoFitTimeout) return;
|
|
48
49
|
if (timer) clearTimeout(timer);
|
|
@@ -82,14 +83,6 @@ export const useGmapFitView = (props: UseMapFitViewProps<google.maps.Map>) => {
|
|
|
82
83
|
const { executeMapApi } = useMapEventSource();
|
|
83
84
|
const overlayGroup = new SimpleGmapOverLayerGroup();
|
|
84
85
|
let timer: number | undefined = undefined;
|
|
85
|
-
const registerFitVeiw: RegisterOverlay<GmapOverlay> = {
|
|
86
|
-
add: (overlay: GmapOverlay) => {
|
|
87
|
-
overlayGroup.add(overlay);
|
|
88
|
-
},
|
|
89
|
-
remove: (overlay: GmapOverlay) => {
|
|
90
|
-
overlayGroup.delete(overlay);
|
|
91
|
-
},
|
|
92
|
-
};
|
|
93
86
|
const setFitView = () => {
|
|
94
87
|
const map = mapRef.value;
|
|
95
88
|
if (!map) return;
|
|
@@ -104,6 +97,15 @@ export const useGmapFitView = (props: UseMapFitViewProps<google.maps.Map>) => {
|
|
|
104
97
|
})
|
|
105
98
|
);
|
|
106
99
|
};
|
|
100
|
+
const registerFitVeiw: RegisterOverlay<GmapOverlay> = {
|
|
101
|
+
add: (overlay: GmapOverlay) => {
|
|
102
|
+
overlayGroup.add(overlay);
|
|
103
|
+
},
|
|
104
|
+
remove: (overlay: GmapOverlay) => {
|
|
105
|
+
overlayGroup.delete(overlay);
|
|
106
|
+
},
|
|
107
|
+
setFitView,
|
|
108
|
+
};
|
|
107
109
|
const handleMoveEnd = (name: string) => {
|
|
108
110
|
const eventSource = getMapEvnetSource();
|
|
109
111
|
console.log("handleMoveEndOrZomEnd name, eventSource = ", name, eventSource);
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "./style.css";
|
|
2
2
|
export { AddressBox } from "./business-components/AddressBox";
|
|
3
|
+
export { BusinessQuotingMap } from "./business-components/BusinessQuotingMap";
|
|
3
4
|
export { BusinessTaxiServiceMap } from "./business-components/BusinessTaxiServiceMap";
|
|
4
5
|
export { DrivingLine } from "./business-components/DrivingLine";
|
|
5
6
|
export { DrivingRoute } from "./business-components/DrivingRoute";
|
|
@@ -14,6 +15,7 @@ export { WaveCircle } from "./business-components/WaveCircle";
|
|
|
14
15
|
export * from "./components/MapProvider";
|
|
15
16
|
export * from "./hooks-business/useBusinessMapAutoComplete";
|
|
16
17
|
export * from "./hooks-business/useBusinessMapRecomendPlace";
|
|
18
|
+
export * from "./hooks-business/useBusinessQuotingMap";
|
|
17
19
|
export * from "./hooks-business/useBusinessTaxiServiceMap";
|
|
18
20
|
export { useDrivingRoute } from "./hooks/useDrivingRoute";
|
|
19
21
|
export { useGeoLocation } from "./hooks/useGeoLocation";
|