1{"version":3,"file":"Map.types.js","sourceRoot":"","sources":["../src/Map.types.ts"],"names":[],"mappings":"","sourcesContent":["import { PropsWithChildren } from 'react';\nimport { ViewProps } from 'react-native';\n\nimport { CircleObject } from './Circle';\nimport { ClusterObject } from './Cluster';\nimport { CameraMove, LocationChangePriority } from './Common.types';\nimport {\n  ClusterPressEvent,\n  MarkerEvent,\n  OnLocationButtonPressEvent,\n  OnLocationChangeEvent,\n  OnLocationDotPressEvent,\n  OnPoiClickEvent,\n  OnRegionChangeEvent,\n} from './Events';\nimport { GeoJsonObject } from './GeoJson';\nimport { HeatmapObject } from './Heatmap';\nimport { KMLObject } from './KML';\nimport { ExpoMap, OnMapPressEvent } from './Map';\nimport { MarkerObject } from './Marker';\nimport { OverlayObject } from './Overlay';\nimport { PolygonObject } from './Polygon';\nimport { PolylineObject } from './Polyline';\nexport type MapTypes = 'normal' | 'hybrid' | 'satellite' | 'terrain';\n\n/**\n * Prop for managing map type.\n */\nexport type MapType = {\n  /**\n   * Type of map (one of normal, hybrid, satellite, terrain').\n   *\n   * @default 'normal'\n   */\n  mapType: MapTypes;\n};\n\n/**\n * Internal prop for managing markers displayed on the map.\n */\nexport type Markers = {\n  /**\n   * Array of {@link MarkerObject}.\n   */\n  markers: MarkerObject[];\n};\n\n/**\n * Internal prop for managing polygons displayed on the map.\n */\nexport type Polygons = {\n  /**\n   * Array of {@link PolygonObject}.\n   */\n  polygons: PolygonObject[];\n};\n\n/**\n * Internal prop for managing polylines displayed on the map.\n */\nexport type Polylines = {\n  /**\n   * Array of {@link PolylineObject}.\n   */\n  polylines: PolylineObject[];\n};\n\n/**\n * Internal prop for managing overlays displayed on the map.\n */\nexport type Overlays = {\n  /**\n   * Array of {@link OverlayObject}.\n   */\n  overlays: OverlayObject[];\n};\n\n/**\n * Internal prop for managing circles displayed on the map.\n */\nexport type Circles = {\n  /**\n   * Array of {@link CircleObject}.\n   */\n  circles: CircleObject[];\n};\n\n/**\n * Internal prop for managing clusters displayed on the map.\n */\nexport type Clusters = {\n  /**\n   * Array of {@link ClusterObject}.\n   */\n  clusters: ClusterObject[];\n};\n\n/**\n * Internal prop for managing provided KMLs\n */\nexport type KMLs = {\n  /**\n   * Array of {@link KMLObject}\n   */\n  kmls: KMLObject[];\n};\n\n/**\n * Internal prop for managing provided KMLs\n */\nexport type GeoJsons = {\n  /**\n   * Array of {@link GeoJsonObject}\n   */\n  geojsons: GeoJsonObject[];\n};\n\n/**\n * Prop for managing Google Maps styling settings.\n */\nexport type GoogleMapsStyling = {\n  /**\n   * Valid Google Maps style JSON string,\n   * please use https://mapstyle.withgoogle.com to generate style JSONs.\n   *\n   * This prop works only when provider == `google`.\n   */\n  googleMapsJsonStyleString: string;\n};\n\n/**\n * Props for managing map gestures settings.\n */\nexport type Gestures = {\n  /**\n   * If `true` rotate gestures are enabled.\n   *\n   * @default false\n   */\n  enableRotateGestures: boolean;\n  /**\n   * If `true` scroll gestures are enabled.\n   *\n   * @default true\n   */\n  enableScrollGestures: boolean;\n  /**\n   * If `true` tilt gestures are enabled.\n   *\n   * @default false\n   */\n  enableTiltGestures: boolean;\n  /**\n   * If `true` zoom gestures are enabled.\n   *\n   * @default true\n   */\n  enableZoomGestures: boolean;\n};\n\n/**\n * Props for managing map controls settings.\n */\nexport type Controls = {\n  /**\n   * If `true` zoom controls are visible.\n   *\n   * This prop works only when provider == `google`.\n   *\n   * @default true\n   */\n  showZoomControls: boolean;\n  /**\n   * If `true` compass icon can be visible.\n   *\n   * It appears only when map is moved so that it is not facing north.\n   *\n   * @default true\n   */\n  showCompass: boolean;\n  /**\n   * If `true` map toolbar can be visible.\n   *\n   * It is visible when a marker is tapped and hidden when the marker is no longer in focus.\n   *\n   * This prop works only when provider == `google`.\n   *\n   * @default true\n   */\n  showMapToolbar: boolean;\n  /**\n   * If `true` map toolbar can be visible.\n   *\n   * It is visble when map can access user location.\n   *\n   * @default true\n   */\n  showMyLocationButton: boolean;\n  /**\n   * TODO when functionality fully added\n   *\n   * @default true\n   */\n  showLevelPicker: boolean;\n};\n\n/**\n * Props for managing traffic layer.\n */\nexport type Traffic = {\n  /**\n   * If `true` traffic data is displayed on map.\n   *\n   * @default false\n   */\n  enableTraffic: boolean;\n};\n\n/**\n * Props for callback events.\n */\nexport type Callbacks = {\n  /**\n   * Callback to call when the map is loaded.\n   *\n   * @default () => {}\n   */\n  onMapLoaded?: () => void;\n\n  /**\n   * Callback to call when user clicks on the map.\n   *\n   * @default () => {}\n   */\n  onMapPress?: (event: OnMapPressEvent) => void;\n\n  /**\n   * Callback to call when the user double presses the map\n   *\n   * @default () => {}\n   */\n  onDoublePress?: (event: OnMapPressEvent) => void;\n\n  /**\n   * Callback to call when the user long presses the map\n   *\n   * @default () => {}\n   */\n  onLongPress?: (event: OnMapPressEvent) => void;\n\n  /**\n   * Callback to call when camera is moving.\n   *\n   * @default (event: OnRegionChangeEvent) => {}\n   */\n  onRegionChange?: (event: OnRegionChangeEvent) => void;\n\n  /**\n   * Callback to call when camera has started moving.\n   *\n   * @default (event: OnRegionChangeEvent) => {}\n   */\n  onRegionChangeStarted?: (event: OnRegionChangeEvent) => void;\n\n  /**\n   * Callback to call when camera has stopped moving.\n   *\n   * @default (event: OnRegionChangeEvent) => {}\n   */\n  onRegionChangeComplete?: (event: OnRegionChangeEvent) => void;\n\n  /**\n   * Callback to call when the user presses a point of interest.\n   *\n   * @default (event: OnRegionChangeEvent) => {}\n   */\n  onPoiClick?: (event: OnPoiClickEvent) => void;\n\n  /**\n   * Callback to call when the user presses a marker\n   *\n   * @default (event: MarkerEvent) => {}\n   */\n  onMarkerPress?: (event: MarkerEvent) => void;\n\n  /**\n   * Callback to call on every position update of a marker.\n   *\n   * @default (event: MarkerEvent) => {}\n   */\n  onMarkerDrag?: (event: MarkerEvent) => void;\n\n  /**\n   * Callback to call when the user started moving a marker.\n   *\n   * @default (event: OnMarkerDragStarted) => {}\n   */\n  onMarkerDragStarted?: (event: MarkerEvent) => void;\n\n  /**\n   * Callback to call when the user ended moving a marker.\n   *\n   * @default (event: MarkerEvent) => {}\n   */\n  onMarkerDragComplete?: (event: MarkerEvent) => void;\n\n  /**\n   * Callback to call when the user presses on a cluster.\n   *\n   * @default (event: ClusterPressEvent) => {}\n   */\n  onClusterPress?: (event: ClusterPressEvent) => void;\n\n  /**\n   * Callback to call when the user presses the current location dot.\n   * Not supported on `iOS GoogleMaps`\n   * @default (event: OnLocationDotPressEvent) => {}\n   */\n  onLocationDotPress?: (event: OnLocationDotPressEvent) => void;\n\n  /**\n   * Callback to call when the user presses the location button.\n   *\n   * @default (event: OnLocationButtonPressEvent) => {}\n   */\n  onLocationButtonPress?: (event: OnLocationButtonPressEvent) => void;\n\n  /**\n   * Callback to call when a change in user's location is detected\n   * @default (event: OnLocationChangeEvent) => {}\n   */\n  onLocationChange?: (event: OnLocationChangeEvent) => void;\n\n  /**\n   * Value in milliseconds describing how often the onLocationChangeCallback will check if the user location has changed.\n   * Reducing this value might have negative impact on battery life\n   * @default 5000\n   */\n  onLocationChangeEventInterval?: number;\n\n  /**\n   * Determines how accurate requests for location change event should be\n   * @default LocationChangePriority.PRIORITY_NO_POWER\n   */\n  onLocationChangeEventPriority?: LocationChangePriority;\n};\n\nexport type POICategoryType =\n  | 'airport'\n  | 'atm'\n  | 'bank'\n  | 'beach'\n  | 'cafe'\n  | 'hospital'\n  | 'hotel'\n  | 'museum'\n  | 'pharmacy'\n  | 'store';\n\n/**\n * Props for POI handling.\n */\nexport type POI = {\n  /**\n   * If 'true' search bar for searching pois is enabled.\n   *\n   * This prop works only when provider == `apple`.\n   *\n   * @default false\n   */\n  enablePOISearching: boolean;\n  /**\n   * If 'true' points of interest are being displayed.\n   *\n   * @default false\n   */\n  enablePOIs: boolean;\n  /**\n   * If not empty POIs use will be filterd to specified types.\n   *\n   * This prop works only when provider == `apple`.\n   *\n   * @default []\n   */\n  enablePOIFilter: [POICategoryType] | [];\n\n  /**\n   * Creates a search request for given place.\n   *\n   * Passed value shoulld be a result of auto complete.\n   *\n   */\n  createPOISearchRequest: string;\n  /**\n   * If `true` POIs are clickable and after the click name of POI is displayed above the POI's location.\n   * Please note, this field is only effective when `enablePOI` option is equal to `true`.\n   *\n   * @default false\n   */\n  clickablePOIs: boolean;\n};\n\nexport type AppleMapsPOI = POI;\nexport type GoogleMapsPOI = Omit<POI, 'enablePOISearching' | 'enablePOIFilter'>;\nexport type Heatmaps = {\n  /**\n   * Array of {@link HeatmapObject}.\n   */\n  heatmaps: HeatmapObject[];\n};\n\nexport type GoogleMapsControls = Controls;\n\nexport type ZoomLevels =\n  | 1\n  | 2\n  | 3\n  | 4\n  | 5\n  | 6\n  | 7\n  | 8\n  | 9\n  | 10\n  | 11\n  | 12\n  | 13\n  | 14\n  | 15\n  | 16\n  | 17\n  | 18\n  | 19\n  | 20\n  | 21\n  | 22;\n\n/**\n * Prop for setting camera position.\n */\nexport type CameraPosition = {\n  /**\n   * Camera position object\n   *\n   * @default\n   * {\n   *   latitude: 51.51,\n   *   longitude: 0.13,\n   *   zoom: 4,\n   *   animate: true,\n   * }\n   */\n  initialCameraPosition: CameraMove;\n};\n\nexport type AppleMapsControls = Omit<Controls, 'showMapToolbar' | 'showZoomControls'>;\n\n/**\n * Props for Google Maps implementation.\n */\nexport type NativeExpoGoogleMapsViewProps = ViewProps &\n  React.RefAttributes<ExpoMap> &\n  PropsWithChildren<\n    MapType &\n      GoogleMapsStyling &\n      Gestures &\n      Markers &\n      Polygons &\n      Polylines &\n      GoogleMapsControls &\n      CameraPosition &\n      Circles &\n      Clusters &\n      Traffic &\n      KMLs &\n      GeoJsons &\n      GoogleMapsPOI &\n      Overlays &\n      Heatmaps &\n      Callbacks\n  >;\n\n/**\n * Props for Apple Maps implementation.\n */\nexport type NativeExpoAppleMapsViewProps = ViewProps &\n  React.RefAttributes<ExpoMap> &\n  PropsWithChildren<\n    MapType &\n      Gestures &\n      Markers &\n      Polygons &\n      Polylines &\n      AppleMapsControls &\n      CameraPosition &\n      Circles &\n      Clusters &\n      Traffic &\n      KMLs &\n      GeoJsons &\n      AppleMapsPOI\n  >;\n\nexport type ExpoMapRef = {\n  getSearchCompletions: () => Promise<void>;\n  moveCamera: () => Promise<CameraPosition>;\n};\n\nexport type Providers = 'google' | 'apple';\n\n/**\n * Prop for managing map provider.\n */\nexport type Provider = {\n  /**\n   * Provider you want to use for your map, please note `apple` provider is only avaliable on Apple devices.\n   *\n   * @default 'google'\n   */\n  provider: Providers;\n};\n\n/**\n * General Expo Map props.\n *\n * All of the ExpoMap props are optional.\n */\nexport type ExpoMapViewProps = ViewProps &\n  PropsWithChildren<\n    Partial<\n      Provider &\n        MapType &\n        Controls &\n        GoogleMapsStyling &\n        Gestures &\n        CameraPosition &\n        Traffic &\n        POI &\n        KMLs &\n        Heatmaps &\n        Callbacks\n    >\n  >;\n\nexport type DefaultNativeExpoMapViewProps = MapType &\n  Controls &\n  Gestures &\n  CameraPosition &\n  Traffic &\n  POI;\n\nexport type ExpoMapState = Markers &\n  Polygons &\n  Polylines &\n  Circles &\n  Clusters &\n  KMLs &\n  GeoJsons &\n  Overlays &\n  Heatmaps;\n"]}