Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-native-maps-osmdroid

fqborges5880.26.1-rc1TypeScript support: included

React Native Mapview component for iOS + Android

react, react-native, react-component, map, mapview, google-maps, mapkit, osmdroid, openstreetmaps

readme

react-native-maps-osmdroid npm version

Clone of react-native-maps (React Native Map components for iOS + Android) supporting Open Street Maps based on osmdroid.

Attention: experimental!

This implementation is meant to be version-to-version fully compatible with react-native-maps.

For iOS and all Google providers, the code is exactly the same, as they are merged as is.

For osmdroid provider, the following are implemented:

  • MapView: working with some limitations like no map styles.
  • Markers: most of it working, except the color for default markers and z-index.
  • Callouts: working. Needed some hacks as result of how it is implemented on osmdroid vs my lack of knowledge on react-native internals.
  • Polygons, working except for z-index and geodesic prop.
  • Polylines, working except for z-index and geodesic prop.
  • Cricle, working except for z-index and geodesic prop.

Differences to react-native-maps

  • You should import/require from 'react-native-maps-osmdroid'.
  • The default provider on Android is osmdroid. The osmdroid gradle dependency is already included in the library with a default version set. If needed, you can change the version using the project wide variable osmdroidVersion. Example: ext { osmdroidVersion = '6.0.3' } in your top-level build.gradle.
  • Google maps is an optional dependency for Android on this package, and the dependencies are not included on gradle build. To enable using google maps you should set the project wide variable and add the dependencies to your build.gradle:
    implementation "com.google.android.gms:play-services-base:${playServicesVersion}"
    implementation "com.google.android.gms:play-services-maps:${playServicesVersion}"
    implementation "com.google.maps.android:android-maps-utils:0.5"
  • More details on project wide variable can be found in the original installation instructions bellow.

From now, what follows is the original README.md

React Native Map components for iOS + Android

Installation

See Installation Instructions.

See Setup Instructions for the Included Example Project.

Compatibility

Due to the rapid changes being made in the React Native ecosystem, we are not officially going to support this module on anything but the latest version of React Native. With that said, we will do our best to stay compatible with older versions as much that is practical, and the peer dependency of this requirement is set to "react-native": "*" explicitly for this reason. If you are using an older version of React Native with this module though, some features may be buggy.

Note about React requires

Since react-native 0.25.0, React should be required from node_modules. React Native versions from 0.18 should be working out of the box, for lower versions you should add react as a dependency in your package.json.

Component API

<MapView /> Component API

<Marker /> Component API

<Callout /> Component API

<Polygon /> Component API

<Polyline /> Component API

<Circle /> Component API

<Overlay /> Component API

<Heatmap /> Component API

<Geojson /> Component API

General Usage

import MapView from 'react-native-maps';

or

var MapView = require('react-native-maps');

This MapView component is built so that features on the map (such as Markers, Polygons, etc.) are specified as children of the MapView itself. This provides an intuitive and react-like API for declaratively controlling features on the map.

Rendering a Map with an initial region

MapView

  <MapView
    initialRegion={{
      latitude: 37.78825,
      longitude: -122.4324,
      latitudeDelta: 0.0922,
      longitudeDelta: 0.0421,
    }}
  />

Using a MapView while controlling the region as state

getInitialState() {
  return {
    region: {
      latitude: 37.78825,
      longitude: -122.4324,
      latitudeDelta: 0.0922,
      longitudeDelta: 0.0421,
    },
  };
}

onRegionChange(region) {
  this.setState({ region });
}

render() {
  return (
    <MapView
      region={this.state.region}
      onRegionChange={this.onRegionChange}
    />
  );
}

Rendering a list of markers on a map

import { Marker } from 'react-native-maps';

<MapView
  region={this.state.region}
  onRegionChange={this.onRegionChange}
>
  {this.state.markers.map(marker => (
    <Marker
      coordinate={marker.latlng}
      title={marker.title}
      description={marker.description}
    />
  ))}
</MapView>

Rendering a Marker with a custom view

<Marker coordinate={marker.latlng}>
  <MyCustomMarkerView {...marker} />
</Marker>

Rendering a Marker with a custom image

<Marker
  coordinate={marker.latlng}
  image={require('../assets/pin.png')}
/>

Rendering a custom Marker with a custom Callout

import { Callout } from 'react-native-maps';

<Marker coordinate={marker.latlng}>
  <MyCustomMarkerView {...marker} />
  <Callout>
    <MyCustomCalloutView {...marker} />
  </Callout>
</Marker>

Draggable Markers

<MapView initialRegion={...}>
  <Marker draggable
    coordinate={this.state.x}
    onDragEnd={(e) => this.setState({ x: e.nativeEvent.coordinate })}
  />
</MapView>

Using a custom Tile Overlay

Tile Overlay using tile server

import { UrlTile } from 'react-native-maps';

<MapView
  region={this.state.region}
  onRegionChange={this.onRegionChange}
