Skip to content

Commit

Permalink
Merge pull request react-native-maps#687 from ochanje210/master
Browse files Browse the repository at this point in the history
included MapUrlTile usage in README.md
  • Loading branch information
Spike Brehm authored Oct 13, 2016
2 parents 722f5e9 + 734c5d7 commit 15c5875
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,30 @@ render() {
</MapView>
```

### Using a custom Tile Overlay

```jsx
<MapView
region={this.state.region}
onRegionChange={this.onRegionChange}
>
<MapView.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}
/>
</MapView>
```

For Android: add the following line in your AndroidManifest.xml
```xml
<uses-permission android:name="android.permission.INTERNET" />
```
For IOS: configure [App Transport Security](https://developer.apple.com/library/content/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW33) in your app



## Examples

Expand Down
4 changes: 2 additions & 2 deletions example/examples/CachedMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class CachedMap extends React.Component {
cacheEnabled={this.state.cache}
zoomEnabled
scrollingEnabled
loadingIndicatorColor={"#666666"}
loadingBackgroundColor={"#eeeeee"}
loadingIndicatorColor="#666666"
loadingBackgroundColor="#eeeeee"
>
<MapView.Marker
coordinate={region}
Expand Down
4 changes: 2 additions & 2 deletions example/examples/LoadingMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class LoadingMap extends React.Component {
initialRegion={this.state.region}
onPress={this.onMapPress}
loadingEnabled
loadingIndicatorColor={"#666666"}
loadingBackgroundColor={"#eeeeee"}
loadingIndicatorColor="#666666"
loadingBackgroundColor="#eeeeee"
>
<MapView.Marker
coordinate={{
Expand Down

0 comments on commit 15c5875

Please sign in to comment.