react-native-maps 0.31.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 +2 -6
- package/android/src/main/AndroidManifest.xml +0 -3
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapLocalTile.java +11 -4
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapLocalTileManager.java +5 -1
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapManager.java +2 -41
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapTileProvider.java +5 -5
- package/android/src/main/java/com/airbnb/android/react/maps/AirMapView.java +1 -33
- package/ios/AirGoogleMaps/AIRGoogleMap.m +37 -19
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +0 -95
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +6 -0
- package/ios/AirMaps/AIRMap.h +0 -1
- package/ios/AirMaps/AIRMap.m +0 -12
- package/ios/AirMaps/AIRMapManager.m +4 -135
- package/lib/AnimatedRegion.d.ts +19 -0
- package/lib/AnimatedRegion.js +134 -0
- package/lib/Geojson.d.ts +166 -0
- package/lib/Geojson.js +165 -0
- package/lib/MapCallout.d.ts +40 -0
- package/lib/MapCallout.js +51 -0
- package/lib/MapCalloutSubview.d.ts +34 -0
- package/lib/MapCalloutSubview.js +48 -0
- package/lib/MapCircle.d.ts +117 -0
- package/lib/MapCircle.js +53 -0
- package/lib/MapHeatmap.d.ts +78 -0
- package/lib/MapHeatmap.js +59 -0
- package/lib/MapLocalTile.d.ts +35 -0
- package/lib/MapLocalTile.js +44 -0
- package/lib/MapMarker.d.ts +290 -0
- package/lib/MapMarker.js +113 -0
- package/lib/MapOverlay.d.ts +87 -0
- package/lib/MapOverlay.js +63 -0
- package/lib/MapPolygon.d.ts +156 -0
- package/lib/MapPolygon.js +74 -0
- package/lib/MapPolyline.d.ts +156 -0
- package/lib/MapPolyline.js +53 -0
- package/lib/MapUrlTile.d.ts +134 -0
- package/lib/MapUrlTile.js +44 -0
- package/lib/MapView.d.ts +677 -0
- package/lib/MapView.js +418 -0
- package/lib/MapView.types.d.ts +153 -0
- package/lib/MapView.types.js +2 -0
- package/{src/MapView.web.js → lib/MapView.web.d.ts} +0 -0
- package/lib/MapView.web.js +9 -0
- package/lib/MapWMSTile.d.ts +116 -0
- package/lib/MapWMSTile.js +44 -0
- package/lib/ProviderConstants.d.ts +2 -0
- package/lib/ProviderConstants.js +5 -0
- package/lib/decorateMapComponent.d.ts +35 -0
- package/lib/decorateMapComponent.js +80 -0
- package/lib/index.d.ts +37 -0
- package/lib/index.js +81 -0
- package/lib/sharedTypes.d.ts +81 -0
- package/lib/sharedTypes.js +2 -0
- package/lib/sharedTypesInternal.d.ts +1 -0
- package/lib/sharedTypesInternal.js +2 -0
- package/package.json +21 -29
- package/react-native-google-maps.podspec +6 -7
- package/react-native-maps.podspec +5 -6
- package/index.d.ts +0 -637
- package/src/AnimatedRegion.js +0 -164
- package/src/Geojson.js +0 -334
- package/src/MapCallout.js +0 -51
- package/src/MapCalloutSubview.js +0 -44
- package/src/MapCircle.js +0 -150
- package/src/MapHeatmap.js +0 -99
- package/src/MapLocalTile.js +0 -52
- package/src/MapMarker.js +0 -377
- package/src/MapOverlay.js +0 -86
- package/src/MapPolygon.js +0 -202
- package/src/MapPolyline.js +0 -168
- package/src/MapUrlTile.js +0 -131
- package/src/MapView.js +0 -1160
- package/src/MapWMSTile.js +0 -122
- package/src/ProviderConstants.js +0 -2
- package/src/decorateMapComponent.js +0 -112
- package/src/index.js +0 -31
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ViewProps } from 'react-native';
|
|
3
|
+
import { ProviderContext, NativeComponent, MapManagerCommand, UIManagerCommand } from './decorateMapComponent';
|
|
4
|
+
export declare type MapWMSTileProps = ViewProps & {
|
|
5
|
+
/**
|
|
6
|
+
* The maximum native zoom level for this tile overlay i.e. the highest zoom level that the tile server provides.
|
|
7
|
+
* Tiles are auto-scaled for higher zoom levels.
|
|
8
|
+
*
|
|
9
|
+
* @platform iOS: Apple Maps only
|
|
10
|
+
* @platform Android: Supported
|
|
11
|
+
*/
|
|
12
|
+
maximumNativeZ?: number;
|
|
13
|
+
/**
|
|
14
|
+
* The maximum zoom level for this tile overlay.
|
|
15
|
+
*
|
|
16
|
+
* @platform iOS: Supported
|
|
17
|
+
* @platform Android: Supported
|
|
18
|
+
*/
|
|
19
|
+
maximumZ?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The minimum zoom level for this tile overlay.
|
|
22
|
+
*
|
|
23
|
+
* @platform iOS: Supported
|
|
24
|
+
* @platform Android: Supported
|
|
25
|
+
*/
|
|
26
|
+
minimumZ?: number;
|
|
27
|
+
/**
|
|
28
|
+
* In offline-mode tiles are not fetched from the tile servers, rather only tiles stored in the cache directory are used.
|
|
29
|
+
* Furthermore automated tile scaling is activated: if tile at a desired zoom level is not found from the cache directory,
|
|
30
|
+
* then lower zoom level tile is used (up to 4 levels lower) and scaled.
|
|
31
|
+
*
|
|
32
|
+
* @default false
|
|
33
|
+
* @platform iOS: Apple Maps only
|
|
34
|
+
* @platform Android: Supported
|
|
35
|
+
*/
|
|
36
|
+
offlineMode?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Map layer opacity. Value between 0 - 1, with 0 meaning fully transparent.
|
|
39
|
+
*
|
|
40
|
+
* @platform iOS: Supported
|
|
41
|
+
* @platform Android: Supported
|
|
42
|
+
*/
|
|
43
|
+
opacity?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Corresponds to MKTileOverlay canReplaceMapContent i.e. if true then underlying iOS basemap is not shown.
|
|
46
|
+
*
|
|
47
|
+
* @default false
|
|
48
|
+
* @platform iOS: Apple Maps only
|
|
49
|
+
* @platform Android: Not supported
|
|
50
|
+
*/
|
|
51
|
+
shouldReplaceMapContent?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Defines maximum age in seconds for a cached tile before it's refreshed.
|
|
54
|
+
*
|
|
55
|
+
* NB! Refresh logic is "serve-stale-while-refresh"
|
|
56
|
+
* i.e. to ensure map availability a stale (over max age) tile is served
|
|
57
|
+
* while a tile refresh process is started in the background.
|
|
58
|
+
*
|
|
59
|
+
* @platform iOS: Apple Maps only
|
|
60
|
+
* @platform Android: Supported
|
|
61
|
+
*/
|
|
62
|
+
tileCacheMaxAge?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Enable caching of tiles in the specified directory.
|
|
65
|
+
* Directory can be specified either as a normal path or in URL format (`file://`).
|
|
66
|
+
*
|
|
67
|
+
* Tiles are stored in tileCachePath directory as `/{z}/{x}/{y}` i.e. in sub-directories 2-levels deep,
|
|
68
|
+
* filename is tile y-coordinate without any filetype-extension.
|
|
69
|
+
*
|
|
70
|
+
* NB! All cache management needs to be implemented by client e.g. deleting tiles to manage use of storage space etc.
|
|
71
|
+
*
|
|
72
|
+
* @platform iOS: Apple Maps only
|
|
73
|
+
* @platform Android: Supported
|
|
74
|
+
*/
|
|
75
|
+
tileCachePath?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Tile size, default size is 256 (for tiles of 256 _ 256 pixels).
|
|
78
|
+
* High-res (aka 'retina') tiles are 512 (tiles of 512 _ 512 pixels)
|
|
79
|
+
*
|
|
80
|
+
* @platform iOS: Supported
|
|
81
|
+
* @platform Android: Supported
|
|
82
|
+
*/
|
|
83
|
+
tileSize?: number;
|
|
84
|
+
/**
|
|
85
|
+
* The url template of the map tileserver.
|
|
86
|
+
* (URLTile) The patterns {x} {y} {z} will be replaced at runtime.
|
|
87
|
+
* For example, http://c.tile.openstreetmap.org/{z}/{x}/{y}.png.
|
|
88
|
+
*
|
|
89
|
+
* It is also possible to refer to tiles in local filesystem with file:///top-level-directory/sub-directory/{z}/{x}/{y}.png URL-format.
|
|
90
|
+
* (WMSTile) The patterns {minX} {maxX} {minY} {maxY} {width} {height} will be replaced at runtime according to EPSG:900913 specification bounding box.
|
|
91
|
+
* For example, https://demo.geo-solutions.it/geoserver/tiger/wms?service=WMS&version=1.1.0&request=GetMap&layers=tiger:poi&styles=&bbox={minX},{minY},{maxX},{maxY}&width={width}&height={height}&srs=EPSG:900913&format=image/png&transparent=true&format_options=dpi:213.
|
|
92
|
+
*
|
|
93
|
+
* @platform iOS: Supported
|
|
94
|
+
* @platform Android: Supported
|
|
95
|
+
*/
|
|
96
|
+
urlTemplate: string;
|
|
97
|
+
/**
|
|
98
|
+
* The order in which this tile overlay is drawn with respect to other overlays.
|
|
99
|
+
* An overlay with a larger z-index is drawn over overlays with smaller z-indices.
|
|
100
|
+
* The order of overlays with the same z-index is arbitrary.
|
|
101
|
+
*
|
|
102
|
+
* @platform iOS: Google Maps only
|
|
103
|
+
* @platform Android: Supported
|
|
104
|
+
*/
|
|
105
|
+
zIndex?: number;
|
|
106
|
+
};
|
|
107
|
+
declare type NativeProps = MapWMSTileProps;
|
|
108
|
+
export declare class MapWMSTile extends React.Component<MapWMSTileProps> {
|
|
109
|
+
context: React.ContextType<typeof ProviderContext>;
|
|
110
|
+
getNativeComponent: () => NativeComponent<NativeProps>;
|
|
111
|
+
getMapManagerCommand: (name: string) => MapManagerCommand;
|
|
112
|
+
getUIManagerCommand: (name: string) => UIManagerCommand;
|
|
113
|
+
render(): JSX.Element;
|
|
114
|
+
}
|
|
115
|
+
declare const _default: typeof MapWMSTile;
|
|
116
|
+
export default _default;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.MapWMSTile = void 0;
|
|
27
|
+
const React = __importStar(require("react"));
|
|
28
|
+
const decorateMapComponent_1 = __importStar(require("./decorateMapComponent"));
|
|
29
|
+
class MapWMSTile extends React.Component {
|
|
30
|
+
getNativeComponent;
|
|
31
|
+
getMapManagerCommand;
|
|
32
|
+
getUIManagerCommand;
|
|
33
|
+
render() {
|
|
34
|
+
const AIRMapWMSTile = this.getNativeComponent();
|
|
35
|
+
return <AIRMapWMSTile {...this.props}/>;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.MapWMSTile = MapWMSTile;
|
|
39
|
+
exports.default = (0, decorateMapComponent_1.default)(MapWMSTile, 'WMSTile', {
|
|
40
|
+
google: {
|
|
41
|
+
ios: decorateMapComponent_1.SUPPORTED,
|
|
42
|
+
android: decorateMapComponent_1.USES_DEFAULT_IMPLEMENTATION,
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { HostComponent } from 'react-native';
|
|
3
|
+
import { Provider } from './sharedTypes';
|
|
4
|
+
import { MapCallout } from './MapCallout';
|
|
5
|
+
import { MapOverlay } from './MapOverlay';
|
|
6
|
+
import { MapCalloutSubview } from './MapCalloutSubview';
|
|
7
|
+
import { MapCircle } from './MapCircle';
|
|
8
|
+
import { MapHeatmap } from './MapHeatmap';
|
|
9
|
+
import { MapLocalTile } from './MapLocalTile';
|
|
10
|
+
import { MapMarker } from './MapMarker';
|
|
11
|
+
import { MapPolygon } from './MapPolygon';
|
|
12
|
+
import { MapPolyline } from './MapPolyline';
|
|
13
|
+
import { MapUrlTile } from './MapUrlTile';
|
|
14
|
+
import { MapWMSTile } from './MapWMSTile';
|
|
15
|
+
export declare const SUPPORTED: ImplementationStatus;
|
|
16
|
+
export declare const USES_DEFAULT_IMPLEMENTATION: ImplementationStatus;
|
|
17
|
+
export declare const NOT_SUPPORTED: ImplementationStatus;
|
|
18
|
+
export declare const ProviderContext: import("react").Context<Provider>;
|
|
19
|
+
export declare function getNativeMapName(provider: Provider): "AIRMap" | "AIRGoogleMap";
|
|
20
|
+
export declare const createNotSupportedComponent: (message: string) => () => null;
|
|
21
|
+
export declare const googleMapIsInstalled = true;
|
|
22
|
+
export default function decorateMapComponent<Type extends Component>(Component: Type, componentName: ComponentName, providers: Providers): Type;
|
|
23
|
+
declare type ImplementationStatus = 'SUPPORTED' | 'USES_DEFAULT_IMPLEMENTATION' | 'NOT_SUPPORTED';
|
|
24
|
+
declare type Providers = {
|
|
25
|
+
google: {
|
|
26
|
+
ios: ImplementationStatus;
|
|
27
|
+
android: ImplementationStatus;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export declare type UIManagerCommand = number;
|
|
31
|
+
export declare type MapManagerCommand = any;
|
|
32
|
+
export declare type NativeComponent<H = unknown> = HostComponent<H> | ReturnType<typeof createNotSupportedComponent>;
|
|
33
|
+
declare type Component = typeof MapCallout | typeof MapCalloutSubview | typeof MapCircle | typeof MapHeatmap | typeof MapLocalTile | typeof MapMarker | typeof MapOverlay | typeof MapPolygon | typeof MapPolyline | typeof MapUrlTile | typeof MapWMSTile;
|
|
34
|
+
declare type ComponentName = 'Callout' | 'CalloutSubview' | 'Circle' | 'Heatmap' | 'LocalTile' | 'Marker' | 'Overlay' | 'Polygon' | 'Polyline' | 'UrlTile' | 'WMSTile';
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.googleMapIsInstalled = exports.createNotSupportedComponent = exports.getNativeMapName = exports.ProviderContext = exports.NOT_SUPPORTED = exports.USES_DEFAULT_IMPLEMENTATION = exports.SUPPORTED = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const ProviderConstants_1 = require("./ProviderConstants");
|
|
7
|
+
exports.SUPPORTED = 'SUPPORTED';
|
|
8
|
+
exports.USES_DEFAULT_IMPLEMENTATION = 'USES_DEFAULT_IMPLEMENTATION';
|
|
9
|
+
exports.NOT_SUPPORTED = 'NOT_SUPPORTED';
|
|
10
|
+
exports.ProviderContext = (0, react_1.createContext)(undefined);
|
|
11
|
+
function getNativeMapName(provider) {
|
|
12
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
13
|
+
return 'AIRMap';
|
|
14
|
+
}
|
|
15
|
+
if (provider === ProviderConstants_1.PROVIDER_GOOGLE) {
|
|
16
|
+
return 'AIRGoogleMap';
|
|
17
|
+
}
|
|
18
|
+
return 'AIRMap';
|
|
19
|
+
}
|
|
20
|
+
exports.getNativeMapName = getNativeMapName;
|
|
21
|
+
function getNativeComponentName(provider, component) {
|
|
22
|
+
return `${getNativeMapName(provider)}${component}`;
|
|
23
|
+
}
|
|
24
|
+
const createNotSupportedComponent = (message) => () => {
|
|
25
|
+
console.error(message);
|
|
26
|
+
return null;
|
|
27
|
+
};
|
|
28
|
+
exports.createNotSupportedComponent = createNotSupportedComponent;
|
|
29
|
+
exports.googleMapIsInstalled = !!react_native_1.UIManager.getViewManagerConfig(getNativeMapName(ProviderConstants_1.PROVIDER_GOOGLE));
|
|
30
|
+
function decorateMapComponent(Component, componentName, providers) {
|
|
31
|
+
const components = {};
|
|
32
|
+
const getDefaultComponent = () => (0, react_native_1.requireNativeComponent)(getNativeComponentName(undefined, componentName));
|
|
33
|
+
Component.contextType = exports.ProviderContext;
|
|
34
|
+
Component.prototype.getNativeComponent =
|
|
35
|
+
function getNativeComponent() {
|
|
36
|
+
const provider = this.context;
|
|
37
|
+
const key = provider || 'default';
|
|
38
|
+
if (components[key]) {
|
|
39
|
+
return components[key];
|
|
40
|
+
}
|
|
41
|
+
if (provider === ProviderConstants_1.PROVIDER_DEFAULT) {
|
|
42
|
+
components[key] = getDefaultComponent();
|
|
43
|
+
return components[key];
|
|
44
|
+
}
|
|
45
|
+
const providerInfo = providers[provider];
|
|
46
|
+
// quick fix. Previous code assumed android | ios
|
|
47
|
+
if (react_native_1.Platform.OS !== 'android' && react_native_1.Platform.OS !== 'ios') {
|
|
48
|
+
throw new Error(`react-native-maps doesn't support ${react_native_1.Platform.OS}`);
|
|
49
|
+
}
|
|
50
|
+
const platformSupport = providerInfo[react_native_1.Platform.OS];
|
|
51
|
+
const nativeComponentName = getNativeComponentName(provider, componentName);
|
|
52
|
+
if (platformSupport === exports.NOT_SUPPORTED) {
|
|
53
|
+
components[key] = (0, exports.createNotSupportedComponent)(`react-native-maps: ${nativeComponentName} is not supported on ${react_native_1.Platform.OS}`);
|
|
54
|
+
}
|
|
55
|
+
else if (platformSupport === exports.SUPPORTED) {
|
|
56
|
+
if (provider !== ProviderConstants_1.PROVIDER_GOOGLE ||
|
|
57
|
+
(react_native_1.Platform.OS === 'ios' && exports.googleMapIsInstalled)) {
|
|
58
|
+
components[key] = (0, react_native_1.requireNativeComponent)(nativeComponentName);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
// (platformSupport === USES_DEFAULT_IMPLEMENTATION)
|
|
63
|
+
if (!components.default) {
|
|
64
|
+
components.default = getDefaultComponent();
|
|
65
|
+
}
|
|
66
|
+
components[key] = components.default;
|
|
67
|
+
}
|
|
68
|
+
return components[key];
|
|
69
|
+
};
|
|
70
|
+
Component.prototype.getUIManagerCommand = function getUIManagerCommand(name) {
|
|
71
|
+
const nativeComponentName = getNativeComponentName(this.context, componentName);
|
|
72
|
+
return react_native_1.UIManager.getViewManagerConfig(nativeComponentName).Commands[name];
|
|
73
|
+
};
|
|
74
|
+
Component.prototype.getMapManagerCommand = function getMapManagerCommand(name) {
|
|
75
|
+
const nativeComponentName = `${getNativeComponentName(this.context, componentName)}Manager`;
|
|
76
|
+
return react_native_1.NativeModules[nativeComponentName][name];
|
|
77
|
+
};
|
|
78
|
+
return Component;
|
|
79
|
+
}
|
|
80
|
+
exports.default = decorateMapComponent;
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import MapView, { AnimatedMapView as Animated, MAP_TYPES, enableLatestRenderer, MapViewProps } from './MapView';
|
|
2
|
+
import Marker from './MapMarker';
|
|
3
|
+
export { MapMarker } from './MapMarker';
|
|
4
|
+
export type { MapMarkerProps } from './MapMarker';
|
|
5
|
+
import Overlay from './MapOverlay';
|
|
6
|
+
export { MapOverlay } from './MapOverlay';
|
|
7
|
+
export type { MapOverlayProps } from './MapOverlay';
|
|
8
|
+
export { default as Polyline, MapPolyline } from './MapPolyline';
|
|
9
|
+
export type { MapPolylineProps } from './MapPolyline';
|
|
10
|
+
export { default as Heatmap, MapHeatmap } from './MapHeatmap';
|
|
11
|
+
export type { MapHeatmapProps } from './MapHeatmap';
|
|
12
|
+
export { default as Polygon, MapPolygon } from './MapPolygon';
|
|
13
|
+
export type { MapPolygonProps } from './MapPolygon';
|
|
14
|
+
export { default as Circle, MapCircle } from './MapCircle';
|
|
15
|
+
export type { MapCircleProps } from './MapCircle';
|
|
16
|
+
export { default as UrlTile, MapUrlTile } from './MapUrlTile';
|
|
17
|
+
export type { MapUrlTileProps } from './MapUrlTile';
|
|
18
|
+
export { default as WMSTile, MapWMSTile } from './MapWMSTile';
|
|
19
|
+
export type { MapWMSTileProps } from './MapWMSTile';
|
|
20
|
+
export { default as LocalTile, MapLocalTile } from './MapLocalTile';
|
|
21
|
+
export type { MapLocalTileProps } from './MapLocalTile';
|
|
22
|
+
export { default as Callout, MapCallout } from './MapCallout';
|
|
23
|
+
export type { MapCalloutProps } from './MapCallout';
|
|
24
|
+
export { default as CalloutSubview, MapCalloutSubview, } from './MapCalloutSubview';
|
|
25
|
+
export type { MapCalloutSubviewProps } from './MapCalloutSubview';
|
|
26
|
+
export { default as AnimatedRegion } from './AnimatedRegion';
|
|
27
|
+
export { default as Geojson } from './Geojson';
|
|
28
|
+
export type { GeojsonProps } from './Geojson';
|
|
29
|
+
export { Marker, Overlay };
|
|
30
|
+
export type { MapViewProps };
|
|
31
|
+
export { Animated, MAP_TYPES, enableLatestRenderer };
|
|
32
|
+
export * from './ProviderConstants';
|
|
33
|
+
export * from './MapView.types';
|
|
34
|
+
export * from './sharedTypes';
|
|
35
|
+
export declare const MarkerAnimated: import("react-native").Animated.AnimatedComponent<typeof import("./MapMarker").MapMarker>;
|
|
36
|
+
export declare const OverlayAnimated: import("react-native").Animated.AnimatedComponent<typeof import("./MapOverlay").MapOverlay>;
|
|
37
|
+
export default MapView;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.OverlayAnimated = exports.MarkerAnimated = exports.enableLatestRenderer = exports.MAP_TYPES = exports.Animated = exports.Overlay = exports.Marker = exports.Geojson = exports.AnimatedRegion = exports.MapCalloutSubview = exports.CalloutSubview = exports.MapCallout = exports.Callout = exports.MapLocalTile = exports.LocalTile = exports.MapWMSTile = exports.WMSTile = exports.MapUrlTile = exports.UrlTile = exports.MapCircle = exports.Circle = exports.MapPolygon = exports.Polygon = exports.MapHeatmap = exports.Heatmap = exports.MapPolyline = exports.Polyline = exports.MapOverlay = exports.MapMarker = void 0;
|
|
33
|
+
const MapView_1 = __importStar(require("./MapView"));
|
|
34
|
+
Object.defineProperty(exports, "Animated", { enumerable: true, get: function () { return MapView_1.AnimatedMapView; } });
|
|
35
|
+
Object.defineProperty(exports, "MAP_TYPES", { enumerable: true, get: function () { return MapView_1.MAP_TYPES; } });
|
|
36
|
+
Object.defineProperty(exports, "enableLatestRenderer", { enumerable: true, get: function () { return MapView_1.enableLatestRenderer; } });
|
|
37
|
+
const MapMarker_1 = __importDefault(require("./MapMarker"));
|
|
38
|
+
exports.Marker = MapMarker_1.default;
|
|
39
|
+
var MapMarker_2 = require("./MapMarker");
|
|
40
|
+
Object.defineProperty(exports, "MapMarker", { enumerable: true, get: function () { return MapMarker_2.MapMarker; } });
|
|
41
|
+
const MapOverlay_1 = __importDefault(require("./MapOverlay"));
|
|
42
|
+
exports.Overlay = MapOverlay_1.default;
|
|
43
|
+
var MapOverlay_2 = require("./MapOverlay");
|
|
44
|
+
Object.defineProperty(exports, "MapOverlay", { enumerable: true, get: function () { return MapOverlay_2.MapOverlay; } });
|
|
45
|
+
var MapPolyline_1 = require("./MapPolyline");
|
|
46
|
+
Object.defineProperty(exports, "Polyline", { enumerable: true, get: function () { return __importDefault(MapPolyline_1).default; } });
|
|
47
|
+
Object.defineProperty(exports, "MapPolyline", { enumerable: true, get: function () { return MapPolyline_1.MapPolyline; } });
|
|
48
|
+
var MapHeatmap_1 = require("./MapHeatmap");
|
|
49
|
+
Object.defineProperty(exports, "Heatmap", { enumerable: true, get: function () { return __importDefault(MapHeatmap_1).default; } });
|
|
50
|
+
Object.defineProperty(exports, "MapHeatmap", { enumerable: true, get: function () { return MapHeatmap_1.MapHeatmap; } });
|
|
51
|
+
var MapPolygon_1 = require("./MapPolygon");
|
|
52
|
+
Object.defineProperty(exports, "Polygon", { enumerable: true, get: function () { return __importDefault(MapPolygon_1).default; } });
|
|
53
|
+
Object.defineProperty(exports, "MapPolygon", { enumerable: true, get: function () { return MapPolygon_1.MapPolygon; } });
|
|
54
|
+
var MapCircle_1 = require("./MapCircle");
|
|
55
|
+
Object.defineProperty(exports, "Circle", { enumerable: true, get: function () { return __importDefault(MapCircle_1).default; } });
|
|
56
|
+
Object.defineProperty(exports, "MapCircle", { enumerable: true, get: function () { return MapCircle_1.MapCircle; } });
|
|
57
|
+
var MapUrlTile_1 = require("./MapUrlTile");
|
|
58
|
+
Object.defineProperty(exports, "UrlTile", { enumerable: true, get: function () { return __importDefault(MapUrlTile_1).default; } });
|
|
59
|
+
Object.defineProperty(exports, "MapUrlTile", { enumerable: true, get: function () { return MapUrlTile_1.MapUrlTile; } });
|
|
60
|
+
var MapWMSTile_1 = require("./MapWMSTile");
|
|
61
|
+
Object.defineProperty(exports, "WMSTile", { enumerable: true, get: function () { return __importDefault(MapWMSTile_1).default; } });
|
|
62
|
+
Object.defineProperty(exports, "MapWMSTile", { enumerable: true, get: function () { return MapWMSTile_1.MapWMSTile; } });
|
|
63
|
+
var MapLocalTile_1 = require("./MapLocalTile");
|
|
64
|
+
Object.defineProperty(exports, "LocalTile", { enumerable: true, get: function () { return __importDefault(MapLocalTile_1).default; } });
|
|
65
|
+
Object.defineProperty(exports, "MapLocalTile", { enumerable: true, get: function () { return MapLocalTile_1.MapLocalTile; } });
|
|
66
|
+
var MapCallout_1 = require("./MapCallout");
|
|
67
|
+
Object.defineProperty(exports, "Callout", { enumerable: true, get: function () { return __importDefault(MapCallout_1).default; } });
|
|
68
|
+
Object.defineProperty(exports, "MapCallout", { enumerable: true, get: function () { return MapCallout_1.MapCallout; } });
|
|
69
|
+
var MapCalloutSubview_1 = require("./MapCalloutSubview");
|
|
70
|
+
Object.defineProperty(exports, "CalloutSubview", { enumerable: true, get: function () { return __importDefault(MapCalloutSubview_1).default; } });
|
|
71
|
+
Object.defineProperty(exports, "MapCalloutSubview", { enumerable: true, get: function () { return MapCalloutSubview_1.MapCalloutSubview; } });
|
|
72
|
+
var AnimatedRegion_1 = require("./AnimatedRegion");
|
|
73
|
+
Object.defineProperty(exports, "AnimatedRegion", { enumerable: true, get: function () { return __importDefault(AnimatedRegion_1).default; } });
|
|
74
|
+
var Geojson_1 = require("./Geojson");
|
|
75
|
+
Object.defineProperty(exports, "Geojson", { enumerable: true, get: function () { return __importDefault(Geojson_1).default; } });
|
|
76
|
+
__exportStar(require("./ProviderConstants"), exports);
|
|
77
|
+
__exportStar(require("./MapView.types"), exports);
|
|
78
|
+
__exportStar(require("./sharedTypes"), exports);
|
|
79
|
+
exports.MarkerAnimated = MapMarker_1.default.Animated;
|
|
80
|
+
exports.OverlayAnimated = MapOverlay_1.default.Animated;
|
|
81
|
+
exports.default = MapView_1.default;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { NativeSyntheticEvent } from 'react-native';
|
|
2
|
+
export declare type Provider = 'google' | undefined;
|
|
3
|
+
export declare type LatLng = {
|
|
4
|
+
latitude: number;
|
|
5
|
+
longitude: number;
|
|
6
|
+
};
|
|
7
|
+
export declare type Point = {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
export declare type Region = LatLng & {
|
|
12
|
+
latitudeDelta: number;
|
|
13
|
+
longitudeDelta: number;
|
|
14
|
+
};
|
|
15
|
+
export declare type Frame = Point & {
|
|
16
|
+
height: number;
|
|
17
|
+
width: number;
|
|
18
|
+
};
|
|
19
|
+
export declare type CalloutPressEvent = NativeSyntheticEvent<{
|
|
20
|
+
action: 'callout-press';
|
|
21
|
+
/**
|
|
22
|
+
* @platform iOS
|
|
23
|
+
*/
|
|
24
|
+
frame?: Frame;
|
|
25
|
+
/**
|
|
26
|
+
* @platform iOS
|
|
27
|
+
*/
|
|
28
|
+
id?: string;
|
|
29
|
+
/**
|
|
30
|
+
* @platform iOS
|
|
31
|
+
*/
|
|
32
|
+
point?: Point;
|
|
33
|
+
/**
|
|
34
|
+
* @platform Android
|
|
35
|
+
*/
|
|
36
|
+
coordinate?: LatLng;
|
|
37
|
+
/**
|
|
38
|
+
* @platform Android
|
|
39
|
+
*/
|
|
40
|
+
position?: Point;
|
|
41
|
+
}>;
|
|
42
|
+
export declare type LineCapType = 'butt' | 'round' | 'square';
|
|
43
|
+
export declare type LineJoinType = 'miter' | 'round' | 'bevel';
|
|
44
|
+
export declare type ClickEvent<T = {}> = NativeSyntheticEvent<{
|
|
45
|
+
coordinate: LatLng;
|
|
46
|
+
position: Point;
|
|
47
|
+
} & T>;
|
|
48
|
+
export declare type MarkerDeselectEvent = Omit<ClickEvent<{
|
|
49
|
+
action: 'marker-deselect';
|
|
50
|
+
id: string;
|
|
51
|
+
}>, 'position'>;
|
|
52
|
+
export declare type MarkerSelectEvent = Omit<ClickEvent<{
|
|
53
|
+
id: string;
|
|
54
|
+
action: 'marker-select';
|
|
55
|
+
}>, 'position'>;
|
|
56
|
+
export declare type MarkerDragEvent = ClickEvent<{
|
|
57
|
+
/**
|
|
58
|
+
* @platform iOS
|
|
59
|
+
*/
|
|
60
|
+
id?: string;
|
|
61
|
+
}>;
|
|
62
|
+
export declare type MarkerDragStartEndEvent = NativeSyntheticEvent<{
|
|
63
|
+
coordinate: LatLng;
|
|
64
|
+
/**
|
|
65
|
+
* @platform iOS
|
|
66
|
+
*/
|
|
67
|
+
id?: string;
|
|
68
|
+
/**
|
|
69
|
+
* @platform Android
|
|
70
|
+
*/
|
|
71
|
+
position?: Point;
|
|
72
|
+
}>;
|
|
73
|
+
export declare type MarkerPressEvent = NativeSyntheticEvent<{
|
|
74
|
+
id: string;
|
|
75
|
+
action: 'marker-press';
|
|
76
|
+
coordinate: LatLng;
|
|
77
|
+
/**
|
|
78
|
+
* @platform Android
|
|
79
|
+
*/
|
|
80
|
+
position?: Point;
|
|
81
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type Modify<T, R> = Omit<T, keyof R> & R;
|
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-maps",
|
|
3
3
|
"description": "React Native Mapview component for iOS + Android",
|
|
4
|
-
"main": "
|
|
5
|
-
"types": "index.d.ts",
|
|
4
|
+
"main": "lib/index.js",
|
|
6
5
|
"author": "Leland Richardson <leland.m.richardson@gmail.com>",
|
|
7
|
-
"
|
|
6
|
+
"homepage": "https://github.com/react-native-maps/react-native-maps#readme",
|
|
7
|
+
"version": "1.0.0-beta.10",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"scripts": {
|
|
10
10
|
"lint": "eslint . --max-warnings 0",
|
|
11
|
+
"tscheck": "tsc --noEmit",
|
|
12
|
+
"build": "tsc",
|
|
11
13
|
"test": "jest",
|
|
12
14
|
"prepare": "husky install",
|
|
13
15
|
"release": "semantic-release"
|
|
14
16
|
},
|
|
15
17
|
"files": [
|
|
16
|
-
"
|
|
18
|
+
"lib",
|
|
17
19
|
"android",
|
|
18
20
|
"ios",
|
|
19
|
-
"src",
|
|
20
21
|
"react-native-google-maps.podspec",
|
|
21
22
|
"react-native-maps.podspec",
|
|
22
23
|
"!android/build",
|
|
@@ -39,8 +40,8 @@
|
|
|
39
40
|
"mapkit"
|
|
40
41
|
],
|
|
41
42
|
"peerDependencies": {
|
|
42
|
-
"react": ">=
|
|
43
|
-
"react-native": ">= 0.
|
|
43
|
+
"react": ">= 17.0.1",
|
|
44
|
+
"react-native": ">= 0.64.3",
|
|
44
45
|
"react-native-web": ">= 0.11"
|
|
45
46
|
},
|
|
46
47
|
"peerDependenciesMeta": {
|
|
@@ -49,33 +50,24 @@
|
|
|
49
50
|
}
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
52
|
-
"@commitlint/cli": "
|
|
53
|
-
"@commitlint/config-conventional": "
|
|
54
|
-
"@react-native-community/eslint-config": "
|
|
53
|
+
"@commitlint/cli": "17.0.3",
|
|
54
|
+
"@commitlint/config-conventional": "17.0.3",
|
|
55
|
+
"@react-native-community/eslint-config": "3.0.3",
|
|
56
|
+
"@types/react-native": "0.69.2",
|
|
55
57
|
"babel-jest": "^27.3.1",
|
|
56
|
-
"eslint": "7.32.0",
|
|
57
|
-
"husky": "
|
|
58
|
+
"eslint": "^7.32.0",
|
|
59
|
+
"husky": "8.0.1",
|
|
58
60
|
"jest": "^27.3.1",
|
|
59
|
-
"
|
|
60
|
-
"react
|
|
61
|
-
"
|
|
62
|
-
"
|
|
61
|
+
"prettier": "2.7.1",
|
|
62
|
+
"react": "18.0.0",
|
|
63
|
+
"react-native": "0.69.1",
|
|
64
|
+
"semantic-release": "19.0.3",
|
|
65
|
+
"typescript": "4.7.4"
|
|
63
66
|
},
|
|
64
67
|
"dependencies": {
|
|
65
|
-
"@types/geojson": "^7946.0.
|
|
66
|
-
"deprecated-react-native-prop-types": "^2.3.0"
|
|
68
|
+
"@types/geojson": "^7946.0.8"
|
|
67
69
|
},
|
|
68
70
|
"jest": {
|
|
69
|
-
"preset": "react-native"
|
|
70
|
-
"testRegex": "<rootDir>/__tests__/.*|(\\.|/)(test|spec)\\.jsx?$",
|
|
71
|
-
"transform": {
|
|
72
|
-
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
|
|
73
|
-
},
|
|
74
|
-
"moduleFileExtensions": [
|
|
75
|
-
"js"
|
|
76
|
-
],
|
|
77
|
-
"transformIgnorePatterns": [
|
|
78
|
-
"node_modules/(?!@react-native|react-native)"
|
|
79
|
-
]
|
|
71
|
+
"preset": "react-native"
|
|
80
72
|
}
|
|
81
73
|
}
|
|
@@ -5,18 +5,17 @@ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
|
5
5
|
Pod::Spec.new do |s|
|
|
6
6
|
s.name = "react-native-google-maps"
|
|
7
7
|
s.version = package['version']
|
|
8
|
-
s.summary = "
|
|
9
|
-
|
|
10
|
-
s.
|
|
11
|
-
s.
|
|
12
|
-
s.
|
|
13
|
-
s.platform = :ios, "12.0"
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.authors = package["author"]
|
|
10
|
+
s.homepage = package["homepage"]
|
|
11
|
+
s.license = package["license"]
|
|
12
|
+
s.platform = :ios, "13.0"
|
|
14
13
|
|
|
15
14
|
s.source = { :git => "https://github.com/react-native-maps/react-native-maps.git", :tag=> "v#{s.version}" }
|
|
16
15
|
s.source_files = "ios/AirGoogleMaps/**/*.{h,m}"
|
|
17
16
|
s.compiler_flags = '-DHAVE_GOOGLE_MAPS=1', '-DHAVE_GOOGLE_MAPS_UTILS=1', '-fno-modules'
|
|
18
17
|
|
|
19
18
|
s.dependency 'React-Core'
|
|
20
|
-
s.dependency 'GoogleMaps', '
|
|
19
|
+
s.dependency 'GoogleMaps', '7.0.0'
|
|
21
20
|
s.dependency 'Google-Maps-iOS-Utils', '4.1.0'
|
|
22
21
|
end
|
|
@@ -5,12 +5,11 @@ package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
|
5
5
|
Pod::Spec.new do |s|
|
|
6
6
|
s.name = "react-native-maps"
|
|
7
7
|
s.version = package['version']
|
|
8
|
-
s.summary = "
|
|
9
|
-
|
|
10
|
-
s.
|
|
11
|
-
s.
|
|
12
|
-
s.
|
|
13
|
-
s.platform = :ios, "12.0"
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.authors = package["author"]
|
|
10
|
+
s.homepage = package["homepage"]
|
|
11
|
+
s.license = package["license"]
|
|
12
|
+
s.platform = :ios, "11.0"
|
|
14
13
|
|
|
15
14
|
s.source = { :git => "https://github.com/react-native-maps/react-native-maps.git", :tag=> "v#{s.version}" }
|
|
16
15
|
s.source_files = "ios/AirMaps/**/*.{h,m}"
|