expo-arcgis 0.2.3 → 0.2.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../src/MapView.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAyBtE;;;GAGG;AACH,eAAO,MAAM,OAAO;;iDA0CnB,CAAC"}
1
+ {"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../src/MapView.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA0BtE;;;GAGG;AACH,eAAO,MAAM,OAAO;;iDA4CnB,CAAC"}
package/build/MapView.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { forwardRef, useImperativeHandle, useMemo, useRef, useState, } from 'react';
3
3
  import { GeoViewContext, useGeoModel } from './contexts';
4
+ import { sharedObjectId } from './utils/sharedObjectId';
4
5
  const NativeMapView = requireNativeView('ExpoArcgis');
5
6
  /**
6
7
  * Declarative 2D map view. Renders the `ArcGISMap` from the nearest `<Map>`, hosts the
@@ -26,7 +27,10 @@ export const MapView = forwardRef(function MapView({ children, ...props }, handl
26
27
  // The native view exposes `identify` on its ref, so hand that ref over directly. (It's
27
28
  // attached before this layout-phase handle runs, so reading it here is safe.)
28
29
  useImperativeHandle(handle, () => nativeRef.current, []);
29
- return (<NativeMapView ref={nativeRef} map={map} graphicsOverlays={overlays} imageOverlays={imageOverlays} geometryEditor={geometryEditor} {...props}>
30
+ return (<NativeMapView ref={nativeRef}
31
+ // SharedObjects are passed by registry id so they survive the Fabric prop pipeline on
32
+ // expo-modules-core < 56.0.13 (which lacks the auto-unwrap from expo/expo#46212).
33
+ map={sharedObjectId(map)} graphicsOverlays={overlays.map(sharedObjectId)} imageOverlays={imageOverlays.map(sharedObjectId)} geometryEditor={sharedObjectId(geometryEditor)} {...props}>
30
34
  <GeoViewContext.Provider value={host}>{children}</GeoViewContext.Provider>
31
35
  </NativeMapView>);
32
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"MapView.js","sourceRoot":"","sources":["../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAC;AASf,OAAO,EAAE,cAAc,EAAE,WAAW,EAAoB,MAAM,YAAY,CAAC;AAgB3E,MAAM,aAAa,GAAG,iBAAiB,CAAqB,YAAY,CAAC,CAAC;AAE1E;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAC/B,SAAS,OAAO,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,MAAM;IAC7C,MAAM,GAAG,GAAG,WAAW,EAAY,CAAC;IACpC,iFAAiF;IACjF,MAAM,SAAS,GAAG,MAAM,CAAM,IAAI,CAAC,CAAC;IAEpC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAuB,EAAE,CAAC,CAAC;IACnE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAoB,EAAE,CAAC,CAAC;IAC1E,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CAA2B,IAAI,CAAC,CAAC;IACrF,MAAM,IAAI,GAAG,OAAO,CAClB,GAAG,EAAE,CAAC,CAAC;QACL,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CA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C,CAC7B,cAAc,CAAC,CAAC,cAAc,CAAC,CAC/B,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,QAAQ,CAC3E;MAAA,EAAE,aAAa,CAAC,CACjB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport {\n forwardRef,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n type ReactNode,\n type Ref,\n} from 'react';\n\nimport type { MapViewHandle, MapViewProps } from './ExpoArcgis.types';\nimport type {\n MapRef,\n GraphicsOverlayRef,\n GeometryEditorRef,\n ImageOverlayRef,\n} from './ExpoArcgisModule';\nimport { GeoViewContext, useGeoModel, type GeoViewHost } from './contexts';\n\ntype NativeMapViewProps = MapViewProps & {\n /** The native map handle (SharedObject), passed by reference as a view prop. */\n map: MapRef;\n /** Graphics overlays declared as `<GraphicsOverlay>` children, passed by reference. */\n graphicsOverlays: GraphicsOverlayRef[];\n /** Image overlays declared as `<ImageOverlay>` children, passed by reference. */\n imageOverlays: ImageOverlayRef[];\n /** Interactive geometry editor declared as a `<GeometryEditor>` child, passed by reference. */\n geometryEditor?: GeometryEditorRef | null;\n /** Ref to the native view, whose `identify` async function is callable through it. */\n ref?: Ref<unknown>;\n children?: ReactNode;\n};\n\nconst NativeMapView = requireNativeView<NativeMapViewProps>('ExpoArcgis');\n\n/**\n * Declarative 2D map view. Renders the `ArcGISMap` from the nearest `<Map>`, hosts the\n * `<GraphicsOverlay>` / `<GeometryEditor>` children, and exposes `identify` via a `ref`.\n */\nexport const MapView = forwardRef<MapViewHandle, PropsWithChildren<MapViewProps>>(\n function MapView({ children, ...props }, handle) {\n const map = useGeoModel() as MapRef;\n // The native view exposes an async `identify` function callable through its ref.\n const nativeRef = useRef<any>(null);\n\n const [overlays, setOverlays] = useState<GraphicsOverlayRef[]>([]);\n const [imageOverlays, setImageOverlays] = useState<ImageOverlayRef[]>([]);\n const [geometryEditor, setGeometryEditor] = useState<GeometryEditorRef | null>(null);\n const host = useMemo<GeoViewHost>(\n () => ({\n add: (overlay) => setOverlays((prev) => (prev.includes(overlay) ? prev : [...prev, overlay])),\n remove: (overlay) => setOverlays((prev) => prev.filter((o) => o !== overlay)),\n addImageOverlay: (overlay) =>\n setImageOverlays((prev) => (prev.includes(overlay) ? prev : [...prev, overlay])),\n removeImageOverlay: (overlay) =>\n setImageOverlays((prev) => prev.filter((o) => o !== overlay)),\n setGeometryEditor: (editor) => setGeometryEditor(editor),\n // Visual analyses (viewshed / line-of-sight) are 3D only — no-op on a 2D map.\n addAnalysisOverlay: () => {},\n removeAnalysisOverlay: () => {},\n }),\n []\n );\n\n // The native view exposes `identify` on its ref, so hand that ref over directly. (It's\n // attached before this layout-phase handle runs, so reading it here is safe.)\n useImperativeHandle(handle, () => nativeRef.current as MapViewHandle, []);\n\n return (\n <NativeMapView\n ref={nativeRef}\n map={map}\n graphicsOverlays={overlays}\n imageOverlays={imageOverlays}\n geometryEditor={geometryEditor}\n {...props}\n >\n <GeoViewContext.Provider value={host}>{children}</GeoViewContext.Provider>\n </NativeMapView>\n );\n }\n);\n"]}
1
+ {"version":3,"file":"MapView.js","sourceRoot":"","sources":["../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAC;AASf,OAAO,EAAE,cAAc,EAAE,WAAW,EAAoB,MAAM,YAAY,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAgBxD,MAAM,aAAa,GAAG,iBAAiB,CAAqB,YAAY,CAAC,CAAC;AAE1E;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,UAAU,CAC/B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CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC;QAC/D,iBAAiB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC;QACxD,8EAA8E;QAC9E,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC;QAC5B,qBAAqB,EAAE,GAAG,EAAE,GAAE,CAAC;KAChC,CAAC,EACF,EAAE,CACH,CAAC;IAEF,uFAAuF;IACvF,8EAA8E;IAC9E,mBAAmB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,OAAwB,EAAE,EAAE,CAAC,CAAC;IAE1E,OAAO,CACL,CAAC,aAAa,CACZ,GAAG,CAAC,CAAC,SAAS,CAAC;IACf,sFAAsF;IACtF,kFAAkF;IAClF,GAAG,CAAC,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CACzB,gBAAgB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAC/C,aAAa,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CACjD,cAAc,CAAC,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAC/C,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,QAAQ,CAC3E;MAAA,EAAE,aAAa,CAAC,CACjB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport {\n forwardRef,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n type ReactNode,\n type Ref,\n} from 'react';\n\nimport type { MapViewHandle, MapViewProps } from './ExpoArcgis.types';\nimport type {\n MapRef,\n GraphicsOverlayRef,\n GeometryEditorRef,\n ImageOverlayRef,\n} from './ExpoArcgisModule';\nimport { GeoViewContext, useGeoModel, type GeoViewHost } from './contexts';\nimport { sharedObjectId } from './utils/sharedObjectId';\n\ntype NativeMapViewProps = MapViewProps & {\n /** The native map handle (SharedObject), passed by reference as a view prop. */\n map: MapRef;\n /** Graphics overlays declared as `<GraphicsOverlay>` children, passed by reference. */\n graphicsOverlays: GraphicsOverlayRef[];\n /** Image overlays declared as `<ImageOverlay>` children, passed by reference. */\n imageOverlays: ImageOverlayRef[];\n /** Interactive geometry editor declared as a `<GeometryEditor>` child, passed by reference. */\n geometryEditor?: GeometryEditorRef | null;\n /** Ref to the native view, whose `identify` async function is callable through it. */\n ref?: Ref<unknown>;\n children?: ReactNode;\n};\n\nconst NativeMapView = requireNativeView<NativeMapViewProps>('ExpoArcgis');\n\n/**\n * Declarative 2D map view. Renders the `ArcGISMap` from the nearest `<Map>`, hosts the\n * `<GraphicsOverlay>` / `<GeometryEditor>` children, and exposes `identify` via a `ref`.\n */\nexport const MapView = forwardRef<MapViewHandle, PropsWithChildren<MapViewProps>>(\n function MapView({ children, ...props }, handle) {\n const map = useGeoModel() as MapRef;\n // The native view exposes an async `identify` function callable through its ref.\n const nativeRef = useRef<any>(null);\n\n const [overlays, setOverlays] = useState<GraphicsOverlayRef[]>([]);\n const [imageOverlays, setImageOverlays] = useState<ImageOverlayRef[]>([]);\n const [geometryEditor, setGeometryEditor] = useState<GeometryEditorRef | null>(null);\n const host = useMemo<GeoViewHost>(\n () => ({\n add: (overlay) => setOverlays((prev) => (prev.includes(overlay) ? prev : [...prev, overlay])),\n remove: (overlay) => setOverlays((prev) => prev.filter((o) => o !== overlay)),\n addImageOverlay: (overlay) =>\n setImageOverlays((prev) => (prev.includes(overlay) ? prev : [...prev, overlay])),\n removeImageOverlay: (overlay) =>\n setImageOverlays((prev) => prev.filter((o) => o !== overlay)),\n setGeometryEditor: (editor) => setGeometryEditor(editor),\n // Visual analyses (viewshed / line-of-sight) are 3D only — no-op on a 2D map.\n addAnalysisOverlay: () => {},\n removeAnalysisOverlay: () => {},\n }),\n []\n );\n\n // The native view exposes `identify` on its ref, so hand that ref over directly. (It's\n // attached before this layout-phase handle runs, so reading it here is safe.)\n useImperativeHandle(handle, () => nativeRef.current as MapViewHandle, []);\n\n return (\n <NativeMapView\n ref={nativeRef}\n // SharedObjects are passed by registry id so they survive the Fabric prop pipeline on\n // expo-modules-core < 56.0.13 (which lacks the auto-unwrap from expo/expo#46212).\n map={sharedObjectId(map)}\n graphicsOverlays={overlays.map(sharedObjectId)}\n imageOverlays={imageOverlays.map(sharedObjectId)}\n geometryEditor={sharedObjectId(geometryEditor)}\n {...props}\n >\n <GeoViewContext.Provider value={host}>{children}</GeoViewContext.Provider>\n </NativeMapView>\n );\n }\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SceneView.d.ts","sourceRoot":"","sources":["../src/SceneView.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAkB1E;;;GAGG;AACH,eAAO,MAAM,SAAS;;mDAwCrB,CAAC"}
1
+ {"version":3,"file":"SceneView.d.ts","sourceRoot":"","sources":["../src/SceneView.tsx"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAmB1E;;;GAGG;AACH,eAAO,MAAM,SAAS;;mDAyCrB,CAAC"}
@@ -1,12 +1,13 @@
1
1
  import { requireNativeView } from 'expo';
2
2
  import { forwardRef, useImperativeHandle, useMemo, useRef, useState, } from 'react';
3
3
  import { GeoViewContext, useGeoModel } from './contexts';
4
+ import { sharedObjectId } from './utils/sharedObjectId';
4
5
  const NativeSceneView = requireNativeView('ExpoArcgis', 'ExpoArcgisSceneView');
5
6
  /**
6
7
  * Declarative 3D scene view. Renders the `Scene` from the nearest `<Scene>`, hosts the
7
8
  * `<GraphicsOverlay>` / `<AnalysisOverlay>` children, and exposes `retryLoad` via a `ref`.
8
9
  */
9
- export const SceneView = forwardRef(function SceneView({ children, ...props }, handle) {
10
+ export const SceneView = forwardRef(function SceneView({ children, orbitGraphic, ...props }, handle) {
10
11
  const scene = useGeoModel();
11
12
  // The native view exposes an async `retryLoad` function callable through its ref.
12
13
  const nativeRef = useRef(null);
@@ -25,7 +26,7 @@ export const SceneView = forwardRef(function SceneView({ children, ...props }, h
25
26
  }), []);
26
27
  // The native view exposes `retryLoad` on its ref, so hand that ref over directly.
27
28
  useImperativeHandle(handle, () => nativeRef.current, []);
28
- return (<NativeSceneView ref={nativeRef} scene={scene} graphicsOverlays={overlays} analysisOverlays={analysisOverlays} {...props}>
29
+ return (<NativeSceneView ref={nativeRef} scene={sharedObjectId(scene)} graphicsOverlays={overlays.map(sharedObjectId)} analysisOverlays={analysisOverlays.map(sharedObjectId)} orbitGraphic={sharedObjectId(orbitGraphic)} {...props}>
29
30
  <GeoViewContext.Provider value={host}>{children}</GeoViewContext.Provider>
30
31
  </NativeSceneView>);
31
32
  });
@@ -1 +1 @@
1
- {"version":3,"file":"SceneView.js","sourceRoot":"","sources":["../src/SceneView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,cAAc,EAAE,WAAW,EAAoB,MAAM,YAAY,CAAC;AAc3E,MAAM,eAAe,GAAG,iBAAiB,CAAuB,YAAY,EAAE,qBAAqB,CAAC,CAAC;AAErG;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CACjC,SAAS,SAAS,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,MAAM;IAC/C,MAAM,KAAK,GAAG,WAAW,EAAc,CAAC;IACxC,kFAAkF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AG,EAAE,GAAE,CAAC;KAC7B,CAAC,EACF,EAAE,CACH,CAAC;IAEF,kFAAkF;IAClF,mBAAmB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,OAA0B,EAAE,EAAE,CAAC,CAAC;IAE5E,OAAO,CACL,CAAC,eAAe,CACd,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,CACb,gBAAgB,CAAC,CAAC,QAAQ,CAAC,CAC3B,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,QAAQ,CAC3E;MAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport {\n forwardRef,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n type ReactNode,\n type Ref,\n} from 'react';\n\nimport type { SceneViewHandle, SceneViewProps } from './ExpoArcgis.types';\nimport type { SceneRef, GraphicsOverlayRef, AnalysisOverlayRef } from './ExpoArcgisModule';\nimport { GeoViewContext, useGeoModel, type GeoViewHost } from './contexts';\n\ntype NativeSceneViewProps = SceneViewProps & {\n /** The native scene handle (SharedObject), passed by reference as a view prop. */\n scene: SceneRef;\n /** Graphics overlays declared as `<GraphicsOverlay>` children, passed by reference. */\n graphicsOverlays: GraphicsOverlayRef[];\n /** Analysis overlays declared as `<AnalysisOverlay>` children, passed by reference. */\n analysisOverlays: AnalysisOverlayRef[];\n /** Ref to the native view, whose `retryLoad` async function is callable through it. */\n ref?: Ref<unknown>;\n children?: ReactNode;\n};\n\nconst NativeSceneView = requireNativeView<NativeSceneViewProps>('ExpoArcgis', 'ExpoArcgisSceneView');\n\n/**\n * Declarative 3D scene view. Renders the `Scene` from the nearest `<Scene>`, hosts the\n * `<GraphicsOverlay>` / `<AnalysisOverlay>` children, and exposes `retryLoad` via a `ref`.\n */\nexport const SceneView = forwardRef<SceneViewHandle, PropsWithChildren<SceneViewProps>>(\n function SceneView({ children, ...props }, handle) {\n const scene = useGeoModel() as SceneRef;\n // The native view exposes an async `retryLoad` function callable through its ref.\n const nativeRef = useRef<any>(null);\n\n const [overlays, setOverlays] = useState<GraphicsOverlayRef[]>([]);\n const [analysisOverlays, setAnalysisOverlays] = useState<AnalysisOverlayRef[]>([]);\n const host = useMemo<GeoViewHost>(\n () => ({\n add: (overlay) => setOverlays((prev) => (prev.includes(overlay) ? prev : [...prev, overlay])),\n remove: (overlay) => setOverlays((prev) => prev.filter((o) => o !== overlay)),\n // The SDK binds a GeometryEditor to MapView only; 3D scene editing is not supported.\n setGeometryEditor: () => {},\n addAnalysisOverlay: (overlay) =>\n setAnalysisOverlays((prev) => (prev.includes(overlay) ? prev : [...prev, overlay])),\n removeAnalysisOverlay: (overlay) =>\n setAnalysisOverlays((prev) => prev.filter((o) => o !== overlay)),\n // Image overlays are bound to <MapView> (2D) only.\n addImageOverlay: () => {},\n removeImageOverlay: () => {},\n }),\n []\n );\n\n // The native view exposes `retryLoad` on its ref, so hand that ref over directly.\n useImperativeHandle(handle, () => nativeRef.current as SceneViewHandle, []);\n\n return (\n <NativeSceneView\n ref={nativeRef}\n scene={scene}\n graphicsOverlays={overlays}\n analysisOverlays={analysisOverlays}\n {...props}\n >\n <GeoViewContext.Provider value={host}>{children}</GeoViewContext.Provider>\n </NativeSceneView>\n );\n }\n);\n"]}
1
+ {"version":3,"file":"SceneView.js","sourceRoot":"","sources":["../src/SceneView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EACL,UAAU,EACV,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,cAAc,EAAE,WA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C,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;QACrF,qBAAqB,EAAE,CAAC,OAAO,EAAE,EAAE,CACjC,mBAAmB,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC;QAClE,mDAAmD;QACnD,eAAe,EAAE,GAAG,EAAE,GAAE,CAAC;QACzB,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC;KAC7B,CAAC,EACF,EAAE,CACH,CAAC;IAEF,kFAAkF;IAClF,mBAAmB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,OAA0B,EAAE,EAAE,CAAC,CAAC;IAE5E,OAAO,CACL,CAAC,eAAe,CACd,GAAG,CAAC,CAAC,SAAS,CAAC,CACf,KAAK,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAC7B,gBAAgB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAC/C,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CACvD,YAAY,CAAC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC,CAC3C,IAAI,KAAK,CAAC,CAEV;QAAA,CAAC,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC,QAAQ,CAC3E;MAAA,EAAE,eAAe,CAAC,CACnB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["import { requireNativeView } from 'expo';\nimport {\n forwardRef,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type PropsWithChildren,\n type ReactNode,\n type Ref,\n} from 'react';\n\nimport type { SceneViewHandle, SceneViewProps } from './ExpoArcgis.types';\nimport type { SceneRef, GraphicsOverlayRef, AnalysisOverlayRef } from './ExpoArcgisModule';\nimport { GeoViewContext, useGeoModel, type GeoViewHost } from './contexts';\nimport { sharedObjectId } from './utils/sharedObjectId';\n\ntype NativeSceneViewProps = SceneViewProps & {\n /** The native scene handle (SharedObject), passed by reference as a view prop. */\n scene: SceneRef;\n /** Graphics overlays declared as `<GraphicsOverlay>` children, passed by reference. */\n graphicsOverlays: GraphicsOverlayRef[];\n /** Analysis overlays declared as `<AnalysisOverlay>` children, passed by reference. */\n analysisOverlays: AnalysisOverlayRef[];\n /** Ref to the native view, whose `retryLoad` async function is callable through it. */\n ref?: Ref<unknown>;\n children?: ReactNode;\n};\n\nconst NativeSceneView = requireNativeView<NativeSceneViewProps>('ExpoArcgis', 'ExpoArcgisSceneView');\n\n/**\n * Declarative 3D scene view. Renders the `Scene` from the nearest `<Scene>`, hosts the\n * `<GraphicsOverlay>` / `<AnalysisOverlay>` children, and exposes `retryLoad` via a `ref`.\n */\nexport const SceneView = forwardRef<SceneViewHandle, PropsWithChildren<SceneViewProps>>(\n function SceneView({ children, orbitGraphic, ...props }, handle) {\n const scene = useGeoModel() as SceneRef;\n // The native view exposes an async `retryLoad` function callable through its ref.\n const nativeRef = useRef<any>(null);\n\n const [overlays, setOverlays] = useState<GraphicsOverlayRef[]>([]);\n const [analysisOverlays, setAnalysisOverlays] = useState<AnalysisOverlayRef[]>([]);\n const host = useMemo<GeoViewHost>(\n () => ({\n add: (overlay) => setOverlays((prev) => (prev.includes(overlay) ? prev : [...prev, overlay])),\n remove: (overlay) => setOverlays((prev) => prev.filter((o) => o !== overlay)),\n // The SDK binds a GeometryEditor to MapView only; 3D scene editing is not supported.\n setGeometryEditor: () => {},\n addAnalysisOverlay: (overlay) =>\n setAnalysisOverlays((prev) => (prev.includes(overlay) ? prev : [...prev, overlay])),\n removeAnalysisOverlay: (overlay) =>\n setAnalysisOverlays((prev) => prev.filter((o) => o !== overlay)),\n // Image overlays are bound to <MapView> (2D) only.\n addImageOverlay: () => {},\n removeImageOverlay: () => {},\n }),\n []\n );\n\n // The native view exposes `retryLoad` on its ref, so hand that ref over directly.\n useImperativeHandle(handle, () => nativeRef.current as SceneViewHandle, []);\n\n return (\n <NativeSceneView\n ref={nativeRef}\n scene={sharedObjectId(scene)}\n graphicsOverlays={overlays.map(sharedObjectId)}\n analysisOverlays={analysisOverlays.map(sharedObjectId)}\n orbitGraphic={sharedObjectId(orbitGraphic)}\n {...props}\n >\n <GeoViewContext.Provider value={host}>{children}</GeoViewContext.Provider>\n </NativeSceneView>\n );\n }\n);\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns a SharedObject's registry id (a number) so it can be passed as a native view prop.
3
+ *
4
+ * Why: expo-modules-core only started auto-unwrapping shared objects passed as view props in
5
+ * 56.0.13 (expo/expo#46212). On older SDK 56 patches a raw shared object does not survive the
6
+ * Fabric prop pipeline (it serializes to an empty value), so the native `Prop` is never set and the
7
+ * view stays blank. Passing the registry id explicitly works on every version — the native side
8
+ * resolves the id back to the object (expo/expo#24431), and array props resolve element-wise.
9
+ *
10
+ * Non-shared-object values (null / undefined / already a number) pass through unchanged, so this is
11
+ * also a no-op once #46212 is present. Callers map it over array props.
12
+ */
13
+ export declare function sharedObjectId<T>(value: T): T;
14
+ //# sourceMappingURL=sharedObjectId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedObjectId.d.ts","sourceRoot":"","sources":["../../src/utils/sharedObjectId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAI7C"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Returns a SharedObject's registry id (a number) so it can be passed as a native view prop.
3
+ *
4
+ * Why: expo-modules-core only started auto-unwrapping shared objects passed as view props in
5
+ * 56.0.13 (expo/expo#46212). On older SDK 56 patches a raw shared object does not survive the
6
+ * Fabric prop pipeline (it serializes to an empty value), so the native `Prop` is never set and the
7
+ * view stays blank. Passing the registry id explicitly works on every version — the native side
8
+ * resolves the id back to the object (expo/expo#24431), and array props resolve element-wise.
9
+ *
10
+ * Non-shared-object values (null / undefined / already a number) pass through unchanged, so this is
11
+ * also a no-op once #46212 is present. Callers map it over array props.
12
+ */
13
+ export function sharedObjectId(value) {
14
+ const id = value
15
+ ?.__expo_shared_object_id__;
16
+ return (typeof id === 'number' ? id : value);
17
+ }
18
+ //# sourceMappingURL=sharedObjectId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sharedObjectId.js","sourceRoot":"","sources":["../../src/utils/sharedObjectId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAAI,KAAQ;IACxC,MAAM,EAAE,GAAI,KAAmE;QAC7E,EAAE,yBAAyB,CAAC;IAC9B,OAAO,CAAC,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAM,CAAC;AACpD,CAAC","sourcesContent":["/**\n * Returns a SharedObject's registry id (a number) so it can be passed as a native view prop.\n *\n * Why: expo-modules-core only started auto-unwrapping shared objects passed as view props in\n * 56.0.13 (expo/expo#46212). On older SDK 56 patches a raw shared object does not survive the\n * Fabric prop pipeline (it serializes to an empty value), so the native `Prop` is never set and the\n * view stays blank. Passing the registry id explicitly works on every version — the native side\n * resolves the id back to the object (expo/expo#24431), and array props resolve element-wise.\n *\n * Non-shared-object values (null / undefined / already a number) pass through unchanged, so this is\n * also a no-op once #46212 is present. Callers map it over array props.\n */\nexport function sharedObjectId<T>(value: T): T {\n const id = (value as { __expo_shared_object_id__?: number } | null | undefined)\n ?.__expo_shared_object_id__;\n return (typeof id === 'number' ? id : value) as T;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-arcgis",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "ArcGIS Maps SDK for React Native — native Android (Kotlin) & iOS (Swift) map rendering as an Expo module",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
package/src/MapView.tsx CHANGED
@@ -18,6 +18,7 @@ import type {
18
18
  ImageOverlayRef,
19
19
  } from './ExpoArcgisModule';
20
20
  import { GeoViewContext, useGeoModel, type GeoViewHost } from './contexts';
21
+ import { sharedObjectId } from './utils/sharedObjectId';
21
22
 
22
23
  type NativeMapViewProps = MapViewProps & {
23
24
  /** The native map handle (SharedObject), passed by reference as a view prop. */
@@ -71,10 +72,12 @@ export const MapView = forwardRef<MapViewHandle, PropsWithChildren<MapViewProps>
71
72
  return (
72
73
  <NativeMapView
73
74
  ref={nativeRef}
74
- map={map}
75
- graphicsOverlays={overlays}
76
- imageOverlays={imageOverlays}
77
- geometryEditor={geometryEditor}
75
+ // SharedObjects are passed by registry id so they survive the Fabric prop pipeline on
76
+ // expo-modules-core < 56.0.13 (which lacks the auto-unwrap from expo/expo#46212).
77
+ map={sharedObjectId(map)}
78
+ graphicsOverlays={overlays.map(sharedObjectId)}
79
+ imageOverlays={imageOverlays.map(sharedObjectId)}
80
+ geometryEditor={sharedObjectId(geometryEditor)}
78
81
  {...props}
79
82
  >
80
83
  <GeoViewContext.Provider value={host}>{children}</GeoViewContext.Provider>
package/src/SceneView.tsx CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  import type { SceneViewHandle, SceneViewProps } from './ExpoArcgis.types';
14
14
  import type { SceneRef, GraphicsOverlayRef, AnalysisOverlayRef } from './ExpoArcgisModule';
15
15
  import { GeoViewContext, useGeoModel, type GeoViewHost } from './contexts';
16
+ import { sharedObjectId } from './utils/sharedObjectId';
16
17
 
17
18
  type NativeSceneViewProps = SceneViewProps & {
18
19
  /** The native scene handle (SharedObject), passed by reference as a view prop. */
@@ -33,7 +34,7 @@ const NativeSceneView = requireNativeView<NativeSceneViewProps>('ExpoArcgis', 'E
33
34
  * `<GraphicsOverlay>` / `<AnalysisOverlay>` children, and exposes `retryLoad` via a `ref`.
34
35
  */
35
36
  export const SceneView = forwardRef<SceneViewHandle, PropsWithChildren<SceneViewProps>>(
36
- function SceneView({ children, ...props }, handle) {
37
+ function SceneView({ children, orbitGraphic, ...props }, handle) {
37
38
  const scene = useGeoModel() as SceneRef;
38
39
  // The native view exposes an async `retryLoad` function callable through its ref.
39
40
  const nativeRef = useRef<any>(null);
@@ -63,9 +64,10 @@ export const SceneView = forwardRef<SceneViewHandle, PropsWithChildren<SceneView
63
64
  return (
64
65
  <NativeSceneView
65
66
  ref={nativeRef}
66
- scene={scene}
67
- graphicsOverlays={overlays}
68
- analysisOverlays={analysisOverlays}
67
+ scene={sharedObjectId(scene)}
68
+ graphicsOverlays={overlays.map(sharedObjectId)}
69
+ analysisOverlays={analysisOverlays.map(sharedObjectId)}
70
+ orbitGraphic={sharedObjectId(orbitGraphic)}
69
71
  {...props}
70
72
  >
71
73
  <GeoViewContext.Provider value={host}>{children}</GeoViewContext.Provider>
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Returns a SharedObject's registry id (a number) so it can be passed as a native view prop.
3
+ *
4
+ * Why: expo-modules-core only started auto-unwrapping shared objects passed as view props in
5
+ * 56.0.13 (expo/expo#46212). On older SDK 56 patches a raw shared object does not survive the
6
+ * Fabric prop pipeline (it serializes to an empty value), so the native `Prop` is never set and the
7
+ * view stays blank. Passing the registry id explicitly works on every version — the native side
8
+ * resolves the id back to the object (expo/expo#24431), and array props resolve element-wise.
9
+ *
10
+ * Non-shared-object values (null / undefined / already a number) pass through unchanged, so this is
11
+ * also a no-op once #46212 is present. Callers map it over array props.
12
+ */
13
+ export function sharedObjectId<T>(value: T): T {
14
+ const id = (value as { __expo_shared_object_id__?: number } | null | undefined)
15
+ ?.__expo_shared_object_id__;
16
+ return (typeof id === 'number' ? id : value) as T;
17
+ }