@lugg/maps 1.0.0-beta.0 → 1.0.0-beta.2
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/README.md +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/luggmaps/LuggCalloutView.kt +74 -0
- package/android/src/main/java/com/luggmaps/LuggCalloutViewManager.kt +38 -0
- package/android/src/main/java/com/luggmaps/LuggMapWrapperView.kt +0 -11
- package/android/src/main/java/com/luggmaps/LuggMarkerView.kt +73 -51
- package/android/src/main/java/com/luggmaps/LuggPackage.kt +8 -1
- package/android/src/main/java/com/luggmaps/core/GoogleMapProvider.kt +181 -5
- package/ios/LuggCalloutView.h +23 -0
- package/ios/LuggCalloutView.mm +145 -0
- package/ios/LuggMarkerView.h +2 -0
- package/ios/LuggMarkerView.mm +17 -2
- package/ios/core/AppleMapProvider.mm +211 -24
- package/ios/core/GoogleMapProvider.mm +125 -5
- package/ios/core/LuggAnnotationView.h +12 -0
- package/ios/core/LuggAnnotationView.mm +55 -0
- package/lib/module/MapProvider.web.js +3 -1
- package/lib/module/MapProvider.web.js.map +1 -1
- package/lib/module/MapView.web.js +15 -2
- package/lib/module/MapView.web.js.map +1 -1
- package/lib/module/components/Marker.js +21 -4
- package/lib/module/components/Marker.js.map +1 -1
- package/lib/module/components/Marker.web.js +86 -22
- package/lib/module/components/Marker.web.js.map +1 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/fabric/LuggCalloutViewNativeComponent.ts +20 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/MapProvider.web.d.ts +6 -0
- package/lib/typescript/src/MapProvider.web.d.ts.map +1 -1
- package/lib/typescript/src/MapView.web.d.ts.map +1 -1
- package/lib/typescript/src/components/GeoJson.types.d.ts +11 -1
- package/lib/typescript/src/components/GeoJson.types.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.d.ts +1 -1
- package/lib/typescript/src/components/Marker.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.types.d.ts +27 -1
- package/lib/typescript/src/components/Marker.types.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.web.d.ts +1 -1
- package/lib/typescript/src/components/Marker.web.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts +1 -1
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/components/index.web.d.ts +1 -1
- package/lib/typescript/src/components/index.web.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggCalloutViewNativeComponent.d.ts +13 -0
- package/lib/typescript/src/fabric/LuggCalloutViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +2 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.web.d.ts +2 -2
- package/lib/typescript/src/index.web.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/MapProvider.web.tsx +11 -1
- package/src/MapView.web.tsx +26 -2
- package/src/components/GeoJson.types.ts +12 -1
- package/src/components/Marker.tsx +29 -1
- package/src/components/Marker.types.ts +28 -1
- package/src/components/Marker.web.tsx +113 -23
- package/src/components/index.ts +1 -0
- package/src/components/index.web.ts +1 -1
- package/src/fabric/LuggCalloutViewNativeComponent.ts +20 -0
- package/src/index.ts +2 -0
- package/src/index.web.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useEffect","useRef","AdvancedMarker","useMapContext","jsx","_jsx","toWebAnchor","value","createEvent","e","coordinate","nativeEvent","latitude","latLng","lat","longitude","lng","point","x","domEvent","clientX","y","clientY","Marker","title","anchor","zIndex","rotate","scale","draggable","onPress","onDragStart","onDragChange","onDragEnd","children","moveCamera","dragPositionRef","transforms","push","handleClick","pos","current","coord","handleDragStart","handleDrag","handleDragEnd","position","anchorLeft","undefined","anchorTop","clickable","onClick","onDrag","
|
|
1
|
+
{"version":3,"names":["React","isValidElement","useCallback","useEffect","useRef","useState","AdvancedMarker","InfoWindow","useAdvancedMarkerRef","useMapContext","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","CALLOUT_ARROW_HEIGHT","UNBUBBLED_CLASS","UNBUBBLED_STYLE_ID","injectUnbubbledStyle","document","getElementById","style","createElement","id","textContent","head","appendChild","toWebAnchor","value","createEvent","e","coordinate","nativeEvent","latitude","latLng","lat","longitude","lng","point","x","domEvent","clientX","y","clientY","Marker","title","description","anchor","zIndex","rotate","scale","draggable","onPress","onDragStart","onDragChange","onDragEnd","callout","calloutOptions","children","moveCamera","onCalloutClose","closeCallouts","dragPositionRef","markerRef","markerElement","infoWindowOpen","setInfoWindowOpen","calloutBubbled","bubbled","closeCallout","hasCallout","calloutContent","fontSize","fontWeight","transforms","push","handleClick","pos","current","coord","prev","handleDragStart","handleDrag","handleDragEnd","latLngPosition","position","ref","anchorLeft","undefined","anchorTop","clickable","onClick","onDrag","length","transform","join","pixelOffset","headerDisabled","onClose","className"],"sourceRoot":"../../../src","sources":["components/Marker.web.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IACVC,cAAc,EACdC,WAAW,EACXC,SAAS,EACTC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SACEC,cAAc,EACdC,UAAU,EACVC,oBAAoB,QACf,2BAA2B;AAClC,SAASC,aAAa,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA,EAAAC,IAAA,IAAAC,KAAA;AAGnD,MAAMC,oBAAoB,GAAG,EAAE;AAC/B,MAAMC,eAAe,GAAG,uBAAuB;AAC/C,MAAMC,kBAAkB,GAAG,6BAA6B;AAExD,SAASC,oBAAoBA,CAAA,EAAG;EAC9B,IAAIC,QAAQ,CAACC,cAAc,CAACH,kBAAkB,CAAC,EAAE;EACjD,MAAMI,KAAK,GAAGF,QAAQ,CAACG,aAAa,CAAC,OAAO,CAAC;EAC7CD,KAAK,CAACE,EAAE,GAAGN,kBAAkB;EAC7BI,KAAK,CAACG,WAAW,GAAG;AACtB,0BAA0BR,eAAe;AACzC;A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MAAM,EAAEV,UAAW;MACnB3B,SAAS,EAAE4B,aAAc;MACzB9D,KAAK,EACHqD,UAAU,CAACmB,MAAM,GAAG,CAAC,GACjB;QAAEC,SAAS,EAAEpB,UAAU,CAACqB,IAAI,CAAC,GAAG;MAAE,CAAC,GACnCP,SACL;MAAA9B,QAAA,EAEAA;IAAQ,CACK,CAAC,EAChBa,cAAc,IAAIN,cAAc,IAAID,aAAa,iBAChDtD,IAAA,CAACJ,UAAU;MACTyC,MAAM,EAAEiB,aAAc;MACtBgC,WAAW,EAAE,CAAC7B,cAAc,GAAG,CAAC,CAAC,EAAEpD,oBAAoB,CAAC,GAAGyE,SAAU;MACrES,cAAc;MACdC,OAAO,EAAEA,CAAA,KAAMhC,iBAAiB,CAAC,KAAK,CAAE;MAAAR,QAAA,EAEvC,CAACS,cAAc,gBACdzD,IAAA;QAAKyF,SAAS,EAAEnF,eAAgB;QAAA0C,QAAA,EAAEa;MAAc,CAAM,CAAC,GAEvDA;IACD,CACS,CACb;EAAA,CACD,CAAC;AAEP,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Marker","Polygon","Polyline","GeoJson"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,UAAU;
|
|
1
|
+
{"version":3,"names":["Marker","Polygon","Polyline","GeoJson"],"sourceRoot":"../../../src","sources":["components/index.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,UAAU;AAOjC,SAASC,OAAO,QAAQ,WAAW;AAEnC,SAASC,QAAQ,QAAQ,YAAY;AAMrC,SAASC,OAAO,QAAQ,cAAW","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { codegenNativeComponent } from 'react-native';
|
|
2
|
+
import type { ViewProps, HostComponent } from 'react-native';
|
|
3
|
+
import type {
|
|
4
|
+
Double,
|
|
5
|
+
WithDefault,
|
|
6
|
+
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
7
|
+
|
|
8
|
+
export interface Point {
|
|
9
|
+
x: Double;
|
|
10
|
+
y: Double;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface NativeProps extends ViewProps {
|
|
14
|
+
bubbled?: WithDefault<boolean, true>;
|
|
15
|
+
anchor?: Point;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default codegenNativeComponent<NativeProps>(
|
|
19
|
+
'LuggCalloutView'
|
|
20
|
+
) as HostComponent<NativeProps>;
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MapView","MapProvider","Marker","Polygon","Polyline","GeoJson"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,WAAW;AACnC,SAASC,WAAW,QAAQ,eAAe;AAE3C,SAASC,MAAM,QAAQ,cAAc;
|
|
1
|
+
{"version":3,"names":["MapView","MapProvider","Marker","Polygon","Polyline","GeoJson"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,WAAW;AACnC,SAASC,WAAW,QAAQ,eAAe;AAE3C,SAASC,MAAM,QAAQ,cAAc;AAOrC,SAASC,OAAO,QAAQ,cAAc;AAEtC,SAASC,QAAQ,QAAQ,cAAc;AAMvC,SAASC,OAAO,QAAQ,cAAc","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MapProviderProps } from './MapProvider.types';
|
|
2
|
+
type CalloutCloseListener = () => void;
|
|
2
3
|
export declare const MapContext: import("react").Context<{
|
|
3
4
|
map: google.maps.Map | null;
|
|
4
5
|
isDragging: boolean;
|
|
@@ -6,6 +7,8 @@ export declare const MapContext: import("react").Context<{
|
|
|
6
7
|
latitude: number;
|
|
7
8
|
longitude: number;
|
|
8
9
|
}) => void;
|
|
10
|
+
onCalloutClose: (listener: CalloutCloseListener) => () => void;
|
|
11
|
+
closeCallouts: (except?: CalloutCloseListener) => void;
|
|
9
12
|
}>;
|
|
10
13
|
export declare const useMapContext: () => {
|
|
11
14
|
map: google.maps.Map | null;
|
|
@@ -14,6 +17,9 @@ export declare const useMapContext: () => {
|
|
|
14
17
|
latitude: number;
|
|
15
18
|
longitude: number;
|
|
16
19
|
}) => void;
|
|
20
|
+
onCalloutClose: (listener: CalloutCloseListener) => () => void;
|
|
21
|
+
closeCallouts: (except?: CalloutCloseListener) => void;
|
|
17
22
|
};
|
|
18
23
|
export declare const MapProvider: ({ apiKey, children }: MapProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
19
25
|
//# sourceMappingURL=MapProvider.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapProvider.web.d.ts","sourceRoot":"","sources":["../../../src/MapProvider.web.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,UAAU;SAChB,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI;gBACf,OAAO;gBACP,CAAC,UAAU,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"MapProvider.web.d.ts","sourceRoot":"","sources":["../../../src/MapProvider.web.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,KAAK,oBAAoB,GAAG,MAAM,IAAI,CAAC;AAEvC,eAAO,MAAM,UAAU;SAChB,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI;gBACf,OAAO;gBACP,CAAC,UAAU,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;oBACzD,CAAC,QAAQ,EAAE,oBAAoB,KAAK,MAAM,IAAI;mBAC/C,CAAC,MAAM,CAAC,EAAE,oBAAoB,KAAK,IAAI;EAOtD,CAAC;AAEH,eAAO,MAAM,aAAa;SAbnB,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI;gBACf,OAAO;gBACP,CAAC,UAAU,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;oBACzD,CAAC,QAAQ,EAAE,oBAAoB,KAAK,MAAM,IAAI;mBAC/C,CAAC,MAAM,CAAC,EAAE,oBAAoB,KAAK,IAAI;CASC,CAAC;AAE1D,eAAO,MAAM,WAAW,GAAI,sBAA2B,gBAAgB,4CAEtE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.web.d.ts","sourceRoot":"","sources":["../../../src/MapView.web.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EAKX,MAAM,iBAAiB,CAAC;AAoEzB,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"MapView.web.d.ts","sourceRoot":"","sources":["../../../src/MapView.web.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EAKX,MAAM,iBAAiB,CAAC;AAoEzB,eAAO,MAAM,OAAO,qGAsXlB,CAAC"}
|
|
@@ -36,11 +36,21 @@ export interface GeometryCollection {
|
|
|
36
36
|
geometries: Geometry[];
|
|
37
37
|
}
|
|
38
38
|
export type Geometry = Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon | GeometryCollection;
|
|
39
|
+
export interface FeatureProperties {
|
|
40
|
+
'title'?: string;
|
|
41
|
+
'description'?: string;
|
|
42
|
+
'fill'?: string;
|
|
43
|
+
'fill-opacity'?: number;
|
|
44
|
+
'stroke'?: string;
|
|
45
|
+
'stroke-width'?: number;
|
|
46
|
+
'stroke-opacity'?: number;
|
|
47
|
+
[key: string]: unknown;
|
|
48
|
+
}
|
|
39
49
|
export interface Feature<G extends Geometry = Geometry> {
|
|
40
50
|
type: 'Feature';
|
|
41
51
|
id?: string | number;
|
|
42
52
|
geometry: G;
|
|
43
|
-
properties:
|
|
53
|
+
properties: FeatureProperties | null;
|
|
44
54
|
}
|
|
45
55
|
export interface FeatureCollection<G extends Geometry = Geometry> {
|
|
46
56
|
type: 'FeatureCollection';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoJson.types.d.ts","sourceRoot":"","sources":["../../../../src/components/GeoJson.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD;;;GAGG;AAEH,MAAM,MAAM,QAAQ,GAChB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,GACrC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAE5D,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,EAAE,QAAQ,CAAC;CACvB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,QAAQ,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,YAAY,CAAC;IACnB,WAAW,EAAE,QAAQ,EAAE,CAAC;CACzB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,iBAAiB,CAAC;IACxB,WAAW,EAAE,QAAQ,EAAE,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,QAAQ,EAAE,EAAE,CAAC;CA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AAG,QAAQ;IAC9D,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;CACxB;AAED,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,iBAAiB,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,KAAK,YAAY,GAAG,IAAI,CAAC;IAC7E;;;;OAIG;IACH,cAAc,CAAC,EAAE,CACf,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,OAAO,KACb,YAAY,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,YAAY,EACnB,OAAO,EAAE,OAAO,KACb,YAAY,GAAG,IAAI,CAAC;CAC1B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { MarkerProps } from './Marker.types';
|
|
3
|
-
export type { MarkerProps, MarkerPressEvent, MarkerDragEvent, } from './Marker.types';
|
|
3
|
+
export type { CalloutOptions, MarkerProps, MarkerPressEvent, MarkerDragEvent, } from './Marker.types';
|
|
4
4
|
export declare class Marker extends React.PureComponent<MarkerProps> {
|
|
5
5
|
private getStyle;
|
|
6
6
|
private _cachedZIndex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAI9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,YAAY,EACV,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AAExB,qBAAa,MAAO,SAAQ,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC;IAC1D,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,YAAY,CAAM;IAE1B,MAAM;CA2DP"}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ComponentType, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import type { NativeSyntheticEvent } from 'react-native';
|
|
3
3
|
import type { Coordinate, Point, PressEventPayload } from '../types';
|
|
4
4
|
export type MarkerPressEvent = NativeSyntheticEvent<PressEventPayload>;
|
|
5
5
|
export type MarkerDragEvent = NativeSyntheticEvent<PressEventPayload>;
|
|
6
|
+
export interface CalloutOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Whether to wrap the callout in the native platform bubble.
|
|
9
|
+
* Set to `false` to render custom content directly without the native callout chrome.
|
|
10
|
+
*
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
bubbled?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Anchor point for the callout relative to the marker position.
|
|
16
|
+
* `{x: 0.5, y: 1}` places the bottom-center of the callout at the marker.
|
|
17
|
+
*
|
|
18
|
+
* @note Not supported on web.
|
|
19
|
+
* @default {x: 0.5, y: 1}
|
|
20
|
+
*/
|
|
21
|
+
anchor?: Point;
|
|
22
|
+
}
|
|
6
23
|
export interface MarkerProps {
|
|
7
24
|
/**
|
|
8
25
|
* Name used for debugging purposes
|
|
@@ -66,6 +83,15 @@ export interface MarkerProps {
|
|
|
66
83
|
* Called when marker drag ends
|
|
67
84
|
*/
|
|
68
85
|
onDragEnd?: (event: MarkerDragEvent) => void;
|
|
86
|
+
/**
|
|
87
|
+
* Callout content displayed when marker is tapped.
|
|
88
|
+
* Pass a `ReactElement` for inline content or a `ComponentType` to be instantiated.
|
|
89
|
+
*/
|
|
90
|
+
callout?: ComponentType<unknown> | ReactElement;
|
|
91
|
+
/**
|
|
92
|
+
* Callout configuration options.
|
|
93
|
+
*/
|
|
94
|
+
calloutOptions?: CalloutOptions;
|
|
69
95
|
/**
|
|
70
96
|
* Custom marker view
|
|
71
97
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marker.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Marker.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACpE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAErE,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AACvE,MAAM,MAAM,eAAe,GAAG,oBAAoB,CAAC,iBAAiB,CAAC,CAAC;AAEtE,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC5C;;OAEG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC/C;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAChD;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,GAAG,YAAY,CAAC;IAChD;;OAEG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { MarkerProps } from './Marker.types';
|
|
2
|
-
export declare const Marker: ({ coordinate, title, anchor, zIndex, rotate, scale, draggable, onPress, onDragStart, onDragChange, onDragEnd, children, }: MarkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const Marker: ({ coordinate, title, description, anchor, zIndex, rotate, scale, draggable, onPress, onDragStart, onDragChange, onDragEnd, callout, calloutOptions, children, }: MarkerProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=Marker.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marker.web.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.web.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Marker.web.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.web.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA+ClD,eAAO,MAAM,MAAM,GAAI,iKAgBpB,WAAW,4CAqIb,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Marker } from './Marker';
|
|
2
|
-
export type { MarkerProps, MarkerPressEvent, MarkerDragEvent, } from './Marker.types';
|
|
2
|
+
export type { CalloutOptions, MarkerProps, MarkerPressEvent, MarkerDragEvent, } from './Marker.types';
|
|
3
3
|
export { Polygon } from './Polygon';
|
|
4
4
|
export type { PolygonProps } from './Polygon.types';
|
|
5
5
|
export { Polyline } from './Polyline';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,aAAa,EACb,cAAc,EACd,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EACV,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,aAAa,EACb,cAAc,EACd,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { Marker } from './Marker.web';
|
|
2
2
|
export { Polygon } from './Polygon.web';
|
|
3
3
|
export { Polyline } from './Polyline.web';
|
|
4
|
-
export type { MarkerProps } from './Marker.types';
|
|
4
|
+
export type { CalloutOptions, MarkerProps } from './Marker.types';
|
|
5
5
|
export type { PolygonProps } from './Polygon.types';
|
|
6
6
|
export type { PolylineProps } from './Polyline.types';
|
|
7
7
|
export { GeoJson } from './GeoJson';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/components/index.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/components/index.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ViewProps, HostComponent } from 'react-native';
|
|
2
|
+
import type { Double, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export interface Point {
|
|
4
|
+
x: Double;
|
|
5
|
+
y: Double;
|
|
6
|
+
}
|
|
7
|
+
export interface NativeProps extends ViewProps {
|
|
8
|
+
bubbled?: WithDefault<boolean, true>;
|
|
9
|
+
anchor?: Point;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: HostComponent<NativeProps>;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=LuggCalloutViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LuggCalloutViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggCalloutViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACZ,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -2,7 +2,7 @@ export { MapView } from './MapView';
|
|
|
2
2
|
export { MapProvider } from './MapProvider';
|
|
3
3
|
export type { MapProviderProps } from './MapProvider.types';
|
|
4
4
|
export { Marker } from './components';
|
|
5
|
-
export type { MarkerProps, MarkerPressEvent, MarkerDragEvent, } from './components';
|
|
5
|
+
export type { CalloutOptions, MarkerProps, MarkerPressEvent, MarkerDragEvent, } from './components';
|
|
6
6
|
export { Polygon } from './components';
|
|
7
7
|
export type { PolygonProps } from './components';
|
|
8
8
|
export { Polyline } from './components';
|
|
@@ -11,5 +11,5 @@ export { GeoJson } from './components';
|
|
|
11
11
|
export type { GeoJsonProps } from './components';
|
|
12
12
|
export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, SetEdgeInsetsOptions, CameraEventPayload, MapCameraEvent, MapPressEvent, } from './MapView.types';
|
|
13
13
|
export type { MapProvider as MapProviderType, MapTheme, Coordinate, Point, EdgeInsets, PressEventPayload, } from './types';
|
|
14
|
-
export type { GeoJSON, Feature, FeatureCollection, Geometry, Position, } from './components/GeoJson.types';
|
|
14
|
+
export type { GeoJSON, Feature, FeatureCollection, FeatureProperties, Geometry, Position, } from './components/GeoJson.types';
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAA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,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,QAAQ,EACR,UAAU,EACV,KAAK,EACL,UAAU,EACV,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,QAAQ,GACT,MAAM,4BAA4B,CAAC"}
|
|
@@ -2,7 +2,7 @@ export { MapView } from './MapView.web';
|
|
|
2
2
|
export { MapProvider } from './MapProvider.web';
|
|
3
3
|
export type { MapProviderProps } from './MapProvider.types';
|
|
4
4
|
export { Marker } from './components/index.web';
|
|
5
|
-
export type { MarkerProps } from './components/index.web';
|
|
5
|
+
export type { CalloutOptions, MarkerProps } from './components/index.web';
|
|
6
6
|
export { Polygon } from './components/index.web';
|
|
7
7
|
export type { PolygonProps } from './components/index.web';
|
|
8
8
|
export { Polyline } from './components/index.web';
|
|
@@ -11,5 +11,5 @@ export { GeoJson } from './components/index.web';
|
|
|
11
11
|
export type { GeoJsonProps } from './components/index.web';
|
|
12
12
|
export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, CameraEventPayload, } from './MapView.types';
|
|
13
13
|
export type { MapProvider as MapProviderType, Coordinate, Point, EdgeInsets, } from './types';
|
|
14
|
-
export type { GeoJSON, Feature, FeatureCollection, Geometry, Position, } from './components/GeoJson.types';
|
|
14
|
+
export type { GeoJSON, Feature, FeatureCollection, FeatureProperties, Geometry, Position, } from './components/GeoJson.types';
|
|
15
15
|
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACx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
|
"name": "@lugg/maps",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"description": "Universal maps for React Native.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -147,6 +147,7 @@
|
|
|
147
147
|
"componentProvider": {
|
|
148
148
|
"LuggMapView": "LuggMapView",
|
|
149
149
|
"LuggMarkerView": "LuggMarkerView",
|
|
150
|
+
"LuggCalloutView": "LuggCalloutView",
|
|
150
151
|
"LuggMapWrapperView": "LuggMapWrapperView",
|
|
151
152
|
"LuggPolylineView": "LuggPolylineView",
|
|
152
153
|
"LuggPolygonView": "LuggPolygonView"
|
package/src/MapProvider.web.tsx
CHANGED
|
@@ -2,11 +2,21 @@ import { createContext, useContext } from 'react';
|
|
|
2
2
|
import { APIProvider } from '@vis.gl/react-google-maps';
|
|
3
3
|
import type { MapProviderProps } from './MapProvider.types';
|
|
4
4
|
|
|
5
|
+
type CalloutCloseListener = () => void;
|
|
6
|
+
|
|
5
7
|
export const MapContext = createContext<{
|
|
6
8
|
map: google.maps.Map | null;
|
|
7
9
|
isDragging: boolean;
|
|
8
10
|
moveCamera: (coordinate: { latitude: number; longitude: number }) => void;
|
|
9
|
-
|
|
11
|
+
onCalloutClose: (listener: CalloutCloseListener) => () => void;
|
|
12
|
+
closeCallouts: (except?: CalloutCloseListener) => void;
|
|
13
|
+
}>({
|
|
14
|
+
map: null,
|
|
15
|
+
isDragging: false,
|
|
16
|
+
moveCamera: () => {},
|
|
17
|
+
onCalloutClose: () => () => {},
|
|
18
|
+
closeCallouts: () => {},
|
|
19
|
+
});
|
|
10
20
|
|
|
11
21
|
export const useMapContext = () => useContext(MapContext);
|
|
12
22
|
|
package/src/MapView.web.tsx
CHANGED
|
@@ -285,6 +285,23 @@ export const MapView = forwardRef<MapViewRef, MapViewProps>(function MapView(
|
|
|
285
285
|
const longPressTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
286
286
|
const longPressFired = useRef(false);
|
|
287
287
|
|
|
288
|
+
const calloutListeners = useRef(new Set<() => void>()).current;
|
|
289
|
+
const onCalloutClose = useCallback(
|
|
290
|
+
(listener: () => void) => {
|
|
291
|
+
calloutListeners.add(listener);
|
|
292
|
+
return () => calloutListeners.delete(listener);
|
|
293
|
+
},
|
|
294
|
+
[calloutListeners]
|
|
295
|
+
);
|
|
296
|
+
const closeCallouts = useCallback(
|
|
297
|
+
(except?: () => void) => {
|
|
298
|
+
calloutListeners.forEach((l) => {
|
|
299
|
+
if (l !== except) l();
|
|
300
|
+
});
|
|
301
|
+
},
|
|
302
|
+
[calloutListeners]
|
|
303
|
+
);
|
|
304
|
+
|
|
288
305
|
const getPoint = useCallback((domEvent?: Event) => {
|
|
289
306
|
const el = containerRef.current as unknown as HTMLElement | null;
|
|
290
307
|
if (!domEvent || !el) return { x: 0, y: 0 };
|
|
@@ -299,6 +316,7 @@ export const MapView = forwardRef<MapViewRef, MapViewProps>(function MapView(
|
|
|
299
316
|
longPressFired.current = false;
|
|
300
317
|
return;
|
|
301
318
|
}
|
|
319
|
+
closeCallouts();
|
|
302
320
|
const latLng = event.detail.latLng;
|
|
303
321
|
if (!onPress || !latLng) return;
|
|
304
322
|
onPress(
|
|
@@ -308,7 +326,7 @@ export const MapView = forwardRef<MapViewRef, MapViewProps>(function MapView(
|
|
|
308
326
|
})
|
|
309
327
|
);
|
|
310
328
|
},
|
|
311
|
-
[onPress, getPoint]
|
|
329
|
+
[onPress, getPoint, closeCallouts]
|
|
312
330
|
);
|
|
313
331
|
|
|
314
332
|
const handleMouseDown = useCallback(
|
|
@@ -419,7 +437,13 @@ export const MapView = forwardRef<MapViewRef, MapViewProps>(function MapView(
|
|
|
419
437
|
|
|
420
438
|
return (
|
|
421
439
|
<MapContext.Provider
|
|
422
|
-
value={{
|
|
440
|
+
value={{
|
|
441
|
+
map,
|
|
442
|
+
isDragging,
|
|
443
|
+
moveCamera: panToCoordinate,
|
|
444
|
+
onCalloutClose,
|
|
445
|
+
closeCallouts,
|
|
446
|
+
}}
|
|
423
447
|
>
|
|
424
448
|
<View ref={containerRef} style={style}>
|
|
425
449
|
<Map
|
|
@@ -56,11 +56,22 @@ export type Geometry =
|
|
|
56
56
|
| MultiPolygon
|
|
57
57
|
| GeometryCollection;
|
|
58
58
|
|
|
59
|
+
export interface FeatureProperties {
|
|
60
|
+
'title'?: string;
|
|
61
|
+
'description'?: string;
|
|
62
|
+
'fill'?: string;
|
|
63
|
+
'fill-opacity'?: number;
|
|
64
|
+
'stroke'?: string;
|
|
65
|
+
'stroke-width'?: number;
|
|
66
|
+
'stroke-opacity'?: number;
|
|
67
|
+
[key: string]: unknown;
|
|
68
|
+
}
|
|
69
|
+
|
|
59
70
|
export interface Feature<G extends Geometry = Geometry> {
|
|
60
71
|
type: 'Feature';
|
|
61
72
|
id?: string | number;
|
|
62
73
|
geometry: G;
|
|
63
|
-
properties:
|
|
74
|
+
properties: FeatureProperties | null;
|
|
64
75
|
}
|
|
65
76
|
|
|
66
77
|
export interface FeatureCollection<G extends Geometry = Geometry> {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { isValidElement } from 'react';
|
|
2
2
|
import { StyleSheet } from 'react-native';
|
|
3
3
|
import LuggMarkerViewNativeComponent from '../fabric/LuggMarkerViewNativeComponent';
|
|
4
|
+
import LuggCalloutViewNativeComponent from '../fabric/LuggCalloutViewNativeComponent';
|
|
4
5
|
import type { MarkerProps } from './Marker.types';
|
|
5
6
|
|
|
6
7
|
export type {
|
|
8
|
+
CalloutOptions,
|
|
7
9
|
MarkerProps,
|
|
8
10
|
MarkerPressEvent,
|
|
9
11
|
MarkerDragEvent,
|
|
@@ -38,9 +40,19 @@ export class Marker extends React.PureComponent<MarkerProps> {
|
|
|
38
40
|
onDragStart,
|
|
39
41
|
onDragChange,
|
|
40
42
|
onDragEnd,
|
|
43
|
+
callout,
|
|
44
|
+
calloutOptions,
|
|
41
45
|
children,
|
|
42
46
|
} = this.props;
|
|
43
47
|
|
|
48
|
+
const calloutContent = callout
|
|
49
|
+
? isValidElement(callout)
|
|
50
|
+
? callout
|
|
51
|
+
: React.createElement(callout)
|
|
52
|
+
: null;
|
|
53
|
+
const calloutBubbled = calloutOptions?.bubbled ?? true;
|
|
54
|
+
const calloutAnchor = calloutOptions?.anchor;
|
|
55
|
+
|
|
44
56
|
return (
|
|
45
57
|
<LuggMarkerViewNativeComponent
|
|
46
58
|
style={this.getStyle(zIndex)}
|
|
@@ -59,6 +71,15 @@ export class Marker extends React.PureComponent<MarkerProps> {
|
|
|
59
71
|
onMarkerDragEnd={onDragEnd}
|
|
60
72
|
>
|
|
61
73
|
{children}
|
|
74
|
+
{calloutContent && (
|
|
75
|
+
<LuggCalloutViewNativeComponent
|
|
76
|
+
style={calloutStyles.callout}
|
|
77
|
+
bubbled={calloutBubbled}
|
|
78
|
+
anchor={calloutAnchor}
|
|
79
|
+
>
|
|
80
|
+
{calloutContent}
|
|
81
|
+
</LuggCalloutViewNativeComponent>
|
|
82
|
+
)}
|
|
62
83
|
</LuggMarkerViewNativeComponent>
|
|
63
84
|
);
|
|
64
85
|
}
|
|
@@ -70,3 +91,10 @@ const styles = StyleSheet.create({
|
|
|
70
91
|
pointerEvents: 'box-none',
|
|
71
92
|
},
|
|
72
93
|
});
|
|
94
|
+
|
|
95
|
+
const calloutStyles = StyleSheet.create({
|
|
96
|
+
callout: {
|
|
97
|
+
position: 'absolute',
|
|
98
|
+
pointerEvents: 'box-none',
|
|
99
|
+
},
|
|
100
|
+
});
|
|
@@ -1,10 +1,28 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { ComponentType, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import type { NativeSyntheticEvent } from 'react-native';
|
|
3
3
|
import type { Coordinate, Point, PressEventPayload } from '../types';
|
|
4
4
|
|
|
5
5
|
export type MarkerPressEvent = NativeSyntheticEvent<PressEventPayload>;
|
|
6
6
|
export type MarkerDragEvent = NativeSyntheticEvent<PressEventPayload>;
|
|
7
7
|
|
|
8
|
+
export interface CalloutOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Whether to wrap the callout in the native platform bubble.
|
|
11
|
+
* Set to `false` to render custom content directly without the native callout chrome.
|
|
12
|
+
*
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
bubbled?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Anchor point for the callout relative to the marker position.
|
|
18
|
+
* `{x: 0.5, y: 1}` places the bottom-center of the callout at the marker.
|
|
19
|
+
*
|
|
20
|
+
* @note Not supported on web.
|
|
21
|
+
* @default {x: 0.5, y: 1}
|
|
22
|
+
*/
|
|
23
|
+
anchor?: Point;
|
|
24
|
+
}
|
|
25
|
+
|
|
8
26
|
export interface MarkerProps {
|
|
9
27
|
/**
|
|
10
28
|
* Name used for debugging purposes
|
|
@@ -68,6 +86,15 @@ export interface MarkerProps {
|
|
|
68
86
|
* Called when marker drag ends
|
|
69
87
|
*/
|
|
70
88
|
onDragEnd?: (event: MarkerDragEvent) => void;
|
|
89
|
+
/**
|
|
90
|
+
* Callout content displayed when marker is tapped.
|
|
91
|
+
* Pass a `ReactElement` for inline content or a `ComponentType` to be instantiated.
|
|
92
|
+
*/
|
|
93
|
+
callout?: ComponentType<unknown> | ReactElement;
|
|
94
|
+
/**
|
|
95
|
+
* Callout configuration options.
|
|
96
|
+
*/
|
|
97
|
+
calloutOptions?: CalloutOptions;
|
|
71
98
|
/**
|
|
72
99
|
* Custom marker view
|
|
73
100
|
*/
|