>
  <UrlTile
    /**
     * The url template of the tile server. The patterns {x} {y} {z} will be replaced at runtime
     * For example, http://c.tile.openstreetmap.org/{z}/{x}/{y}.png
     */
    urlTemplate={this.state.urlTemplate}
    /**
     * The maximum zoom level for this tile overlay. Corresponds to the maximumZ setting in
     * MKTileOverlay. iOS only.
     */
    maximumZ={19}
    /**
     * flipY allows tiles with inverted y coordinates (origin at bottom left of map)
     * to be used. Its default value is false.
     */
    flipY={false}
  />
</MapView>

For Android: add the following line in your AndroidManifest.xml

<uses-permission android:name="android.permission.INTERNET" />

For IOS: configure App Transport Security in your app

Tile Overlay using local tiles

Tiles can be stored locally within device using xyz tiling scheme and displayed as tile overlay as well. This is usefull especially for offline map usage when tiles are available for selected map region within device storage.

import { LocalTile } from 'react-native-maps';

<MapView
  region={this.state.region}
  onRegionChange={this.onRegionChange}
>
  <LocalTile
   /**
    * The path template of the locally stored tiles. The patterns {x} {y} {z} will be replaced at runtime
    * For example, /storage/emulated/0/mytiles/{z}/{x}/{y}.png
    */
   pathTemplate={this.state.pathTemplate}
   /**
    * The size of provided local tiles (usually 256 or 512).
    */
   tileSize={256}
  />
</MapView>

For Android: LocalTile is still just overlay over original map tiles. It means that if device is online, underlying tiles will be still downloaded. If original tiles download/display is not desirable set mapType to 'none'. For example:

<MapView
  mapType={Platform.OS == "android" ? "none" : "standard"}
>

See OSM Wiki for how to download tiles for offline usage.

Overlaying other components on the map

Place components you that wish to overlay MapView underneath the MapView closing tag. Absolutely position these elements.

render() {
  return (
    <MapView
      region={this.state.region}
    />
    <OverlayComponent
      style={{position: “absolute”, bottom: 50}}
    />
  );
}

Customizing the map style

Create the json object, or download a generated one from the google style generator.

// The generated json object
mapStyle = [ ... ]

render() {
  return (
    <MapView
      region={this.state.region}
      onRegionChange={this.onRegionChange}
      customMapStyle={mapStyle}
    />
  );
}

For iOS, in addition to providing the mapStyle you will need to do the following

import MapView, { PROVIDER_GOOGLE } from 'react-native-maps'

// ...

<MapView
  provider={PROVIDER_GOOGLE}
  customMapStyle={MapStyle}
>

Then add the AirGoogleMaps directory:

https://github.com/react-native-community/react-native-maps/blob/1e71a21f39e7b88554852951f773c731c94680c9/docs/installation.md#ios

An unofficial step-by-step guide is also available at https://gist.github.com/heron2014/e60fa003e9b117ce80d56bb1d5bfe9e0

Examples

To run examples:

npm i
npm start

#Android
npm run run:android

#iOS
npm run build:ios
npm run run:ios

MapView Events

The <MapView /> component and its child components have several events that you can subscribe to. This example displays some of them in a log as a demonstration.

Tracking Region / Location

Programmatically Changing Region

One can change the mapview's position using refs and component methods, or by passing in an updated region prop. The component methods will allow one to animate to a given position like the native API could.

Changing the style of the map

Arbitrary React Views as Markers

Using the MapView with the Animated API

The <MapView /> component can be made to work with the Animated API, having the entire region prop be declared as an animated value. This allows one to animate the zoom and position of the MapView along with other gestures, giving a nice feel.

Further, Marker views can use the animated API to enhance the effect.

Issue: Since android needs to render its marker views as a bitmap, the animations APIs may not be compatible with the Marker views. Not sure if this can be worked around yet or not.

Markers' coordinates can also be animated, as shown in this example:

Polygon Creator

Other Overlays

So far, <Circle />, <Polygon />, and <Polyline /> are available to pass in as children to the <MapView /> component.

Gradient Polylines (iOS MapKit only)

Gradient polylines can be created using the strokeColors prop of the <Polyline> component.

Default Markers

Default markers will be rendered unless a custom marker is specified. One can optionally adjust the color of the default marker by using the pinColor prop.

Custom Callouts

Callouts to markers can be completely arbitrary react views, similar to markers. As a result, they can be interacted with like any other view.

Additionally, you can fall back to the standard behavior of just having a title/description through the <Marker />'s title and description props.

Custom callout views can be the entire tooltip bubble, or just the content inside of the system default bubble.

To handle press on specific subview of callout use <CalloutSubview /> with onPress. See Callouts.js example.

Image-based Markers

Markers can be customized by just using images, and specified using the image prop.

Draggable Markers

Markers are draggable, and emit continuous drag events to update other UI during drags.

Lite Mode ( Android )

