@lugg/maps 1.0.0-beta.0 → 1.0.0-beta.10
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 +4 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/luggmaps/LuggCalloutView.kt +79 -0
- package/android/src/main/java/com/luggmaps/LuggCalloutViewManager.kt +39 -0
- package/android/src/main/java/com/luggmaps/LuggCircleView.kt +85 -0
- package/android/src/main/java/com/luggmaps/LuggCircleViewManager.kt +79 -0
- package/android/src/main/java/com/luggmaps/LuggGroundOverlayView.kt +81 -0
- package/android/src/main/java/com/luggmaps/LuggGroundOverlayViewManager.kt +82 -0
- package/android/src/main/java/com/luggmaps/LuggMapView.kt +49 -0
- package/android/src/main/java/com/luggmaps/LuggMapViewManager.kt +31 -0
- package/android/src/main/java/com/luggmaps/LuggMapWrapperView.kt +0 -11
- package/android/src/main/java/com/luggmaps/LuggMarkerView.kt +99 -51
- package/android/src/main/java/com/luggmaps/LuggMarkerViewManager.kt +13 -0
- package/android/src/main/java/com/luggmaps/LuggPackage.kt +11 -1
- package/android/src/main/java/com/luggmaps/LuggPolylineView.kt +1 -22
- package/android/src/main/java/com/luggmaps/LuggTileOverlayView.kt +92 -0
- package/android/src/main/java/com/luggmaps/LuggTileOverlayViewManager.kt +80 -0
- package/android/src/main/java/com/luggmaps/core/GoogleMapProvider.kt +628 -18
- package/android/src/main/java/com/luggmaps/core/MapProviderDelegate.kt +14 -0
- package/android/src/main/java/com/luggmaps/core/PolylineAnimator.kt +12 -7
- package/android/src/main/java/com/luggmaps/events/CirclePressEvent.kt +12 -0
- package/android/src/main/java/com/luggmaps/events/GroundOverlayPressEvent.kt +12 -0
- package/android/src/main/java/com/luggmaps/events/TileOverlayPressEvent.kt +12 -0
- package/android/src/main/java/com/luggmaps/extensions/ViewExtensions.kt +11 -0
- package/ios/LuggCalloutView.h +23 -0
- package/ios/LuggCalloutView.mm +155 -0
- package/ios/LuggCircleView.h +31 -0
- package/ios/LuggCircleView.mm +133 -0
- package/ios/LuggGroundOverlayView.h +30 -0
- package/ios/LuggGroundOverlayView.mm +125 -0
- package/ios/LuggMapView.mm +84 -2
- package/ios/LuggMarkerView.h +5 -0
- package/ios/LuggMarkerView.mm +40 -2
- package/ios/LuggTileOverlayView.h +31 -0
- package/ios/LuggTileOverlayView.mm +130 -0
- package/ios/core/AppleMapProvider.mm +838 -34
- package/ios/core/GMSPolylineAnimator.m +6 -3
- package/ios/core/GoogleMapProvider.mm +506 -19
- package/ios/core/LuggAnnotationView.h +12 -0
- package/ios/core/LuggAnnotationView.mm +55 -0
- package/ios/core/MapProviderDelegate.h +20 -1
- package/ios/events/CirclePressEvent.h +20 -0
- package/ios/events/GroundOverlayPressEvent.h +20 -0
- package/ios/events/TileOverlayPressEvent.h +20 -0
- package/lib/module/MapProvider.web.js +7 -2
- package/lib/module/MapProvider.web.js.map +1 -1
- package/lib/module/MapView.js +12 -1
- package/lib/module/MapView.js.map +1 -1
- package/lib/module/MapView.web.js +36 -20
- package/lib/module/MapView.web.js.map +1 -1
- package/lib/module/components/Circle.js +46 -0
- package/lib/module/components/Circle.js.map +1 -0
- package/lib/module/components/Circle.types.js +4 -0
- package/lib/module/components/Circle.types.js.map +1 -0
- package/lib/module/components/Circle.web.js +79 -0
- package/lib/module/components/Circle.web.js.map +1 -0
- package/lib/module/components/GeoJson.js +3 -3
- package/lib/module/components/GeoJson.js.map +1 -1
- package/lib/module/components/GroundOverlay.js +45 -0
- package/lib/module/components/GroundOverlay.js.map +1 -0
- package/lib/module/components/GroundOverlay.types.js +4 -0
- package/lib/module/components/GroundOverlay.types.js.map +1 -0
- package/lib/module/components/GroundOverlay.web.js +77 -0
- package/lib/module/components/GroundOverlay.web.js.map +1 -0
- package/lib/module/components/Marker.js +41 -6
- package/lib/module/components/Marker.js.map +1 -1
- package/lib/module/components/Marker.web.js +103 -26
- package/lib/module/components/Marker.web.js.map +1 -1
- package/lib/module/components/Polygon.web.js +3 -3
- package/lib/module/components/Polygon.web.js.map +1 -1
- package/lib/module/components/Polyline.web.js +6 -12
- package/lib/module/components/Polyline.web.js.map +1 -1
- package/lib/module/components/TileOverlay.js +44 -0
- package/lib/module/components/TileOverlay.js.map +1 -0
- package/lib/module/components/TileOverlay.types.js +4 -0
- package/lib/module/components/TileOverlay.types.js.map +1 -0
- package/lib/module/components/TileOverlay.web.js +69 -0
- package/lib/module/components/TileOverlay.web.js.map +1 -0
- package/lib/module/components/index.js +3 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/index.web.js +3 -0
- package/lib/module/components/index.web.js.map +1 -1
- package/lib/module/fabric/LuggCalloutViewNativeComponent.ts +20 -0
- package/lib/module/fabric/LuggCircleViewNativeComponent.ts +25 -0
- package/lib/module/fabric/LuggGroundOverlayViewNativeComponent.ts +29 -0
- package/lib/module/fabric/LuggMapViewNativeComponent.ts +13 -5
- package/lib/module/fabric/LuggMarkerViewNativeComponent.ts +14 -2
- package/lib/module/fabric/LuggTileOverlayViewNativeComponent.ts +30 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +3 -0
- package/lib/module/index.web.js.map +1 -1
- package/lib/typescript/src/MapProvider.web.d.ts +9 -2
- package/lib/typescript/src/MapProvider.web.d.ts.map +1 -1
- package/lib/typescript/src/MapView.d.ts +1 -1
- package/lib/typescript/src/MapView.d.ts.map +1 -1
- package/lib/typescript/src/MapView.types.d.ts +36 -1
- package/lib/typescript/src/MapView.types.d.ts.map +1 -1
- package/lib/typescript/src/MapView.web.d.ts +1 -1
- package/lib/typescript/src/MapView.web.d.ts.map +1 -1
- package/lib/typescript/src/components/Circle.d.ts +10 -0
- package/lib/typescript/src/components/Circle.d.ts.map +1 -0
- package/lib/typescript/src/components/Circle.types.d.ts +33 -0
- package/lib/typescript/src/components/Circle.types.d.ts.map +1 -0
- package/lib/typescript/src/components/Circle.web.d.ts +3 -0
- package/lib/typescript/src/components/Circle.web.d.ts.map +1 -0
- package/lib/typescript/src/components/GeoJson.d.ts +2 -1
- package/lib/typescript/src/components/GeoJson.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/GroundOverlay.d.ts +10 -0
- package/lib/typescript/src/components/GroundOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/GroundOverlay.types.d.ts +35 -0
- package/lib/typescript/src/components/GroundOverlay.types.d.ts.map +1 -0
- package/lib/typescript/src/components/GroundOverlay.web.d.ts +3 -0
- package/lib/typescript/src/components/GroundOverlay.web.d.ts.map +1 -0
- package/lib/typescript/src/components/Marker.d.ts +6 -3
- package/lib/typescript/src/components/Marker.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.types.d.ts +40 -2
- package/lib/typescript/src/components/Marker.types.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.web.d.ts +3 -2
- package/lib/typescript/src/components/Marker.web.d.ts.map +1 -1
- package/lib/typescript/src/components/Polygon.web.d.ts +1 -1
- package/lib/typescript/src/components/Polygon.web.d.ts.map +1 -1
- package/lib/typescript/src/components/Polyline.web.d.ts +1 -1
- package/lib/typescript/src/components/Polyline.web.d.ts.map +1 -1
- package/lib/typescript/src/components/TileOverlay.d.ts +10 -0
- package/lib/typescript/src/components/TileOverlay.d.ts.map +1 -0
- package/lib/typescript/src/components/TileOverlay.types.d.ts +36 -0
- package/lib/typescript/src/components/TileOverlay.types.d.ts.map +1 -0
- package/lib/typescript/src/components/TileOverlay.web.d.ts +3 -0
- package/lib/typescript/src/components/TileOverlay.web.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +7 -1
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/components/index.web.d.ts +7 -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/fabric/LuggCircleViewNativeComponent.d.ts +18 -0
- package/lib/typescript/src/fabric/LuggCircleViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggGroundOverlayViewNativeComponent.d.ts +21 -0
- package/lib/typescript/src/fabric/LuggGroundOverlayViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts +10 -5
- package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts +8 -1
- package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggTileOverlayViewNativeComponent.d.ts +21 -0
- package/lib/typescript/src/fabric/LuggTileOverlayViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +10 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.web.d.ts +9 -3
- package/lib/typescript/src/index.web.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +0 -4
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +6 -2
- package/src/MapProvider.web.tsx +15 -3
- package/src/MapView.tsx +12 -1
- package/src/MapView.types.ts +118 -1
- package/src/MapView.web.tsx +379 -322
- package/src/components/Circle.tsx +52 -0
- package/src/components/Circle.types.ts +33 -0
- package/src/components/Circle.web.tsx +95 -0
- package/src/components/GeoJson.tsx +3 -3
- package/src/components/GeoJson.types.ts +12 -1
- package/src/components/GroundOverlay.tsx +47 -0
- package/src/components/GroundOverlay.types.ts +36 -0
- package/src/components/GroundOverlay.web.tsx +81 -0
- package/src/components/Marker.tsx +59 -5
- package/src/components/Marker.types.ts +42 -2
- package/src/components/Marker.web.tsx +235 -99
- package/src/components/Polygon.web.tsx +93 -89
- package/src/components/Polyline.web.tsx +235 -235
- package/src/components/TileOverlay.tsx +44 -0
- package/src/components/TileOverlay.types.ts +37 -0
- package/src/components/TileOverlay.web.tsx +97 -0
- package/src/components/index.ts +11 -0
- package/src/components/index.web.ts +10 -1
- package/src/fabric/LuggCalloutViewNativeComponent.ts +20 -0
- package/src/fabric/LuggCircleViewNativeComponent.ts +25 -0
- package/src/fabric/LuggGroundOverlayViewNativeComponent.ts +29 -0
- package/src/fabric/LuggMapViewNativeComponent.ts +13 -5
- package/src/fabric/LuggMarkerViewNativeComponent.ts +14 -2
- package/src/fabric/LuggTileOverlayViewNativeComponent.ts +30 -0
- package/src/index.ts +14 -1
- package/src/index.web.ts +17 -1
- package/src/types.ts +0 -5
|
@@ -2,14 +2,20 @@ 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
|
+
export { Circle } from './components/index.web';
|
|
9
|
+
export type { CircleProps } from './components/index.web';
|
|
8
10
|
export { Polyline } from './components/index.web';
|
|
9
11
|
export type { PolylineProps } from './components/index.web';
|
|
10
12
|
export { GeoJson } from './components/index.web';
|
|
11
13
|
export type { GeoJsonProps } from './components/index.web';
|
|
12
|
-
export
|
|
14
|
+
export { GroundOverlay } from './components/index.web';
|
|
15
|
+
export type { GroundOverlayProps, GroundOverlayBounds, } from './components/index.web';
|
|
16
|
+
export { TileOverlay } from './components/index.web';
|
|
17
|
+
export type { TileOverlayProps, TileOverlayBounds, } from './components/index.web';
|
|
18
|
+
export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, CameraEventPayload, MapType, PoiCategory, PoiFilter, } from './MapView.types';
|
|
13
19
|
export type { MapProvider as MapProviderType, Coordinate, Point, EdgeInsets, } from './types';
|
|
14
|
-
export type { GeoJSON, Feature, FeatureCollection, Geometry, Position, } from './components/GeoJson.types';
|
|
20
|
+
export type { GeoJSON, Feature, FeatureCollection, FeatureProperties, Geometry, Position, } from './components/GeoJson.types';
|
|
15
21
|
//# 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;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,YAAY,EACV,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,YAAY,EACV,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,OAAO,EACP,WAAW,EACX,SAAS,GACV,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,UAAU,EACV,KAAK,EACL,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,QAAQ,GACT,MAAM,4BAA4B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lugg/maps",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.10",
|
|
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,9 +147,13 @@
|
|
|
147
147
|
"componentProvider": {
|
|
148
148
|
"LuggMapView": "LuggMapView",
|
|
149
149
|
"LuggMarkerView": "LuggMarkerView",
|
|
150
|
+
"LuggCalloutView": "LuggCalloutView",
|
|
150
151
|
"LuggMapWrapperView": "LuggMapWrapperView",
|
|
151
152
|
"LuggPolylineView": "LuggPolylineView",
|
|
152
|
-
"LuggPolygonView": "LuggPolygonView"
|
|
153
|
+
"LuggPolygonView": "LuggPolygonView",
|
|
154
|
+
"LuggCircleView": "LuggCircleView",
|
|
155
|
+
"LuggGroundOverlayView": "LuggGroundOverlayView",
|
|
156
|
+
"LuggTileOverlayView": "LuggTileOverlayView"
|
|
153
157
|
}
|
|
154
158
|
}
|
|
155
159
|
},
|
package/src/MapProvider.web.tsx
CHANGED
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
import { createContext, useContext } from 'react';
|
|
1
|
+
import { createContext, useContext, type MutableRefObject } 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
|
+
|
|
7
|
+
const defaultDraggingRef = { current: false };
|
|
8
|
+
|
|
5
9
|
export const MapContext = createContext<{
|
|
6
10
|
map: google.maps.Map | null;
|
|
7
|
-
|
|
11
|
+
isDraggingRef: MutableRefObject<boolean>;
|
|
8
12
|
moveCamera: (coordinate: { latitude: number; longitude: number }) => void;
|
|
9
|
-
|
|
13
|
+
onCalloutClose: (listener: CalloutCloseListener) => () => void;
|
|
14
|
+
closeCallouts: (except?: CalloutCloseListener) => void;
|
|
15
|
+
}>({
|
|
16
|
+
map: null,
|
|
17
|
+
isDraggingRef: defaultDraggingRef,
|
|
18
|
+
moveCamera: () => {},
|
|
19
|
+
onCalloutClose: () => () => {},
|
|
20
|
+
closeCallouts: () => {},
|
|
21
|
+
});
|
|
10
22
|
|
|
11
23
|
export const useMapContext = () => useContext(MapContext);
|
|
12
24
|
|
package/src/MapView.tsx
CHANGED
|
@@ -14,16 +14,18 @@ import type {
|
|
|
14
14
|
import type { Coordinate, EdgeInsets } from './types';
|
|
15
15
|
|
|
16
16
|
export class MapView
|
|
17
|
-
extends React.
|
|
17
|
+
extends React.PureComponent<MapViewProps>
|
|
18
18
|
implements MapViewRef
|
|
19
19
|
{
|
|
20
20
|
static defaultProps: Partial<MapViewProps> = {
|
|
21
21
|
provider: Platform.OS === 'ios' ? 'apple' : 'google',
|
|
22
|
+
mapType: 'standard',
|
|
22
23
|
initialZoom: 10,
|
|
23
24
|
zoomEnabled: true,
|
|
24
25
|
scrollEnabled: true,
|
|
25
26
|
rotateEnabled: true,
|
|
26
27
|
pitchEnabled: true,
|
|
28
|
+
poiEnabled: true,
|
|
27
29
|
theme: 'system',
|
|
28
30
|
};
|
|
29
31
|
|
|
@@ -80,6 +82,7 @@ export class MapView
|
|
|
80
82
|
render() {
|
|
81
83
|
const {
|
|
82
84
|
provider,
|
|
85
|
+
mapType,
|
|
83
86
|
mapId,
|
|
84
87
|
initialCoordinate,
|
|
85
88
|
initialZoom,
|
|
@@ -92,7 +95,10 @@ export class MapView
|
|
|
92
95
|
edgeInsets,
|
|
93
96
|
userLocationEnabled,
|
|
94
97
|
userLocationButtonEnabled,
|
|
98
|
+
poiEnabled,
|
|
99
|
+
poiFilter,
|
|
95
100
|
theme,
|
|
101
|
+
insetAdjustment,
|
|
96
102
|
onPress,
|
|
97
103
|
onLongPress,
|
|
98
104
|
onCameraMove,
|
|
@@ -107,6 +113,7 @@ export class MapView
|
|
|
107
113
|
ref={this.nativeRef}
|
|
108
114
|
{...rest}
|
|
109
115
|
provider={provider}
|
|
116
|
+
mapType={mapType}
|
|
110
117
|
mapId={mapId}
|
|
111
118
|
initialCoordinate={initialCoordinate}
|
|
112
119
|
initialZoom={initialZoom}
|
|
@@ -119,7 +126,11 @@ export class MapView
|
|
|
119
126
|
edgeInsets={edgeInsets}
|
|
120
127
|
userLocationEnabled={userLocationEnabled}
|
|
121
128
|
userLocationButtonEnabled={userLocationButtonEnabled}
|
|
129
|
+
poiEnabled={poiEnabled}
|
|
130
|
+
poiFilterMode={poiFilter?.mode}
|
|
131
|
+
poiFilterCategories={poiFilter?.categories}
|
|
122
132
|
theme={theme}
|
|
133
|
+
insetAdjustment={insetAdjustment}
|
|
123
134
|
onMapPress={onPress}
|
|
124
135
|
onMapLongPress={onLongPress}
|
|
125
136
|
onCameraMove={onCameraMove}
|
package/src/MapView.types.ts
CHANGED
|
@@ -4,10 +4,104 @@ import type {
|
|
|
4
4
|
MapProvider,
|
|
5
5
|
Coordinate,
|
|
6
6
|
EdgeInsets,
|
|
7
|
-
MapTheme,
|
|
8
7
|
PressEventPayload,
|
|
9
8
|
} from './types';
|
|
10
9
|
|
|
10
|
+
export type MapType =
|
|
11
|
+
| 'standard'
|
|
12
|
+
| 'satellite'
|
|
13
|
+
| 'terrain'
|
|
14
|
+
| 'hybrid'
|
|
15
|
+
| 'muted-standard';
|
|
16
|
+
|
|
17
|
+
export type MapTheme = 'light' | 'dark' | 'system';
|
|
18
|
+
|
|
19
|
+
export type InsetAdjustment = 'automatic' | 'never';
|
|
20
|
+
|
|
21
|
+
export type PoiCategory =
|
|
22
|
+
| 'airport'
|
|
23
|
+
| 'amusement-park'
|
|
24
|
+
| 'animal-service'
|
|
25
|
+
| 'aquarium'
|
|
26
|
+
| 'atm'
|
|
27
|
+
| 'automotive-repair'
|
|
28
|
+
| 'bakery'
|
|
29
|
+
| 'bank'
|
|
30
|
+
| 'baseball'
|
|
31
|
+
| 'basketball'
|
|
32
|
+
| 'beach'
|
|
33
|
+
| 'beauty'
|
|
34
|
+
| 'bowling'
|
|
35
|
+
| 'brewery'
|
|
36
|
+
| 'cafe'
|
|
37
|
+
| 'campground'
|
|
38
|
+
| 'car-rental'
|
|
39
|
+
| 'castle'
|
|
40
|
+
| 'convention-center'
|
|
41
|
+
| 'distillery'
|
|
42
|
+
| 'ev-charger'
|
|
43
|
+
| 'fairground'
|
|
44
|
+
| 'fire-station'
|
|
45
|
+
| 'fishing'
|
|
46
|
+
| 'fitness-center'
|
|
47
|
+
| 'food-market'
|
|
48
|
+
| 'fortress'
|
|
49
|
+
| 'gas-station'
|
|
50
|
+
| 'go-kart'
|
|
51
|
+
| 'golf'
|
|
52
|
+
| 'hiking'
|
|
53
|
+
| 'hospital'
|
|
54
|
+
| 'hotel'
|
|
55
|
+
| 'kayaking'
|
|
56
|
+
| 'landmark'
|
|
57
|
+
| 'laundry'
|
|
58
|
+
| 'library'
|
|
59
|
+
| 'mailbox'
|
|
60
|
+
| 'marina'
|
|
61
|
+
| 'mini-golf'
|
|
62
|
+
| 'movie-theater'
|
|
63
|
+
| 'museum'
|
|
64
|
+
| 'music-venue'
|
|
65
|
+
| 'national-monument'
|
|
66
|
+
| 'national-park'
|
|
67
|
+
| 'nightlife'
|
|
68
|
+
| 'park'
|
|
69
|
+
| 'parking'
|
|
70
|
+
| 'pharmacy'
|
|
71
|
+
| 'planetarium'
|
|
72
|
+
| 'police'
|
|
73
|
+
| 'post-office'
|
|
74
|
+
| 'public-transport'
|
|
75
|
+
| 'restaurant'
|
|
76
|
+
| 'restroom'
|
|
77
|
+
| 'rock-climbing'
|
|
78
|
+
| 'rv-park'
|
|
79
|
+
| 'school'
|
|
80
|
+
| 'skate-park'
|
|
81
|
+
| 'skating'
|
|
82
|
+
| 'skiing'
|
|
83
|
+
| 'soccer'
|
|
84
|
+
| 'spa'
|
|
85
|
+
| 'stadium'
|
|
86
|
+
| 'store'
|
|
87
|
+
| 'surfing'
|
|
88
|
+
| 'swimming'
|
|
89
|
+
| 'tennis'
|
|
90
|
+
| 'theater'
|
|
91
|
+
| 'university'
|
|
92
|
+
| 'volleyball'
|
|
93
|
+
| 'winery'
|
|
94
|
+
| 'zoo';
|
|
95
|
+
|
|
96
|
+
export interface PoiFilter {
|
|
97
|
+
/**
|
|
98
|
+
* Filter mode
|
|
99
|
+
* @default 'including'
|
|
100
|
+
*/
|
|
101
|
+
mode?: 'including' | 'excluding';
|
|
102
|
+
categories: PoiCategory[];
|
|
103
|
+
}
|
|
104
|
+
|
|
11
105
|
/**
|
|
12
106
|
* Options for moving the camera
|
|
13
107
|
*/
|
|
@@ -64,6 +158,11 @@ export interface MapViewProps extends ViewProps {
|
|
|
64
158
|
* @default 'apple' on iOS, 'google' on Android
|
|
65
159
|
*/
|
|
66
160
|
provider?: MapProvider;
|
|
161
|
+
/**
|
|
162
|
+
* Map type to display
|
|
163
|
+
* @default 'standard'
|
|
164
|
+
*/
|
|
165
|
+
mapType?: MapType;
|
|
67
166
|
/**
|
|
68
167
|
* Map style ID (Google Maps) or configuration name (Apple Maps)
|
|
69
168
|
*/
|
|
@@ -121,11 +220,29 @@ export interface MapViewProps extends ViewProps {
|
|
|
121
220
|
* @platform android
|
|
122
221
|
*/
|
|
123
222
|
userLocationButtonEnabled?: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Show points of interest on the map (Apple Maps only).
|
|
225
|
+
* When false, hides all POIs regardless of poiFilter.
|
|
226
|
+
* @default true
|
|
227
|
+
* @platform ios
|
|
228
|
+
*/
|
|
229
|
+
poiEnabled?: boolean;
|
|
230
|
+
/**
|
|
231
|
+
* Filter POI categories to show or hide (Apple Maps only).
|
|
232
|
+
* Only takes effect when poiEnabled is true.
|
|
233
|
+
* @platform ios
|
|
234
|
+
*/
|
|
235
|
+
poiFilter?: PoiFilter;
|
|
124
236
|
/**
|
|
125
237
|
* Map color theme
|
|
126
238
|
* @default 'system'
|
|
127
239
|
*/
|
|
128
240
|
theme?: MapTheme;
|
|
241
|
+
/**
|
|
242
|
+
* Safe area inset adjustment behavior
|
|
243
|
+
* @default 'never'
|
|
244
|
+
*/
|
|
245
|
+
insetAdjustment?: InsetAdjustment;
|
|
129
246
|
/**
|
|
130
247
|
* Called when the map is pressed
|
|
131
248
|
*/
|