@draftbit/core 42.4.2-50ce38.2 → 42.4.2-717ab1.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/lib/commonjs/components/Accordion/AccordionItem.js +16 -5
- package/lib/commonjs/components/Accordion/AccordionItem.js.map +1 -1
- package/lib/commonjs/components/Accordion/index.js.map +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetCancel.js.map +1 -1
- package/lib/commonjs/components/ActionSheet/ActionSheetItem.js.map +1 -1
- package/lib/commonjs/components/ActionSheet/index.js.map +1 -1
- package/lib/commonjs/components/AnimatedCircularProgress.js +11 -3
- package/lib/commonjs/components/AnimatedCircularProgress.js.map +1 -1
- package/lib/commonjs/components/AspectRatio.js +15 -2
- package/lib/commonjs/components/AspectRatio.js.map +1 -1
- package/lib/commonjs/components/AvatarEdit.js +16 -5
- package/lib/commonjs/components/AvatarEdit.js.map +1 -1
- package/lib/commonjs/components/Button.js +25 -11
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/CardBlock.js +17 -5
- package/lib/commonjs/components/CardBlock.js.map +1 -1
- package/lib/commonjs/components/CardContainer.js +14 -5
- package/lib/commonjs/components/CardContainer.js.map +1 -1
- package/lib/commonjs/components/CardContainerRating.js +16 -5
- package/lib/commonjs/components/CardContainerRating.js.map +1 -1
- package/lib/commonjs/components/CardInline.js.map +1 -1
- package/lib/commonjs/components/Carousel.js +15 -5
- package/lib/commonjs/components/Carousel.js.map +1 -1
- package/lib/commonjs/components/Checkbox/CheckboxRow.js +14 -6
- package/lib/commonjs/components/Checkbox/CheckboxRow.js.map +1 -1
- package/lib/commonjs/components/Checkbox/context.js +1 -1
- package/lib/commonjs/components/Checkbox/context.js.map +1 -1
- package/lib/commonjs/components/Checkbox/index.js.map +1 -1
- package/lib/commonjs/components/CircleImage.js +18 -5
- package/lib/commonjs/components/CircleImage.js.map +1 -1
- package/lib/commonjs/components/Config.js.map +1 -1
- package/lib/commonjs/components/Container.js +14 -5
- package/lib/commonjs/components/Container.js.map +1 -1
- package/lib/commonjs/components/DatePicker/DatePickerComponent.web.js.map +1 -1
- package/lib/commonjs/components/DeprecatedButton.js +15 -4
- package/lib/commonjs/components/DeprecatedButton.js.map +1 -1
- package/lib/commonjs/components/DeprecatedCardWrapper.js +2 -14
- package/lib/commonjs/components/DeprecatedCardWrapper.js.map +1 -1
- package/lib/commonjs/components/Elevation.js +14 -3
- package/lib/commonjs/components/Elevation.js.map +1 -1
- package/lib/commonjs/components/FAB.js +16 -5
- package/lib/commonjs/components/FAB.js.map +1 -1
- package/lib/commonjs/components/FieldSearchBarFull.js +1 -1
- package/lib/commonjs/components/FieldSearchBarFull.js.map +1 -1
- package/lib/commonjs/components/FormRow.js +18 -5
- package/lib/commonjs/components/FormRow.js.map +1 -1
- package/lib/commonjs/components/Header.js.map +1 -1
- package/lib/commonjs/components/HeaderLarge.js.map +1 -1
- package/lib/commonjs/components/HeaderMedium.js.map +1 -1
- package/lib/commonjs/components/HeaderOverline.js.map +1 -1
- package/lib/commonjs/components/IconButton.js +18 -5
- package/lib/commonjs/components/IconButton.js.map +1 -1
- package/lib/commonjs/components/Image.js +16 -6
- package/lib/commonjs/components/Image.js.map +1 -1
- package/lib/commonjs/components/Justification.js +2 -1
- package/lib/commonjs/components/Layout.js +41 -22
- package/lib/commonjs/components/Layout.js.map +1 -1
- package/lib/commonjs/components/{MapView/MapCallout.native.js → Markdown.js} +21 -23
- package/lib/commonjs/components/Markdown.js.map +1 -0
- package/lib/commonjs/components/NumberInput.js +15 -3
- package/lib/commonjs/components/NumberInput.js.map +1 -1
- package/lib/commonjs/components/Picker/PickerTypes.js +2 -1
- package/lib/commonjs/components/Portal/PortalManager.js.map +1 -1
- package/lib/commonjs/components/ProgressBar.js +19 -6
- package/lib/commonjs/components/ProgressBar.js.map +1 -1
- package/lib/commonjs/components/ProgressCircle.js.map +1 -1
- package/lib/commonjs/components/ProgressIndicator.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButton.js +14 -5
- package/lib/commonjs/components/RadioButton/RadioButton.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js +11 -2
- package/lib/commonjs/components/RadioButton/RadioButtonFieldGroup.js.map +1 -1
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js +15 -5
- package/lib/commonjs/components/RadioButton/RadioButtonGroup.js.map +1 -1
- package/lib/commonjs/components/ResizeMode.js +2 -1
- package/lib/commonjs/components/Row.js.map +1 -1
- package/lib/commonjs/components/RowBodyIcon.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageCaption.js.map +1 -1
- package/lib/commonjs/components/RowHeadlineImageIcon.js.map +1 -1
- package/lib/commonjs/components/ScreenContainer.js +18 -5
- package/lib/commonjs/components/ScreenContainer.js.map +1 -1
- package/lib/commonjs/components/Slider.js +17 -5
- package/lib/commonjs/components/Slider.js.map +1 -1
- package/lib/commonjs/components/StepIndicator.js.map +1 -1
- package/lib/commonjs/components/Stepper.js.map +1 -1
- package/lib/commonjs/components/Surface.js +11 -4
- package/lib/commonjs/components/Surface.js.map +1 -1
- package/lib/commonjs/components/Swiper/Swiper.js.map +1 -1
- package/lib/commonjs/components/TextField.js +18 -7
- package/lib/commonjs/components/TextField.js.map +1 -1
- package/lib/commonjs/components/TextInput.js +12 -2
- package/lib/commonjs/components/TextInput.js.map +1 -1
- package/lib/commonjs/components/ToggleButton.js +17 -5
- package/lib/commonjs/components/ToggleButton.js.map +1 -1
- package/lib/commonjs/components/Touchable.js +16 -5
- package/lib/commonjs/components/Touchable.js.map +1 -1
- package/lib/commonjs/components/Touchable.web.js.map +1 -1
- package/lib/commonjs/components/Typography.js.map +1 -1
- package/lib/commonjs/index.js +8 -20
- package/lib/commonjs/index.js.map +1 -1
- package/lib/module/components/Markdown.js +26 -0
- package/lib/module/components/Markdown.js.map +1 -0
- package/lib/module/components/Surface.js +2 -4
- package/lib/module/components/Surface.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/components/Markdown.d.ts +21 -0
- package/lib/typescript/src/index.d.ts +1 -1
- package/package.json +3 -4
- package/src/components/Markdown.js +21 -0
- package/src/components/Markdown.tsx +30 -0
- package/src/index.js +1 -1
- package/src/index.tsx +1 -1
- package/lib/commonjs/components/MapView/MapCallout.native.js.map +0 -1
- package/lib/commonjs/components/MapView/MapCallout.web.js +0 -47
- package/lib/commonjs/components/MapView/MapCallout.web.js.map +0 -1
- package/lib/commonjs/components/MapView/MapMarker.native.js +0 -86
- package/lib/commonjs/components/MapView/MapMarker.native.js.map +0 -1
- package/lib/commonjs/components/MapView/MapMarker.web.js +0 -116
- package/lib/commonjs/components/MapView/MapMarker.web.js.map +0 -1
- package/lib/commonjs/components/MapView/MapView.native.js +0 -162
- package/lib/commonjs/components/MapView/MapView.native.js.map +0 -1
- package/lib/commonjs/components/MapView/MapView.web.js +0 -55
- package/lib/commonjs/components/MapView/MapView.web.js.map +0 -1
- package/lib/commonjs/components/MapView/NoApiKey.js +0 -20
- package/lib/commonjs/components/MapView/NoApiKey.js.map +0 -1
- package/lib/commonjs/components/MapView/index.js +0 -32
- package/lib/commonjs/components/MapView/index.js.map +0 -1
- package/lib/commonjs/components/MapView/types.js +0 -5
- package/lib/commonjs/components/MapView/types.js.map +0 -1
- package/lib/module/components/MapView/MapCallout.native.js +0 -32
- package/lib/module/components/MapView/MapCallout.native.js.map +0 -1
- package/lib/module/components/MapView/MapCallout.web.js +0 -32
- package/lib/module/components/MapView/MapCallout.web.js.map +0 -1
- package/lib/module/components/MapView/MapMarker.native.js +0 -71
- package/lib/module/components/MapView/MapMarker.native.js.map +0 -1
- package/lib/module/components/MapView/MapMarker.web.js +0 -96
- package/lib/module/components/MapView/MapMarker.web.js.map +0 -1
- package/lib/module/components/MapView/MapView.native.js +0 -144
- package/lib/module/components/MapView/MapView.native.js.map +0 -1
- package/lib/module/components/MapView/MapView.web.js +0 -38
- package/lib/module/components/MapView/MapView.web.js.map +0 -1
- package/lib/module/components/MapView/NoApiKey.js +0 -7
- package/lib/module/components/MapView/NoApiKey.js.map +0 -1
- package/lib/module/components/MapView/index.js +0 -7
- package/lib/module/components/MapView/index.js.map +0 -1
- package/lib/module/components/MapView/types.js +0 -2
- package/lib/module/components/MapView/types.js.map +0 -1
- package/lib/typescript/src/components/MapView/MapCallout.native.d.ts +0 -33
- package/lib/typescript/src/components/MapView/MapCallout.web.d.ts +0 -4
- package/lib/typescript/src/components/MapView/MapMarker.native.d.ts +0 -57
- package/lib/typescript/src/components/MapView/MapMarker.web.d.ts +0 -12
- package/lib/typescript/src/components/MapView/MapView.native.d.ts +0 -130
- package/lib/typescript/src/components/MapView/MapView.web.d.ts +0 -4
- package/lib/typescript/src/components/MapView/NoApiKey.d.ts +0 -2
- package/lib/typescript/src/components/MapView/index.d.ts +0 -3
- package/lib/typescript/src/components/MapView/types.d.ts +0 -35
- package/src/components/MapView/MapCallout.native.js +0 -22
- package/src/components/MapView/MapCallout.native.tsx +0 -40
- package/src/components/MapView/MapCallout.web.js +0 -14
- package/src/components/MapView/MapCallout.web.tsx +0 -31
- package/src/components/MapView/MapMarker.native.js +0 -52
- package/src/components/MapView/MapMarker.native.tsx +0 -83
- package/src/components/MapView/MapMarker.web.js +0 -68
- package/src/components/MapView/MapMarker.web.tsx +0 -105
- package/src/components/MapView/MapView.native.js +0 -118
- package/src/components/MapView/MapView.native.tsx +0 -163
- package/src/components/MapView/MapView.web.js +0 -18
- package/src/components/MapView/MapView.web.tsx +0 -42
- package/src/components/MapView/NoApiKey.js +0 -5
- package/src/components/MapView/NoApiKey.tsx +0 -10
- package/src/components/MapView/index.js +0 -6
- package/src/components/MapView/index.tsx +0 -6
- package/src/components/MapView/types.js +0 -1
- package/src/components/MapView/types.tsx +0 -38
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import NativeMapView, { PROVIDER_GOOGLE } from "react-native-maps";
|
|
3
|
-
import NoApiKey from "./NoApiKey";
|
|
4
|
-
import { COMPONENT_TYPES, createBoolProp, createColorProp, createNumberProp, createTextProp, } from "@draftbit/types";
|
|
5
|
-
const MapView = ({ provider = PROVIDER_GOOGLE, apiKey, latitude, latitudeDelta, longitude, longitudeDelta, showsCompass = false, rotateEnabled = true, zoomEnabled = true, loadingEnabled = true, scrollEnabled = true, loadingBackgroundColor, loadingIndicatorColor, mapType = "standard", style, children, }) => {
|
|
6
|
-
if (!apiKey) {
|
|
7
|
-
return React.createElement(NoApiKey, null);
|
|
8
|
-
}
|
|
9
|
-
return (React.createElement(NativeMapView, { provider: provider, mapType: mapType, showsCompass: showsCompass, rotateEnabled: rotateEnabled, zoomEnabled: zoomEnabled, initialRegion: {
|
|
10
|
-
latitude: latitude,
|
|
11
|
-
longitude: longitude,
|
|
12
|
-
latitudeDelta: latitudeDelta,
|
|
13
|
-
longitudeDelta: longitudeDelta,
|
|
14
|
-
}, loadingEnabled: loadingEnabled, scrollEnabled: scrollEnabled, loadingBackgroundColor: loadingBackgroundColor, loadingIndicatorColor: loadingIndicatorColor, style: style }, children));
|
|
15
|
-
};
|
|
16
|
-
export default MapView;
|
|
17
|
-
export const SEED_DATA = {
|
|
18
|
-
name: "Map View",
|
|
19
|
-
tag: "MapView",
|
|
20
|
-
description: "A map view",
|
|
21
|
-
category: COMPONENT_TYPES.media,
|
|
22
|
-
layout: {},
|
|
23
|
-
props: {
|
|
24
|
-
apiKey: createTextProp({
|
|
25
|
-
label: "API Key",
|
|
26
|
-
description: "Your API Key",
|
|
27
|
-
required: true,
|
|
28
|
-
defaultValue: null,
|
|
29
|
-
}),
|
|
30
|
-
provider: createTextProp({
|
|
31
|
-
label: "Provider",
|
|
32
|
-
description: "The maps provider",
|
|
33
|
-
required: false,
|
|
34
|
-
defaultValue: "google",
|
|
35
|
-
options: ["google"],
|
|
36
|
-
}),
|
|
37
|
-
latitudeDelta: createNumberProp({
|
|
38
|
-
label: "Latitude Delta",
|
|
39
|
-
description: "The latitude delta for the map's initial region",
|
|
40
|
-
required: false,
|
|
41
|
-
precision: 0.0001,
|
|
42
|
-
}),
|
|
43
|
-
longitudeDelta: createNumberProp({
|
|
44
|
-
label: "Longitude Delta",
|
|
45
|
-
description: "The longitude delta for the map's initial region",
|
|
46
|
-
required: false,
|
|
47
|
-
precision: 0.0001,
|
|
48
|
-
}),
|
|
49
|
-
latitude: createNumberProp({
|
|
50
|
-
label: "Latitude",
|
|
51
|
-
description: "The longitude for the map's initial region",
|
|
52
|
-
required: false,
|
|
53
|
-
precision: 0.000001,
|
|
54
|
-
min: -90,
|
|
55
|
-
max: 90,
|
|
56
|
-
}),
|
|
57
|
-
longitude: createNumberProp({
|
|
58
|
-
label: "Latitude",
|
|
59
|
-
description: "The latitude for the map's initial region",
|
|
60
|
-
required: false,
|
|
61
|
-
precision: 0.000001,
|
|
62
|
-
min: -180,
|
|
63
|
-
max: 180,
|
|
64
|
-
}),
|
|
65
|
-
mapType: createTextProp({
|
|
66
|
-
label: "Map Type",
|
|
67
|
-
description: "The type of map to show",
|
|
68
|
-
required: false,
|
|
69
|
-
defaultValue: "standard",
|
|
70
|
-
options: [
|
|
71
|
-
"standard",
|
|
72
|
-
"satellite",
|
|
73
|
-
"hybrid",
|
|
74
|
-
"terrain",
|
|
75
|
-
"none",
|
|
76
|
-
"mutedStandard",
|
|
77
|
-
],
|
|
78
|
-
}),
|
|
79
|
-
zoomEnabled: createBoolProp({
|
|
80
|
-
label: "Zoom Enabled",
|
|
81
|
-
description: "Whether zooming is enabled",
|
|
82
|
-
required: false,
|
|
83
|
-
defaultValue: true,
|
|
84
|
-
}),
|
|
85
|
-
showsCompass: createBoolProp({
|
|
86
|
-
label: "Shows Compass",
|
|
87
|
-
description: "Whether compass is shown",
|
|
88
|
-
required: false,
|
|
89
|
-
defaultValue: false,
|
|
90
|
-
}),
|
|
91
|
-
rotateEnabled: createBoolProp({
|
|
92
|
-
label: "Rotate Enabled",
|
|
93
|
-
description: "Whether rotating the map is enabled",
|
|
94
|
-
required: false,
|
|
95
|
-
defaultValue: true,
|
|
96
|
-
}),
|
|
97
|
-
scrollEnabled: createBoolProp({
|
|
98
|
-
label: "Scroll Enabled",
|
|
99
|
-
description: "Whether scrolling the map view is enabled",
|
|
100
|
-
required: false,
|
|
101
|
-
defaultValue: true,
|
|
102
|
-
}),
|
|
103
|
-
loadingEnabled: createBoolProp({
|
|
104
|
-
label: "Loading Enabled",
|
|
105
|
-
description: "If true a loading indicator will show while the map is loading",
|
|
106
|
-
required: false,
|
|
107
|
-
defaultValue: true,
|
|
108
|
-
}),
|
|
109
|
-
loadingIndicatorColor: createColorProp({
|
|
110
|
-
label: "Loading Indicator Color",
|
|
111
|
-
description: "Color of the loading indicator",
|
|
112
|
-
}),
|
|
113
|
-
loadingBackgroundColor: createColorProp({
|
|
114
|
-
label: "Loading Background Color",
|
|
115
|
-
description: "Color of the background to show while the map is loading",
|
|
116
|
-
}),
|
|
117
|
-
},
|
|
118
|
-
};
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import NativeMapView, { PROVIDER_GOOGLE } from "react-native-maps";
|
|
3
|
-
import { MapViewProps } from "./types";
|
|
4
|
-
import NoApiKey from "./NoApiKey";
|
|
5
|
-
import {
|
|
6
|
-
COMPONENT_TYPES,
|
|
7
|
-
createBoolProp,
|
|
8
|
-
createColorProp,
|
|
9
|
-
createNumberProp,
|
|
10
|
-
createTextProp,
|
|
11
|
-
} from "@draftbit/types";
|
|
12
|
-
|
|
13
|
-
const MapView: React.FC<MapViewProps> = ({
|
|
14
|
-
provider = PROVIDER_GOOGLE,
|
|
15
|
-
apiKey,
|
|
16
|
-
latitude,
|
|
17
|
-
latitudeDelta,
|
|
18
|
-
longitude,
|
|
19
|
-
longitudeDelta,
|
|
20
|
-
showsCompass = false,
|
|
21
|
-
rotateEnabled = true,
|
|
22
|
-
zoomEnabled = true,
|
|
23
|
-
loadingEnabled = true,
|
|
24
|
-
scrollEnabled = true,
|
|
25
|
-
loadingBackgroundColor,
|
|
26
|
-
loadingIndicatorColor,
|
|
27
|
-
mapType = "standard",
|
|
28
|
-
style,
|
|
29
|
-
children,
|
|
30
|
-
}) => {
|
|
31
|
-
if (!apiKey) {
|
|
32
|
-
return <NoApiKey />;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return (
|
|
36
|
-
<NativeMapView
|
|
37
|
-
provider={provider}
|
|
38
|
-
mapType={mapType}
|
|
39
|
-
showsCompass={showsCompass}
|
|
40
|
-
rotateEnabled={rotateEnabled}
|
|
41
|
-
zoomEnabled={zoomEnabled}
|
|
42
|
-
initialRegion={{
|
|
43
|
-
latitude: latitude as number,
|
|
44
|
-
longitude: longitude as number,
|
|
45
|
-
latitudeDelta: latitudeDelta as number,
|
|
46
|
-
longitudeDelta: longitudeDelta as number,
|
|
47
|
-
}}
|
|
48
|
-
loadingEnabled={loadingEnabled}
|
|
49
|
-
scrollEnabled={scrollEnabled}
|
|
50
|
-
loadingBackgroundColor={loadingBackgroundColor}
|
|
51
|
-
loadingIndicatorColor={loadingIndicatorColor}
|
|
52
|
-
style={style}
|
|
53
|
-
>
|
|
54
|
-
{children}
|
|
55
|
-
</NativeMapView>
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export default MapView;
|
|
60
|
-
|
|
61
|
-
export const SEED_DATA = {
|
|
62
|
-
name: "Map View",
|
|
63
|
-
tag: "MapView",
|
|
64
|
-
description: "A map view",
|
|
65
|
-
category: COMPONENT_TYPES.media,
|
|
66
|
-
layout: {},
|
|
67
|
-
props: {
|
|
68
|
-
apiKey: createTextProp({
|
|
69
|
-
label: "API Key",
|
|
70
|
-
description: "Your API Key",
|
|
71
|
-
required: true,
|
|
72
|
-
defaultValue: null,
|
|
73
|
-
}),
|
|
74
|
-
provider: createTextProp({
|
|
75
|
-
label: "Provider",
|
|
76
|
-
description: "The maps provider",
|
|
77
|
-
required: false,
|
|
78
|
-
defaultValue: "google",
|
|
79
|
-
options: ["google"],
|
|
80
|
-
}),
|
|
81
|
-
latitudeDelta: createNumberProp({
|
|
82
|
-
label: "Latitude Delta",
|
|
83
|
-
description: "The latitude delta for the map's initial region",
|
|
84
|
-
required: false,
|
|
85
|
-
precision: 0.0001,
|
|
86
|
-
}),
|
|
87
|
-
longitudeDelta: createNumberProp({
|
|
88
|
-
label: "Longitude Delta",
|
|
89
|
-
description: "The longitude delta for the map's initial region",
|
|
90
|
-
required: false,
|
|
91
|
-
precision: 0.0001,
|
|
92
|
-
}),
|
|
93
|
-
latitude: createNumberProp({
|
|
94
|
-
label: "Latitude",
|
|
95
|
-
description: "The longitude for the map's initial region",
|
|
96
|
-
required: false,
|
|
97
|
-
precision: 0.000001,
|
|
98
|
-
min: -90,
|
|
99
|
-
max: 90,
|
|
100
|
-
}),
|
|
101
|
-
longitude: createNumberProp({
|
|
102
|
-
label: "Latitude",
|
|
103
|
-
description: "The latitude for the map's initial region",
|
|
104
|
-
required: false,
|
|
105
|
-
precision: 0.000001,
|
|
106
|
-
min: -180,
|
|
107
|
-
max: 180,
|
|
108
|
-
}),
|
|
109
|
-
mapType: createTextProp({
|
|
110
|
-
label: "Map Type",
|
|
111
|
-
description: "The type of map to show",
|
|
112
|
-
required: false,
|
|
113
|
-
defaultValue: "standard",
|
|
114
|
-
options: [
|
|
115
|
-
"standard",
|
|
116
|
-
"satellite",
|
|
117
|
-
"hybrid",
|
|
118
|
-
"terrain",
|
|
119
|
-
"none",
|
|
120
|
-
"mutedStandard",
|
|
121
|
-
],
|
|
122
|
-
}),
|
|
123
|
-
zoomEnabled: createBoolProp({
|
|
124
|
-
label: "Zoom Enabled",
|
|
125
|
-
description: "Whether zooming is enabled",
|
|
126
|
-
required: false,
|
|
127
|
-
defaultValue: true,
|
|
128
|
-
}),
|
|
129
|
-
showsCompass: createBoolProp({
|
|
130
|
-
label: "Shows Compass",
|
|
131
|
-
description: "Whether compass is shown",
|
|
132
|
-
required: false,
|
|
133
|
-
defaultValue: false,
|
|
134
|
-
}),
|
|
135
|
-
rotateEnabled: createBoolProp({
|
|
136
|
-
label: "Rotate Enabled",
|
|
137
|
-
description: "Whether rotating the map is enabled",
|
|
138
|
-
required: false,
|
|
139
|
-
defaultValue: true,
|
|
140
|
-
}),
|
|
141
|
-
scrollEnabled: createBoolProp({
|
|
142
|
-
label: "Scroll Enabled",
|
|
143
|
-
description: "Whether scrolling the map view is enabled",
|
|
144
|
-
required: false,
|
|
145
|
-
defaultValue: true,
|
|
146
|
-
}),
|
|
147
|
-
loadingEnabled: createBoolProp({
|
|
148
|
-
label: "Loading Enabled",
|
|
149
|
-
description:
|
|
150
|
-
"If true a loading indicator will show while the map is loading",
|
|
151
|
-
required: false,
|
|
152
|
-
defaultValue: true,
|
|
153
|
-
}),
|
|
154
|
-
loadingIndicatorColor: createColorProp({
|
|
155
|
-
label: "Loading Indicator Color",
|
|
156
|
-
description: "Color of the loading indicator",
|
|
157
|
-
}),
|
|
158
|
-
loadingBackgroundColor: createColorProp({
|
|
159
|
-
label: "Loading Background Color",
|
|
160
|
-
description: "Color of the background to show while the map is loading",
|
|
161
|
-
}),
|
|
162
|
-
},
|
|
163
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { GoogleMap, LoadScript } from "@react-google-maps/api";
|
|
3
|
-
import NoApiKey from "./NoApiKey";
|
|
4
|
-
import { StyleSheet } from "react-native";
|
|
5
|
-
const MapView = ({ apiKey, latitude, longitude, rotateEnabled = true, scrollEnabled = true, mapType = "standard", style, children, }) => {
|
|
6
|
-
if (!apiKey) {
|
|
7
|
-
return React.createElement(NoApiKey, null);
|
|
8
|
-
}
|
|
9
|
-
return (React.createElement(LoadScript, { googleMapsApiKey: apiKey },
|
|
10
|
-
React.createElement(GoogleMap, { mapContainerStyle: StyleSheet.flatten(style), center: {
|
|
11
|
-
lat: latitude || 0,
|
|
12
|
-
lng: longitude || 0,
|
|
13
|
-
}, mapTypeId: mapType, zoom: 14, options: {
|
|
14
|
-
scrollwheel: scrollEnabled,
|
|
15
|
-
rotateControl: rotateEnabled,
|
|
16
|
-
} }, children)));
|
|
17
|
-
};
|
|
18
|
-
export default MapView;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { GoogleMap, LoadScript } from "@react-google-maps/api";
|
|
3
|
-
import NoApiKey from "./NoApiKey";
|
|
4
|
-
import { MapViewProps } from "./types";
|
|
5
|
-
import { StyleSheet } from "react-native";
|
|
6
|
-
|
|
7
|
-
const MapView: React.FC<MapViewProps> = ({
|
|
8
|
-
apiKey,
|
|
9
|
-
latitude,
|
|
10
|
-
longitude,
|
|
11
|
-
rotateEnabled = true,
|
|
12
|
-
scrollEnabled = true,
|
|
13
|
-
mapType = "standard",
|
|
14
|
-
style,
|
|
15
|
-
children,
|
|
16
|
-
}) => {
|
|
17
|
-
if (!apiKey) {
|
|
18
|
-
return <NoApiKey />;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<LoadScript googleMapsApiKey={apiKey}>
|
|
23
|
-
<GoogleMap
|
|
24
|
-
mapContainerStyle={StyleSheet.flatten(style) as React.CSSProperties}
|
|
25
|
-
center={{
|
|
26
|
-
lat: latitude || 0,
|
|
27
|
-
lng: longitude || 0,
|
|
28
|
-
}}
|
|
29
|
-
mapTypeId={mapType}
|
|
30
|
-
zoom={14}
|
|
31
|
-
options={{
|
|
32
|
-
scrollwheel: scrollEnabled,
|
|
33
|
-
rotateControl: rotateEnabled,
|
|
34
|
-
}}
|
|
35
|
-
>
|
|
36
|
-
{children}
|
|
37
|
-
</GoogleMap>
|
|
38
|
-
</LoadScript>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default MapView;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { StyleProp, ViewStyle } from "react-native";
|
|
2
|
-
import { MapTypes } from "react-native-maps";
|
|
3
|
-
|
|
4
|
-
export interface MapMarkerProps {
|
|
5
|
-
latitude: number;
|
|
6
|
-
longitude: number;
|
|
7
|
-
title?: string;
|
|
8
|
-
description?: string;
|
|
9
|
-
pinColor?: string;
|
|
10
|
-
flat?: boolean;
|
|
11
|
-
style?: StyleProp<ViewStyle>;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface MapViewProps {
|
|
15
|
-
apiKey: string;
|
|
16
|
-
provider?: "google" | null;
|
|
17
|
-
latitudeDelta?: number;
|
|
18
|
-
longitudeDelta?: number;
|
|
19
|
-
latitude?: number;
|
|
20
|
-
longitude?: number;
|
|
21
|
-
mapType?: MapTypes;
|
|
22
|
-
zoomEnabled?: boolean;
|
|
23
|
-
showsCompass?: boolean;
|
|
24
|
-
rotateEnabled?: boolean;
|
|
25
|
-
scrollEnabled?: boolean;
|
|
26
|
-
loadingEnabled?: boolean;
|
|
27
|
-
loadingBackgroundColor?: string;
|
|
28
|
-
loadingIndicatorColor?: string;
|
|
29
|
-
style?: StyleProp<ViewStyle>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface CalloutProps {
|
|
33
|
-
title?: string;
|
|
34
|
-
description?: string;
|
|
35
|
-
anchor: any;
|
|
36
|
-
onPress?: (event: any) => void;
|
|
37
|
-
showTooltip?: boolean;
|
|
38
|
-
}
|