Enable lite mode on Android with liteMode prop. Ideal when having multiple maps in a View or ScrollView.

On Poi Click (Google Maps Only)

Poi are clickable, you can catch the event to get its information (usually to get the full detail from Google Place using the placeId).

Animated Region

The MapView can accept an AnimatedRegion value as its region prop. This allows you to utilize the Animated API to control the map's center and zoom.

import MapView, { AnimatedRegion, Animated } from 'react-native-maps';

getInitialState() {
  return {
    region: new AnimatedRegion({
      latitude: LATITUDE,
      longitude: LONGITUDE,
      latitudeDelta: LATITUDE_DELTA,
      longitudeDelta: LONGITUDE_DELTA,
    }),
  };
}

onRegionChange(region) {
  this.state.region.setValue(region);
}

render() {
  return (
    <Animated
      region={this.state.region}
      onRegionChange={this.onRegionChange}
    />
  );
}

Animated Marker Position

Markers can also accept an AnimatedRegion value as a coordinate.

import Mapview, { AnimatedRegion, Marker } from 'react-native-maps';

getInitialState() {
  return {
    coordinate: new AnimatedRegion({
      latitude: LATITUDE,
      longitude: LONGITUDE,
    }),
  };
}

componentWillReceiveProps(nextProps) {
  const duration = 500

  if (this.props.coordinate !== nextProps.coordinate) {
    if (Platform.OS === 'android') {
      if (this.marker) {
        this.marker._component.animateMarkerToCoordinate(
          nextProps.coordinate,
          duration
        );
      }
    } else {
      this.state.coordinate.timing({
        ...nextProps.coordinate,
        duration
      }).start();
    }
  }
}

render() {
  return (
    <MapView initialRegion={...}>
      <MapView.Marker.Animated
        ref={marker => { this.marker = marker }}
        coordinate={this.state.coordinate}
      />
    </MapView>
  );
}

If you need a smoother animation to move the marker on Android, you can modify the previous example:

// ...

componentWillReceiveProps(nextProps) {
  const duration = 500

  if (this.props.coordinate !== nextProps.coordinate) {
    if (Platform.OS === 'android') {
      if (this.marker) {
        this.marker._component.animateMarkerToCoordinate(
          nextProps.coordinate,
          duration
        );
      }
    } else {
      this.state.coordinate.timing({
        ...nextProps.coordinate,
        duration
      }).start();
    }
  }
}

render() {
  return (
    <MapView initialRegion={...}>
      <Marker.Animated
        ref={marker => { this.marker = marker }}
        coordinate={this.state.coordinate}
      />
    </MapView>
  );
}

Take Snapshot of map

import MapView, { Marker } from 'react-native-maps';

getInitialState() {
  return {
    coordinate: {
      latitude: LATITUDE,
      longitude: LONGITUDE,
    },
  };
}

takeSnapshot () {
  // 'takeSnapshot' takes a config object with the
  // following options
  const snapshot = this.map.takeSnapshot({
    width: 300,      // optional, when omitted the view-width is used
    height: 300,     // optional, when omitted the view-height is used
    region: {..},    // iOS only, optional region to render
    format: 'png',   // image formats: 'png', 'jpg' (default: 'png')
    quality: 0.8,    // image quality: 0..1 (only relevant for jpg, default: 1)
    result: 'file'   // result types: 'file', 'base64' (default: 'file')
  });
  snapshot.then((uri) => {
    this.setState({ mapSnapshot: uri });
  });
}

render() {
  return (
    <View>
      <MapView initialRegion={...} ref={map => { this.map = map }}>
        <Marker coordinate={this.state.coordinate} />
      </MapView>
      <Image source={{ uri: this.state.mapSnapshot.uri }} />
      <TouchableOpacity onPress={this.takeSnapshot}>
        Take Snapshot
      </TouchableOpacity>
    </View>
  );
}

Zoom to Specified Markers

Pass an array of marker identifiers to have the map re-focus.

Zoom to Specified Coordinates

Pass an array of coordinates to focus a map region on said coordinates.

Troubleshooting

My map is blank

  • Make sure that you have properly installed react-native-maps.
  • Check in the logs if there is more informations about the issue.
  • Try setting the style of the MapView to an absolute position with top, left, right and bottom values set.
  • Make sure you have enabled Google Maps API in Google developer console
const styles = StyleSheet.create({
  map: {
    ...StyleSheet.absoluteFillObject,
  },
});
<MapView
  style={styles.map}
  // other props
/>

Inputs don't focus

  • When inputs don't focus or elements don't respond to tap, look at the order of the view hierarchy, sometimes the issue could be due to ordering of rendered components, prefer putting MapView as the first component.

Bad:

<View>
  <TextInput/>
  <MapView/>
</View>

Good:

<View>
  <MapView/>
  <TextInput/>
</View>

