Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

included MapUrlTile usage in README.md #687

Merged
merged 5 commits into from
Oct 13, 2016
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'}
>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think double quotes is desired for JSX. Can probably get rid of the curly braces.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate your advise. I changed back to double quotes and removed curly braces

<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'}
>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above.

Copy link
Contributor Author

@ochanje210 ochanje210 Oct 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as comment above

<MapView.Marker
coordinate={{
Expand Down