@doubao-apps/taro-runtime 0.0.23 → 0.0.24
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/api/index.d.ts +1 -1
- package/dist/api/index.js +1 -1
- package/dist/api/router/get-current-pages.d.ts +2 -0
- package/dist/api/router/get-current-pages.js +6 -0
- package/dist/api/router/index.d.ts +1 -0
- package/dist/api/router/index.js +1 -0
- package/dist/components/Map/bridge.d.ts +1 -1
- package/dist/components/Map/bridge.js +9 -7
- package/dist/components/Map/index.jsx +24 -32
- package/dist/components/Map/mapping.d.ts +11 -92
- package/dist/components/Map/mapping.js +3 -44
- package/package.json +1 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { getEnv, ENV_TYPE } from './base/index.js';
|
|
2
2
|
export { request } from './request/index.js';
|
|
3
|
-
export { exitMiniProgram, navigateBack, navigateTo, reLaunch, redirectTo } from './router/index.js';
|
|
3
|
+
export { exitMiniProgram, navigateBack, navigateTo, getCurrentPages, reLaunch, redirectTo } from './router/index.js';
|
|
4
4
|
export { setStorage, setStorageSync, getStorage, getStorageSync, removeStorage, removeStorageSync, clearStorage, clearStorageSync, getStorageInfo, getStorageInfoSync } from './storage/index.js';
|
|
5
5
|
export { getSystemSetting, getAppAuthorizeSetting, getDeviceInfo, getAppBaseInfo, getWindowInfo, makePhoneCall, getNetworkType, onKeyboardHeightChange } from './system/index.js';
|
|
6
6
|
export { getLocation } from './location/index.js';
|
package/dist/api/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { getEnv, ENV_TYPE } from './base/index.js';
|
|
2
2
|
export { request } from './request/index.js';
|
|
3
|
-
export { exitMiniProgram, navigateBack, navigateTo, reLaunch, redirectTo } from './router/index.js';
|
|
3
|
+
export { exitMiniProgram, navigateBack, navigateTo, getCurrentPages, reLaunch, redirectTo } from './router/index.js';
|
|
4
4
|
export { setStorage, setStorageSync, getStorage, getStorageSync, removeStorage, removeStorageSync, clearStorage, clearStorageSync, getStorageInfo, getStorageInfoSync } from './storage/index.js';
|
|
5
5
|
export { getSystemSetting, getAppAuthorizeSetting, getDeviceInfo, getAppBaseInfo, getWindowInfo, makePhoneCall, getNetworkType, onKeyboardHeightChange } from './system/index.js';
|
|
6
6
|
export { getLocation } from './location/index.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { exitMiniProgram } from './exit-mini-program.js';
|
|
2
2
|
export { navigateBack } from './navigate-back.js';
|
|
3
|
+
export { getCurrentPages } from './get-current-pages.js';
|
|
3
4
|
export { navigateTo } from './navigate-to.js';
|
|
4
5
|
export { reLaunch } from './re-launch.js';
|
|
5
6
|
export { redirectTo } from './redirect-to.js';
|
package/dist/api/router/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { exitMiniProgram } from './exit-mini-program.js';
|
|
2
2
|
export { navigateBack } from './navigate-back.js';
|
|
3
|
+
export { getCurrentPages } from './get-current-pages.js';
|
|
3
4
|
export { navigateTo } from './navigate-to.js';
|
|
4
5
|
export { reLaunch } from './re-launch.js';
|
|
5
6
|
export { redirectTo } from './redirect-to.js';
|
|
@@ -75,7 +75,7 @@ export declare function composeMarkers(propMarkers: MapProps.marker[], addedMark
|
|
|
75
75
|
export declare function mergeMarkersById(base: MapProps.marker[], incoming: MapProps.marker[]): MapProps.marker[];
|
|
76
76
|
export declare function removeMarkersByIds(markers: MapProps.marker[], markerIds: number[]): MapProps.marker[];
|
|
77
77
|
export declare function getNumericMarkerId(marker: MapProps.marker): number | undefined;
|
|
78
|
-
export declare function mapRegionCausedByEnd(causedBy: 'drag' | 'scale',
|
|
78
|
+
export declare function mapRegionCausedByEnd(causedBy: 'drag' | 'scale', triggeredBy: 'user' | 'api'): "scale" | "drag" | "update";
|
|
79
79
|
export declare function dispatchMarkerTapEvent<T>(handlers: {
|
|
80
80
|
onMarkerTap?: (event: T) => void;
|
|
81
81
|
onLabelTap?: (event: T) => void;
|
|
@@ -116,9 +116,11 @@ export function mapRegionChangeDetail(detail) {
|
|
|
116
116
|
southwest: center
|
|
117
117
|
};
|
|
118
118
|
const causedBy = detail.causedBy ?? 'drag';
|
|
119
|
+
const triggeredBy = detail.triggeredBy ?? 'user';
|
|
119
120
|
const rotate = detail.rotate ?? 0;
|
|
120
121
|
const scale = detail.scale ?? 0;
|
|
121
|
-
const beginCausedBy = mapRegionCausedByBegin(
|
|
122
|
+
const beginCausedBy = mapRegionCausedByBegin(triggeredBy);
|
|
123
|
+
const endCausedBy = mapRegionCausedByEnd(causedBy, triggeredBy);
|
|
122
124
|
const region = {
|
|
123
125
|
northeast: regionSource.northeast,
|
|
124
126
|
southeast: {
|
|
@@ -143,11 +145,11 @@ export function mapRegionChangeDetail(detail) {
|
|
|
143
145
|
}
|
|
144
146
|
return {
|
|
145
147
|
type: 'end',
|
|
146
|
-
causedBy:
|
|
148
|
+
causedBy: endCausedBy,
|
|
147
149
|
detail: {
|
|
148
150
|
rotate,
|
|
149
151
|
skew: 0,
|
|
150
|
-
causedBy:
|
|
152
|
+
causedBy: endCausedBy,
|
|
151
153
|
type: 'end',
|
|
152
154
|
scale,
|
|
153
155
|
centerLocation: center,
|
|
@@ -280,14 +282,14 @@ export function removeMarkersByIds(markers, markerIds) {
|
|
|
280
282
|
export function getNumericMarkerId(marker) {
|
|
281
283
|
return typeof marker.id === 'number' ? marker.id : undefined;
|
|
282
284
|
}
|
|
283
|
-
export function mapRegionCausedByEnd(causedBy,
|
|
284
|
-
if (
|
|
285
|
+
export function mapRegionCausedByEnd(causedBy, triggeredBy) {
|
|
286
|
+
if (triggeredBy === 'api') {
|
|
285
287
|
return 'update';
|
|
286
288
|
}
|
|
287
289
|
return causedBy;
|
|
288
290
|
}
|
|
289
|
-
function mapRegionCausedByBegin(
|
|
290
|
-
if (
|
|
291
|
+
function mapRegionCausedByBegin(triggeredBy) {
|
|
292
|
+
if (triggeredBy === 'api') {
|
|
291
293
|
return 'update';
|
|
292
294
|
}
|
|
293
295
|
return 'gesture';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { useEffect, useRef, useState } from '@byted-doubao-apps/framework';
|
|
1
|
+
import { useEffect, useMemo, useRef, useState } from '@byted-doubao-apps/framework';
|
|
2
2
|
import { registerMapController, unregisterMapController } from '../../internal/map-context/index.js';
|
|
3
3
|
import { Image } from '../Image/index.jsx';
|
|
4
4
|
import { warnUnsupported } from '../base/warn-unsupported.js';
|
|
5
|
-
import { composeMarkers, createMarkerElementProps, dispatchMarkerTapEvent, getNumericMarkerId, hasByClickCallout, hasTapTitle, mapMarkerToNativeProps, mergeMarkersById, removeMarkersByIds, resolveMarkerIconStyle, resolveMarkerTextContent, shouldAutoSizeMarkerIcon, resolvePadding } from './bridge.js';
|
|
6
|
-
import { collectMapUnsupportedWarnings,
|
|
5
|
+
import { composeMarkers, createMarkerElementProps, dispatchMarkerTapEvent, getNumericMarkerId, hasByClickCallout, hasTapTitle, mapMarkerToNativeProps, mapPolylineTapDetail, mapRegionChangeDetail, mergeMarkersById, removeMarkersByIds, resolveMarkerIconStyle, resolveNativePolygons, resolveMarkerTextContent, resolvePolylines, shouldAutoSizeMarkerIcon, resolvePadding } from './bridge.js';
|
|
6
|
+
import { collectMapUnsupportedWarnings, mergeMapStyle, resolveNativeCircles, resolveMapValues, toCommonEvent } from './mapping.js';
|
|
7
7
|
function DoubaoAppsMap(props) {
|
|
8
8
|
const { id, className, style, hidden, animation, children, onTouchStart, onTouchMove, onTouchCancel, onTouchEnd, onClick: onBaseClick, onLongPress, onLongClick, onTransitionEnd, onAnimationStart, onAnimationIteration, onAnimationEnd, longitude, latitude, scale, minScale, maxScale, markers, covers, polyline, circles, controls, includePoints, showLocation, polygons, subkey, layerStyle, rotate, skew, showCompass, showScale, enableOverlooking, enableZoom, enableScroll, enableRotate, enableSatellite, enableTraffic, setting, includePadding, groundOverlays, tileOverlay, enablePoi, enableBuilding, polygon, customMapStyle, panels, theme, optimize, enableAutoMaxOverlooking, enable3D, onTap, onMarkerTap, onLabelTap, onControlTap, onCalloutTap, onUpdated, onRegionChange, onPoiTap, onPolylineTap, onAbilitySuccess, onAbilityFailed, onAuthSuccess, onInterpolatePoint, onError, onCallOutTap, onAnchorPointTap, onPanelTap, onInitComplete, ...rest } = props;
|
|
9
9
|
const mapRef = useRef(null);
|
|
@@ -12,6 +12,10 @@ function DoubaoAppsMap(props) {
|
|
|
12
12
|
const [activeCalloutMarkerId, setActiveCalloutMarkerId] = useState(undefined);
|
|
13
13
|
const [imperativeAddedMarkers, setImperativeAddedMarkers] = useState([]);
|
|
14
14
|
const [imperativeRemovedMarkerIds, setImperativeRemovedMarkerIds] = useState([]);
|
|
15
|
+
const resolvedCenter = useMemo(() => ({
|
|
16
|
+
latitude,
|
|
17
|
+
longitude
|
|
18
|
+
}), [latitude, longitude]);
|
|
15
19
|
const { resolvedSetting, resolvedScale, resolvedMinScale, resolvedMaxScale, resolvedRotate, resolvedShowScale, resolvedEnableTilt, resolvedEnableScale, resolvedEnableDrag, resolvedEnableRotate, resolvedMarkers, resolvedPolygons, resolvedMapStyle } = resolveMapValues({
|
|
16
20
|
setting,
|
|
17
21
|
scale,
|
|
@@ -114,34 +118,6 @@ function DoubaoAppsMap(props) {
|
|
|
114
118
|
unregisterMapController(mapId, controller);
|
|
115
119
|
};
|
|
116
120
|
}, [mapId]);
|
|
117
|
-
const mapElementProps = createMapElementProps({
|
|
118
|
-
mapId,
|
|
119
|
-
className,
|
|
120
|
-
mapRef,
|
|
121
|
-
style,
|
|
122
|
-
hidden,
|
|
123
|
-
latitude,
|
|
124
|
-
longitude,
|
|
125
|
-
resolvedMapStyle,
|
|
126
|
-
resolvedScale,
|
|
127
|
-
resolvedMinScale,
|
|
128
|
-
resolvedMaxScale,
|
|
129
|
-
resolvedRotate,
|
|
130
|
-
resolvedShowScale,
|
|
131
|
-
resolvedEnableTilt,
|
|
132
|
-
resolvedEnableScale,
|
|
133
|
-
resolvedEnableDrag,
|
|
134
|
-
resolvedEnableRotate,
|
|
135
|
-
polyline,
|
|
136
|
-
circles,
|
|
137
|
-
resolvedPolygons,
|
|
138
|
-
onTap,
|
|
139
|
-
onBaseClick,
|
|
140
|
-
onUpdated,
|
|
141
|
-
onInitComplete,
|
|
142
|
-
onRegionChange,
|
|
143
|
-
onPolylineTap
|
|
144
|
-
});
|
|
145
121
|
const markerTapHandlers = {
|
|
146
122
|
onMarkerTap,
|
|
147
123
|
onLabelTap,
|
|
@@ -153,7 +129,23 @@ function DoubaoAppsMap(props) {
|
|
|
153
129
|
onCalloutTap !== undefined ||
|
|
154
130
|
onCallOutTap !== undefined;
|
|
155
131
|
const renderMarkers = composeMarkers(resolvedMarkers, imperativeAddedMarkers, imperativeRemovedMarkerIds);
|
|
156
|
-
return (<map {
|
|
132
|
+
return (<map className={className || ''} ref={mapRef} style={mergeMapStyle(style, hidden)}
|
|
133
|
+
// @ts-expect-error
|
|
134
|
+
enableNativeInteraction={rest.enableNativeInteraction} mapStyle={resolvedMapStyle}
|
|
135
|
+
// @ts-ignore
|
|
136
|
+
center={longitude !== undefined && latitude !== undefined ? resolvedCenter : undefined} scale={resolvedScale} minScale={resolvedMinScale} maxScale={resolvedMaxScale} rotate={resolvedRotate} showScale={resolvedShowScale} enableTilt={resolvedEnableTilt} enableScale={resolvedEnableScale} enableDrag={resolvedEnableDrag} enableRotate={resolvedEnableRotate} polyline={resolvePolylines(polyline)} circles={resolveNativeCircles(circles)} polygons={resolveNativePolygons(resolvedPolygons)} onClick={(detail) => {
|
|
137
|
+
const event = toCommonEvent({ point: detail.point }, 'tap', mapId);
|
|
138
|
+
onTap?.(event);
|
|
139
|
+
onBaseClick?.(event);
|
|
140
|
+
}} onMapLoaded={() => {
|
|
141
|
+
const event = toCommonEvent(undefined, 'updated', mapId);
|
|
142
|
+
onUpdated?.(event);
|
|
143
|
+
onInitComplete?.(event);
|
|
144
|
+
}} onRegionChange={(detail) => {
|
|
145
|
+
onRegionChange?.(toCommonEvent(mapRegionChangeDetail(detail), 'regionchange', mapId));
|
|
146
|
+
}} onPolylineClick={(detail) => {
|
|
147
|
+
onPolylineTap?.(toCommonEvent(mapPolylineTapDetail(detail), 'polylinetap', mapId));
|
|
148
|
+
}}>
|
|
157
149
|
{renderMarkers.map((marker, index) => {
|
|
158
150
|
const nativeMarker = mapMarkerToNativeProps(marker, index);
|
|
159
151
|
const markerId = nativeMarker.markerId;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { MapRef } from '@byted-doubao-apps/framework/components';
|
|
2
|
-
import type { MapProps as ComponentMapProps } from '@byted-doubao-apps/components';
|
|
3
1
|
import type { CSSProperties } from '@lynx-js/types';
|
|
4
2
|
import type { MapProps } from '@tarojs/components';
|
|
5
3
|
import { resolveCustomMapStyle } from './bridge.js';
|
|
@@ -20,9 +18,6 @@ type CommonEvent<T = unknown> = {
|
|
|
20
18
|
preventDefault: () => void;
|
|
21
19
|
stopPropagation: () => void;
|
|
22
20
|
};
|
|
23
|
-
type NativeMapClickDetail = Parameters<NonNullable<ComponentMapProps['onClick']>>[0];
|
|
24
|
-
type NativeMapPolylineClickDetail = Parameters<NonNullable<ComponentMapProps['onPolylineClick']>>[0];
|
|
25
|
-
type NativeMapRegionChangeDetail = Parameters<NonNullable<ComponentMapProps['onRegionChange']>>[0];
|
|
26
21
|
type ResolvedMapValues = {
|
|
27
22
|
resolvedSetting: Record<string, unknown>;
|
|
28
23
|
resolvedScale: number;
|
|
@@ -52,36 +47,6 @@ type CollectUnsupportedOptions = {
|
|
|
52
47
|
circles: MapProps['circles'];
|
|
53
48
|
resolvedPolygons: MapProps.polygon[];
|
|
54
49
|
};
|
|
55
|
-
type CreateMapElementPropsOptions = {
|
|
56
|
-
mapId: string;
|
|
57
|
-
className: MapProps['className'];
|
|
58
|
-
mapRef: {
|
|
59
|
-
current: MapRef | null;
|
|
60
|
-
};
|
|
61
|
-
style: MapProps['style'];
|
|
62
|
-
hidden: boolean | undefined;
|
|
63
|
-
latitude: number;
|
|
64
|
-
longitude: number;
|
|
65
|
-
resolvedMapStyle: ReturnType<typeof resolveCustomMapStyle>;
|
|
66
|
-
resolvedScale: number;
|
|
67
|
-
resolvedMinScale: number;
|
|
68
|
-
resolvedMaxScale: number;
|
|
69
|
-
resolvedRotate: number;
|
|
70
|
-
resolvedShowScale: boolean;
|
|
71
|
-
resolvedEnableTilt: boolean;
|
|
72
|
-
resolvedEnableScale: boolean;
|
|
73
|
-
resolvedEnableDrag: boolean;
|
|
74
|
-
resolvedEnableRotate: boolean;
|
|
75
|
-
polyline: MapProps['polyline'];
|
|
76
|
-
circles: MapProps['circles'];
|
|
77
|
-
resolvedPolygons: MapProps.polygon[];
|
|
78
|
-
onTap: MapProps['onTap'];
|
|
79
|
-
onBaseClick: MapProps['onClick'];
|
|
80
|
-
onUpdated: MapProps['onUpdated'];
|
|
81
|
-
onInitComplete: MapProps['onInitComplete'];
|
|
82
|
-
onRegionChange: MapProps['onRegionChange'];
|
|
83
|
-
onPolylineTap: MapProps['onPolylineTap'];
|
|
84
|
-
};
|
|
85
50
|
declare const MAP_UNSUPPORTED_PROPS: readonly ["animation", "controls", "showLocation", "subkey", "layerStyle", "skew", "showCompass", "enableSatellite", "enableTraffic", "groundOverlays", "tileOverlay", "enablePoi", "enableBuilding", "panels", "theme", "optimize", "enableAutoMaxOverlooking", "enable3D", "onTouchStart", "onTouchMove", "onTouchCancel", "onTouchEnd", "onLongPress", "onLongClick", "onTransitionEnd", "onAnimationStart", "onAnimationIteration", "onAnimationEnd", "onControlTap", "onPoiTap", "onAbilitySuccess", "onAbilityFailed", "onAuthSuccess", "onInterpolatePoint", "onError", "onAnchorPointTap", "onPanelTap"];
|
|
86
51
|
export type RuntimeMarker = MapProps.marker & {
|
|
87
52
|
children?: unknown;
|
|
@@ -104,69 +69,23 @@ export declare function resolveMapValues(values: {
|
|
|
104
69
|
customMapStyle: MapProps['customMapStyle'];
|
|
105
70
|
}): ResolvedMapValues;
|
|
106
71
|
export declare function collectMapUnsupportedWarnings(options: CollectUnsupportedOptions): string[];
|
|
107
|
-
export declare function
|
|
72
|
+
export declare function resolveNativeCircles(circles: MapProps['circles']): (Omit<{
|
|
108
73
|
id: string;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
74
|
+
center: {
|
|
75
|
+
latitude: number;
|
|
76
|
+
longitude: number | undefined;
|
|
112
77
|
};
|
|
113
|
-
|
|
114
|
-
|
|
78
|
+
radius: number;
|
|
79
|
+
strokeWidth: number | undefined;
|
|
80
|
+
strokeColor: string | undefined;
|
|
81
|
+
fillColor: string | undefined;
|
|
82
|
+
}, "center"> & {
|
|
115
83
|
center: {
|
|
116
84
|
latitude: number;
|
|
117
85
|
longitude: number;
|
|
118
86
|
};
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
maxScale: number;
|
|
122
|
-
rotate: number;
|
|
123
|
-
showScale: boolean;
|
|
124
|
-
enableTilt: boolean;
|
|
125
|
-
enableScale: boolean;
|
|
126
|
-
enableDrag: boolean;
|
|
127
|
-
enableRotate: boolean;
|
|
128
|
-
polyline: {
|
|
129
|
-
id: string;
|
|
130
|
-
points: MapProps.point[];
|
|
131
|
-
edgeColor: string[] | undefined;
|
|
132
|
-
edgeTexture: string[] | undefined;
|
|
133
|
-
edgeTextureAssets: {
|
|
134
|
-
id: string;
|
|
135
|
-
url: string;
|
|
136
|
-
}[] | undefined;
|
|
137
|
-
width: number | undefined;
|
|
138
|
-
dottedLine: boolean | undefined;
|
|
139
|
-
}[];
|
|
140
|
-
circles: (Omit<{
|
|
141
|
-
id: string;
|
|
142
|
-
center: {
|
|
143
|
-
latitude: number;
|
|
144
|
-
longitude: number | undefined;
|
|
145
|
-
};
|
|
146
|
-
radius: number;
|
|
147
|
-
strokeWidth: number | undefined;
|
|
148
|
-
strokeColor: string | undefined;
|
|
149
|
-
fillColor: string | undefined;
|
|
150
|
-
}, "center"> & {
|
|
151
|
-
center: {
|
|
152
|
-
latitude: number;
|
|
153
|
-
longitude: number;
|
|
154
|
-
};
|
|
155
|
-
})[];
|
|
156
|
-
polygons: {
|
|
157
|
-
id: string;
|
|
158
|
-
points: MapProps.point[];
|
|
159
|
-
dottedLine: boolean | undefined;
|
|
160
|
-
strokeWidth: number | undefined;
|
|
161
|
-
strokeColor: string | undefined;
|
|
162
|
-
fillColor: string | undefined;
|
|
163
|
-
zIndex: number | undefined;
|
|
164
|
-
}[];
|
|
165
|
-
onClick: (detail: NativeMapClickDetail) => void;
|
|
166
|
-
onMapLoaded: () => void;
|
|
167
|
-
onRegionChange: (detail: NativeMapRegionChangeDetail) => void;
|
|
168
|
-
onPolylineClick: (detail: NativeMapPolylineClickDetail) => void;
|
|
169
|
-
};
|
|
87
|
+
})[];
|
|
88
|
+
export declare function mergeMapStyle(style: MapProps['style'], hidden?: boolean): CSSProperties;
|
|
170
89
|
export declare function toCommonEvent<T>(detail: T, type: string, mapId: string): CommonEvent<T>;
|
|
171
90
|
export {};
|
|
172
91
|
//# sourceMappingURL=mapping.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getBooleanSetting, getNumberSetting,
|
|
1
|
+
import { getBooleanSetting, getNumberSetting, normalizeSetting, resolveCircles, resolveCustomMapStyle, resolvePadding } from './bridge.js';
|
|
2
2
|
const SUPPORTED_SETTING_KEYS = new Set([
|
|
3
3
|
'scale',
|
|
4
4
|
'minScale',
|
|
@@ -84,47 +84,6 @@ export function collectMapUnsupportedWarnings(options) {
|
|
|
84
84
|
unsupported.push(...collectShapeWarnings(options.resolvedMarkers, options.polyline, options.circles, options.resolvedPolygons));
|
|
85
85
|
return dedupe(unsupported);
|
|
86
86
|
}
|
|
87
|
-
export function createMapElementProps(options) {
|
|
88
|
-
return {
|
|
89
|
-
id: options.mapId,
|
|
90
|
-
className: options.className || '',
|
|
91
|
-
ref: options.mapRef,
|
|
92
|
-
style: mergeMapStyle(options.style, options.hidden),
|
|
93
|
-
mapStyle: options.resolvedMapStyle,
|
|
94
|
-
center: {
|
|
95
|
-
latitude: options.latitude,
|
|
96
|
-
longitude: options.longitude
|
|
97
|
-
},
|
|
98
|
-
scale: options.resolvedScale,
|
|
99
|
-
minScale: options.resolvedMinScale,
|
|
100
|
-
maxScale: options.resolvedMaxScale,
|
|
101
|
-
rotate: options.resolvedRotate,
|
|
102
|
-
showScale: options.resolvedShowScale,
|
|
103
|
-
enableTilt: options.resolvedEnableTilt,
|
|
104
|
-
enableScale: options.resolvedEnableScale,
|
|
105
|
-
enableDrag: options.resolvedEnableDrag,
|
|
106
|
-
enableRotate: options.resolvedEnableRotate,
|
|
107
|
-
polyline: resolvePolylines(options.polyline),
|
|
108
|
-
circles: resolveNativeCircles(options.circles),
|
|
109
|
-
polygons: resolveNativePolygons(options.resolvedPolygons),
|
|
110
|
-
onClick: (detail) => {
|
|
111
|
-
const event = toCommonEvent({ point: detail.point }, 'tap', options.mapId);
|
|
112
|
-
options.onTap?.(event);
|
|
113
|
-
options.onBaseClick?.(event);
|
|
114
|
-
},
|
|
115
|
-
onMapLoaded: () => {
|
|
116
|
-
const event = toCommonEvent(undefined, 'updated', options.mapId);
|
|
117
|
-
options.onUpdated?.(event);
|
|
118
|
-
options.onInitComplete?.(event);
|
|
119
|
-
},
|
|
120
|
-
onRegionChange: (detail) => {
|
|
121
|
-
options.onRegionChange?.(toCommonEvent(mapRegionChangeDetail(detail), 'regionchange', options.mapId));
|
|
122
|
-
},
|
|
123
|
-
onPolylineClick: (detail) => {
|
|
124
|
-
options.onPolylineTap?.(toCommonEvent(mapPolylineTapDetail(detail), 'polylinetap', options.mapId));
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
87
|
function collectUnsupportedProps(values) {
|
|
129
88
|
const unsupported = [];
|
|
130
89
|
MAP_UNSUPPORTED_PROPS.forEach((key) => {
|
|
@@ -159,10 +118,10 @@ function collectShapeWarnings(markers, polylines, circles, polygons) {
|
|
|
159
118
|
}
|
|
160
119
|
return unsupported;
|
|
161
120
|
}
|
|
162
|
-
function resolveNativeCircles(circles) {
|
|
121
|
+
export function resolveNativeCircles(circles) {
|
|
163
122
|
return resolveCircles(circles).filter((circle) => typeof circle.center.longitude === 'number');
|
|
164
123
|
}
|
|
165
|
-
function mergeMapStyle(style, hidden) {
|
|
124
|
+
export function mergeMapStyle(style, hidden) {
|
|
166
125
|
if (typeof style === 'string') {
|
|
167
126
|
const hiddenStyle = hidden ? 'display:none;' : '';
|
|
168
127
|
const zIndexStyle = style.includes('z-index') ? '' : 'z-index:0;';
|
package/package.json
CHANGED