License

 Copyright (c) 2017 Airbnb

 Licensed under the The MIT License (MIT) (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

    https://raw.githubusercontent.com/airbnb/react-native-maps/master/LICENSE

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

changelog

Change Log

0.26.1 (October 3, 2019)

  • Android: #3103 Support for RN 0.60.5
  • Android: #3103 "AIRMap" was not found in the UIManager

0.26.0 (September 30, 2019)

  • iOS: #2999 Update GoogleMaps pod to 3.2.0
  • iOS: #2395 Allow using onPanDrag while scrollEnabled=true
  • iOS: #3051 Add flat property binding on Marker for iOS
  • Android: #3007 Add Overlay onPress event
  • Android: #3001 Add @ReactModule annotation to help turbo modules processor
  • Common: #3045 Add heading to the onUserLocationChange listener
  • Common: #2937 Add onDoublePress callback
  • Common: #2960 Heatmaps for Android and iOS
  • Common: #2959 Added GeoJSON support by default
  • Common: #2975 Convert to new react native config format (RN 0.60)
  • Common: #2973 Fix select annotation when show/hide callout view

0.25.0 (July 11, 2019)

  • Android: #2941 Fix build gradle to allow jettifier to run correctly
  • Android: #2741 Use a shared image icon for markers when they share the same image URI
  • Android: #2557 Fix bug when changing subview of Marker to icon
  • Android: #2392 Add support for loading base64 encoded image
  • iOS: #2423 Handle annotations without images on iOS map snapshot
  • iOS: #2881 Update podspec to use GoogleMaps 3.1.0
  • iOS: #2253 TestID's for e2e automation
  • iOS: #2826 Follow up for #2253
  • iOS: #2397 Add compass location offsets for iOS maps
  • Common: #2568 Support for WMS Layer support
  • Common: #2017 Update the Google Maps custom map style if changed after initialization
  • Common: #2903 Fix react snapshot undefined warning

0.24.2 (April 17, 2019)

  • iOS: #2818 Google Maps - Weak refs to gesture targets to address memory leak

0.24.1 (April 16, 2019)

  • iOS: #2815 Google Maps - Free instance variable in getActionForTarget to address memory leak

0.24.0 (April 11, 2019)

  • Common: #2740 Fix deprecated UIManager usage when accessing component names
  • Common: #2393 add typings for pointForCoordinate & coordinateForPoint
  • Common: #2732 Implement ability to flip y coordinate for Google Map tiles.
  • Android: #2765 Allow setting of play-services version through ext
  • Android: #2702 Enable RN projects to define the Android AppCompat Library version
  • Android: #2720 Fix Android dependencies and build errors
  • Android: #2682 Implement 'tappable' prop on polyline for Android
  • Android: #2417 Support for lineCap and lineDash pattern
  • Android: #2727 fix build: only apply mvn push gradle plugin if POM_ARTIFACT_ID is set
  • iOS: #2446 fix iOS GoogleMaps camera always animate
  • iOS: #2746 onPanDrag support for iOS
  • iOS: #2581 Custom callout improvements 🎉
  • iOS: #2794 Fix CalloutSubview on Apple maps
  • iOS: #2716 Fix Memory Leaks
  • Docs: #2675 #2685 #2707 #2704
  • Example: #2792 Upgrade Example to react-native to 0.59.3
  • TypeScript: #2705 Add Marker icon property introduced in #2650 to index.d.ts

0.23.0 (January 17, 2019)

  • Common: #2651 Use resolveAssetSource method from Image
  • Common: #2576 Fix import error for MapMarker and MapOverlay
  • Common: #2615 Added helper method for calculating bounding box from region
  • Common: #2607 Fix camera type definition error
  • Common: #2563 Added camera system and deprecate animateTo methods
  • Common: #2571 Added getMapBoundaries to MapView
  • Common/iOS: #2650 Added icon prop for MapMarker
  • iOS: #2414 Fix path for yoga in Podfile
  • iOS: #2627 Added tileSize prop for MapUrlTile
  • iOS: #2608 Fix animateToCamera
  • Android: #2653 Defaults to the map services version instead of play services
  • Android: #2587 Allow specifying a different version for base and maps on android
  • Android: #2598 Fix crash for cannot getActiveLevelIndex
  • Docs: #2639 Added note about recursive framework search paths
  • Docs: #2631 Added notes for Google Play Services

0.22.1 (November 8, 2018)

  • Common: #2548 Moved babel-plugin-module-resolver and babel-preset-react-native from dependencies to devDependencies
  • Android: #2555 Fixed #2507
  • Android: #2545 Fixed “The specified child already has a parent”
  • Docs: #2541 Improve installation docs
  • Docs: #2550 Specify how to use Google Maps
  • Docs: #2559 Clarify cacheEnabled is apple maps only

0.22.0 (October 11, 2018)

  • Common: #2049 Added animateToNavigation method to MapView
  • Common: #2207, #2232 Added timestamp property to onUserLocationChange event callback
  • Common: #2479, #2524 Added edgePadding to fitToSuppliedMarkers function
  • Common: #2448 Added custom indoor picker level
  • Common: #2238 Support the asset:// scheme for images
  • Common: #2136, #2184 Modifications/Enhancements to MapView.UrlTile
  • Common: #2039 Fix for pointForCoordinate and coordinateForPoint
  • Common: #2217 Using ColorPropType to validate all color props more accurately
  • iOS: #2396 Added installation for iOS via react-native link
  • iOS: #2243 Added support of lineDashPattern polyline props to iOS Google Maps
  • iOS: #2149 Added paddingAdjustmentBehavior for Google Maps on iOS
  • iOS: #2231 Prefix DummyView class
  • iOS: #2229 Use global imports for new Pods dependencies in AIRGoogleMap
  • iOS: #2248 Make tiles display at the same physical size regardless of pixel density on iOS devices
  • iOS: #2306 Prefix or eliminate globals in AIRMapMarker
  • iOS: #2351 Added support for calloutAnchor with Google Maps on iOS
  • iOS: #2501 Fixed issue that app crashes after trigger Marker onDragEnd
  • iOS: #2359 Fixed zIndex didn't work on map moving on iOS 11
  • iOS: #2185 Fixed Xcode warnings for format, pointer type, unused var
  • iOS: #2154 Fixed CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF warnings
  • iOS: #2341 Fixed warnings about self
  • Android: #2224 Respect tappable prop on Android
  • Android: #2390 Consider pixel density in coordinate<->point conversion
  • Android: #2477, #2487 Implemented tracksViewChanges on Android
  • Android: #2478 Let onVisibilityChanged() be called on children (mainly fixes Image issues)
  • Android: #2375 Fixed lineCap of Polyline
  • Android: #2320 Fixed custom marker updates on Android
  • Android: #2197 Fixed overlay removal bug
  • Android: #2317 Fixed disabling the toolbar and my location button
  • Android: #2472 Fixed compilation error due to minSDK in manifest
  • Android: #2172 Fixed crash for Android API level below 18 on isFromMockProvider
  • Internal: #2462 Fixed packager script path in pacakage.json
  • Internal: #2480 Fix peer dependencies
  • TypeScript: #2165 Typings improvements & fixes
  • Docs: #2541 Vastly improved installation guideline
  • Docs: #2171 Add 'none' option to docs for mapType of MapView
  • Docs: #2174 Add opacity to Marker API docs
  • Docs: #2181, #2219 Add note about mandatory NSLocationWhenInUseUsageDescription
  • Docs: #2381, #2358, #2363, #2429, #2425 Documentation improvements

0.21.0 (March 31, 2018)

  • Common: #2030 Broadened peer-dependency support
  • Common: #2035, #2113, & #2141 Typescript improvements and fixes
  • Common: #2011 Add suport for KML file (Only Markers)
  • Common: #2053 Fix 'module undefined' for React Native >= 0.54
  • Common: #2131 Fix initialRegion for React Native >= 0.54
  • Common: #2115 Upgrade React Native peer dependency to 0.54
  • Common: #2032 Add onMyLocationChange event
  • Common: #2039 Fixed problem with pointForCoordinate and coordinateForPoint methods
  • Common: #2050 Add support for onPoiClick
  • iOS: #2022 Add support for Map.Overlay
  • iOS: #2068 Prevent marker press from calling MapView onPress
  • iOS: #2057 Fixed polygon and polyline not re-rendering when changing tile URL (AirMaps)
  • iOS: #2101 Fixed re-render not updating MapView.Circle component in UI when radius or center coordinates change (AirMaps)
  • Android: #2111 Allow vector drawables to be used as markers
  • Android: #2132 Add mock-provider boolean on each location update
  • Android: #2047 Check for presence of project-wide (ext) Gradle configuration properties compileSdkVersion, targetSdkVersion, buildToolsVersion, supportLibVersion, googlePlayServicesVersion, and androidMapsUtilsVersion. This provides a better mechanism for aligning the requirements of the module with that of the host project.
  • Android: #2096 Updated gradle configuration for gradle 3.0.0+

0.20.1 (February 13, 2018)

0.20.0 (February 9, 2018)

  • Common: #1889 Fix for 'Animated.Region undefined constructor' in recent react-native version.
  • iOS: #1853 Fixed onMapReady no longer getting called on iOS
  • Android: #1906 Manage Zoom Controls visibility on the map
  • iOS: #1911 Add gradient/multi-color polyline support for iOS (MapKit)
  • Android: #1918 Ground Overlay Support
  • Common: #1851 New methods to convert between LatLng and Point
  • iOS: #1846 Fix callouts appearing behind markers
  • iOS: #1969 Added tracksInfoWindowChanges property to iOS Google Maps
  • iOS: #1960 Fixed gradient polyline not always fully drawn + stability issues
  • iOS: #1953 Fix onMapReady not getting called after first time, initialRegion lat/lng delta not setting properly, setRegion method getting called even when map is not ready and prevent onRegionChange/ onRegionChangeComplete event until initialRegion or region is set.
  • Android: #1781 Polygon holes support
  • Android: #1976 Add native animation for Markers on Android

0.19.0 (December 14, 2017)

  • Common: #1715 Fixed region/initialRegion null overrides of this.props
  • Common: #1876 Added support for locally stored tile overlay
  • iOS: #1854 Update GoogleMaps dependency to 2.5.0

0.18.3 (November 30, 2017)

  • Android: #1839 [AirGoogleMapManager] Use RCTDirectEventBlock for onMarkerPress

0.18.2 (November 29, 2017)

  • Android: #1835 [AirMapView] Null check map instance on view methods

0.18.1 (November 28, 2017)

  • Android: #1828 [AirMapManager] Update MapBuilder for getCommandsMap to support all entires

0.18.0 (November 28, 2017)

  • Android/iOS: #1587 Add support to set map boundaries
  • Android/iOS: #1750 Add mapPadding property
  • Common: #1792 Make all components use ViewPropTypes || View.propTypes
  • iOS: #1774 Added missing parameters to google map screenshot
  • iOS: #1824 Add new iOS mutedStandard map-type
  • iOS: #1705 Enable control of Google Maps Marker tracksViewChanges property.
  • Android: #1710 Added support for new Android camera movement APIs
  • iOS: #1741 Fixed iOS google MapView.onMarkerPress not receiving the marker identifier
  • iOS: #1816 Fix The name of the given podspec ‘yoga' doesn't match the expected one ‘Yoga'
  • iOS: #1797 Fixed onMapReady event on iOS to resemble onMapReady on Android
  • Common: #1817 Allow fitToCoordinates to be called without options parameter

0.17.1 (October 18, 2017)

  • Common: #1687 Fixed TypeScript definitions

0.17.0 (October 11, 2017)

  • iOS: #1527 Added [iOS / Google Maps] support for showsIndoorLevelPicker
  • iOS/Android: #1544 Adds support to animateToBearing and animateToViewingAngle ( IOS + Android )
  • JS: #1503 Remove caret from "react": "^16.0.0-alpha.12
  • Android: #1521 Fix rare android crashes when map size is 0
  • Common: #1601 Added Typescript Definitions
  • Android: #1612 Remove legalNotice from android AirMapModule

0.16.4 (September 13, 2017)

  • Android: #1643 [MapMarker] fix android release crash on custom marker

0.16.3 (September 2, 2017)

  • iOS: #1603 Added missing satellite option for iOS Google Maps
  • iOS: #1579 Set initial region on view

0.16.2 (August 17, 2017)

  • Android: #1563 Add missing native method for setting initial region
  • iOS: #1187 Reverted due to build issues

0.16.1 (August 15, 2017)

  • Android: #1428 Add ability to load marker image from drawable
  • iOS: #1187 Improve marker performance
  • iOS/Android: #1458 Add Google Maps legalNotice constant
  • JS: #1546 Fix initial region native prop

0.16.0 (August 9, 2017)

  • Android: #1481 Handle Android RN 0.47 breaking change
  • iOS: #1357 add MKTileOverlayRenderer
  • iOS: #1369 Add onMapReady callback
  • Android/iOS/JS: #1360 Add minZoom and maxZoom properties for android and ios
  • JS: #1479 Fix timing function used in AnimatedRegion.spring

0.15.3 (June 27, 2017)

  • iOS: #1362 Updates for React 0.43-0.45 and React 16.
  • JS: #1323 Updates for React 0.43-0.45 and React 16.
  • Android/iOS/JS: #1440 Updates for React 0.43-0.45 and React 16.
  • iOS: #1115 Fix animateToCoordinate and animateToRegion
  • Android: #1403 Fix an NPE

0.15.2 (May 20, 2017)

  • iOS: #1351 Fix file references

0.15.1 (May 19, 2017)

  • iOS: #1341 Fix compile error in rn version >= 0.40
  • iOS: #1194 Add onPress support for Google Maps Polyline
  • iOS: #1326 Add Marker rotation for Google Maps on iOS
  • Android: #1311 Fix overlay issue
  • Common #1313 Fix Android sourceDir for react-native-link

0.15.0 (May 8, 2017)

  • iOS: #1195 Rename project file to fix iOS build error
  • Android: Update Google Play Services to version 10.2.4

0.14.0 (April 4, 2017)

Enhancements

  • Restructure project #1164

  • Add showsIndoorLevelPicker -> setIndoorLevelPickerEnabled to MapView #1019 #1188

  • iOS - Added onPress support for Polygons on Google Maps #1024

  • Add customized user location annotation text #1049

  • iOS - Google Maps - Add showsMyLocationButton support #1157

Patches

  • Fix getResources() null crash in mapview #1188

  • Rename MapKit category to avoid conflicts with the one in RN #1172

  • Upgrade GMS dependencies to 10.2.0 #1169

  • fix multiple-instance memory leak #1130

  • fix onSelected event for markers with custom view #1079

  • Crash in our App fix #1096

  • Use local RCTConvert+MapKit instead of the one in React Native #1138

0.13.1 (March 21, 2017)

Enhancements

  • Add id identifier to marker-press event on Android #1008 (@stan229)

  • setNativeProps, marker opacity, nested components #940 (@unboundfire)

Patches

  • Update the android buildToolsVersion to 25.0.0 #1152 (@markusguenther)

  • use provided for RN gradle dependency #1151 (@gpeal)

  • fix null activity crash #1150 (@lelandrichardson)

  • Updated Google play services and gradle build plugin #1023 (@chris-at-translate)

  • Sets the map value for the AirMapUrlTile so that it can be updated properly #992 (@jschloer)

  • onPress and onCalloutPress doesn't trigger on markers in iOS #954 (@RajkumarPunchh)

0.13.0 (January 6, 2017)

Breaking Changes

  • Update iOS header imports and JS SyntheticEvent import for RN 0.40 #923 (@ide)

Patches

  • Fix issue where callouts sometimes overlap or don't appear #936 (@RajkumarPunchh)

0.12.3 (January 6, 2017)

Patches

  • Fix "Animating with MapViews" example – fixes #763 #888 (@javiercr)
  • [iOS] Fix "Option 2" method of building Google Maps #900 (@vjeranc)
  • [Android] Fix exception when animating region during initialization #901 (@mlanter)
  • Updated documentation #902, #904, #910 (@anami, @dboydor, @ali-alamine)

0.12.2 (December 9, 2016)

Patches

  • [Android] Added support for taking snapshots on Android #625 (@IjzerenHein)
  • [iOS] Allow legalLabelInsets to be changed and animated #873 (@scarlac)
  • Added rotation attribute documentation #871 (@Arman92)
  • Update mapview.md documentation #866 (@dccarmo)

0.12.1 (December 6, 2016)

This release only corrects the version in package.json.

0.12.0 (December 6, 2016)

NOTE: This version was not published because package.json was not properly updated

Breaking Changes

  • [android] If we've disabled scrolling within the map, then don't capture the touch events #664 (@mikelambert)
  • [android] Use latest Google Play Services #731 (@mlanter)
  • [android] update google play services #805 (@lrivera)

Patches

  • [iOS] Support iOS SDK < 10 ( XCode < 8 ) #708 (@rops)
  • [iOS] Added showsUserLocation property support for Google Maps #721 (@julien-rodrigues)
  • [iOS] Added Google Maps Circle, Polygon, Polyline, MapType Support #722 (@unboundfire)
  • [iOS] Fix Anchor point on Google Maps iOS #734 (@btoueg)
  • [Google Maps iOS] Marker init with image props. #738 (@btoueg)
  • [iOS] Fix dynamic imageSrc removal #737 (@btoueg)
  • [iOS] implement fitToSuppliedMarkers and fitToCoordinates for google #750 (@gilbox)
  • [iOS][android] Add onPress for polygons and polylines on iOS and Android #760 (@frankrowe)
  • [iOS] Fix flicker of map pins on state change #728 (@mlanter)
  • [iOS] Set region only when view has width&height #785 (@gilbox)
  • [iOS] Implements animateToRegion for Google #779 (@btoueg)
  • [iOS] Google Maps Custom Tile Support #770 (@unboundfire)
  • [android] Map Styling for android #808 (@ali-alamine using @azt3k code)
  • [iOS] IOS Google Map styling #817 (@ali-alamine using @azt3k code)
  • [iOS] Add support for polygon holes for Apple Maps and Google Maps on iOS #801 (@therealgilles)
  • [iOS] Fixes #470. Support legalLabelInsets on Apple Maps #840 (@scarlac)

0.11.0 (October 16, 2016)

NOTE: 0.10.4 was released after this version, and it's possible 0.11.0 does not include everything in 0.10.4. (see #851)

Breaking Changes

  • Update example app for RN 0.35, fix Gmaps bug for 0.35 #695 (@spikebrehm)
  • Upgraded to RN 0.35 #680 (@eugenehp)

Patches

  • Update installation.md #696 (@securingsincity)
  • [android] Fixes crash during Activity onPause() #694 (@felipecsl)
  • Included MapUrlTile usage in README.md #687 (@ochanje210)
  • [android] Add parameter to disable the moving on marker press #676 (@mlanter)
  • Add support for setting zIndex on markers #675 (@mlanter)

0.10.4 (October 31, 2016)

Patches

  • [iOS] implement fitToSuppliedMarkers and fitToCoordinates for google maps #750 (@gilbox)
  • [android] If we've disabled scrolling within the map, then don't capture the touch events #664 (@mikelambert)
  • [iOS] Fix Anchor point on Google Maps iOS #734 (@btoueg)
  • [iOS] Added showsUserLocation property support for Google Maps #721 (@julien-rodrigues)
  • [iOS][android] Add support for setting zIndex on markers #675 (@mlanter)
  • [android] Add parameter to disable the moving on marker press #676 (@mlanter)
  • NOTE: v0.10.3 was not published

0.10.2 (October 19, 2016)

Patches

  • [android] Fixes crash during Activity onPause() (fixes #414) #694 (@felipecsl)

0.10.1 (October 10, 2016)

This release fixes issue #656

Patches

  • [android] fix gradle build setup for explorer, bump to gradle 2.2.0 #666 (@gilbox)
  • [android] fix getAirMapName to fix ref-based commands #665 (@gilbox)

0.10.0 (October 5, 2016)

Breaking Changes

0.9.0 (September 28, 2016)

As of this release, this repository has moved from lelandrichardson/react-native-maps to airbnb/react-native-maps.

Breaking Changes

  • [iOS] Support Google Maps on iOS #548 (@gilbox)

Patches

  • Added support for AnimatedRegion without modifying the AnimatedImplementation.js of react-native #608 (@IjzerenHein)
  • [iOS] Remove pod stuff. Fix AirMaps.xcodeproj related to missing pod stuff #620 (@gilbox)
  • [iOS] Fix import of AIRMapSnapshot #622 (@spikebrehm)
  • [iOS] Fix nullability issue #614 (@simonmitchell)
  • [iOS] Added support for drawing polylines on snapshots on iOS #615 (@IjzerenHein)
  • Add fitToCoordinates method #545 (@naoufal)
  • [Android] Fix list of examples on Android #597 (@spikebrehm)
  • [Android] Fix overlapping map issue #589 (@fdnhkj)
  • Add tile overlay support #595 (@cascadian, @spikebrehm)
  • [Android] Support Android LiteMode #546 (@rops)
  • s/lelandrichardson/airbnb/ #573 (@spikebrehm)
  • [Android] Don't fit to elements if no positions added #567 (@ryankask)
  • [iOS] Add class prefix to EmptyCalloutBackgroundView #563 (@terribleben)
  • [Android] Minor code cleanup #564 (@felipecsl)
  • Documentation updates #566, #591, #601, #602, #624 (@felipecsl, @Alastairm, @Keksike, @bbodenmiller)

0.8.2 (September 8, 2016)

We realized immediately after publishing 0.8.1 that the NPM package contained some test code in the example2/ directory that contained a copy of the react-native package, causing this packager error:

Failed to build DependencyGraph: @providesModule naming collision:
  Duplicate module name: String.prototype.es6
  Paths: /Users/<path to project>/node_modules/react-native-maps/example2/node_modules/react-native/packager/react-packager/src/Resolver/polyfills/String.prototype.es6.js collides with /Users/<path to project>/node_modules/react-native/packager/react-packager/src/Resolver/polyfills/String.prototype.es6.js

This error is caused by a @providesModule declaration with the same name across two different files.

0.8.2 is identical to 0.8.1, except with the offending code removed from the NPM package.

0.8.1 (September 8, 2016) [DEPRECATED]

NOTE: 0.8.1 has been unpublished from NPM because it was faulty. Please use 0.8.2.

Patches

  • [Android] Use latest available (wildcard version) of RN to build Android (PR #547)
  • [Android] Use Activity to call MapsInitialier.initialize() (PR #449)
  • [Android] Fix file path for AirMapModule (PR #526)
  • [Android] Fix path to React Native in node_modules (PR #527)
  • [Android] Bump Google Play Services dependency to 9.4.0 (PR #533)
  • [iOS] Fix a few warnings (PR #534)
  • [JS] Fix ESLint violations (PR #515)

0.8.0 (August 30, 2016)

Breaking Changes

Patches

  • [android] Add showsMyLocationButton prop (#382)

  • Add fitToSuppliedMarkers() method (#386)

  • [ios] Update AirMapMarker to use loadImageWithURLRequest (#389)

  • Improvements to watch and copy script (#445)

  • [ios] Added check on marker class in predicate (#485)

  • Use StyleSheet.absoluteFillObject where appropriate (#500) and (#493)

  • Add ESLint and fix a number of linting violations (#501)

  • Remove unused NativeMethodsMixin for compat with RN 0.32 (#511)

0.7.1 (July 9, 2016)

Patches

  • Fix iOS CocoaPods Issue (#308)

0.7.0 (July 9, 2016)

Breaking Changes

  • RN 0.29 compatibility changes (#363 and #370)

Patches

  • Fixing scrolling map inside a scrollView (#343)

  • Fix shouldUsePinView (#344)

  • Not calling setLoadingIndicatorColor when null (#337)

  • Fixes Undefined symbols for architecture x86_64: “std::terminate()” (#329)

0.6.0

0.5.0

  • [Android] Updated package to com.airbnb.android.react.maps (PR #225)
  • [Android] Lint fixes (PR #232)

0.4.0

  • Initial release