with-maps

This commit is contained in:
Yassine El Bouchaibi
2020-06-26 17:03:58 -04:00
parent 2adf157dd4
commit e199336d78
4 changed files with 76 additions and 0 deletions

20
with-maps/App.js Normal file
View File

@@ -0,0 +1,20 @@
import * as React from "react";
import { View } from "react-native";
import MapView from 'react-native-maps';
export default function App() {
return (
<View
style={{
flex: 1,
justifyContent: "center",
alignItems: "center",
}}
>
<MapView style={{
width: "100%",
height: "100%",
}} />
</View>
);
}

37
with-maps/README.md Normal file
View File

@@ -0,0 +1,37 @@
# Maps Example
<p>
<!-- iOS -->
<a href="https://itunes.apple.com/app/apple-store/id982107779">
<img alt="Supports Expo iOS" longdesc="Supports Expo iOS" src="https://img.shields.io/badge/iOS-4630EB.svg?style=flat-square&logo=APPLE&labelColor=999999&logoColor=fff" />
</a>
<!-- Android -->
<a href="https://play.google.com/store/apps/details?id=host.exp.exponent&referrer=blankexample">
<img alt="Supports Expo Android" longdesc="Supports Expo Android" src="https://img.shields.io/badge/Android-4630EB.svg?style=flat-square&logo=ANDROID&labelColor=A4C639&logoColor=fff" />
</a>
</p>
## 🚀 How to use
- Install packages with `yarn` or `npm install`.
- Run `yarn start` or `npm start` to start the bundler.
- Open the project in a React runtime to try it:
- iOS: [Client iOS](https://itunes.apple.com/app/apple-store/id982107779)
- Android: [Client Android](https://play.google.com/store/apps/details?id=host.exp.exponent&referrer=blankexample)
## Adding Native Code
This project can be run from Expo client app. You may find that you want to add more native code later on. You can do this by ejecting the project and rebuilding it yourself.
- Run `yarn eject` to create the native projects.
- You can still run your project on Expo client, you just won't be able to access any new native modules you add.
## Publishing
- Configure your app to be able to use react-native-maps in production using this guide : [MapView configuration](https://docs.expo.io/versions/v38.0.0/sdk/map-view/#configuration)
- Deploy the native app to the App store and Play store using this guide: [Deployment](https://docs.expo.io/distribution/app-stores/).
## 📝 Notes
- Learn more about [MapView](https://docs.expo.io/versions/v38.0.0/sdk/map-view).
- Learn more about [react-native-maps](https://github.com/react-native-community/react-native-maps).

View File

@@ -0,0 +1,6 @@
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};

13
with-maps/package.json Normal file
View File

@@ -0,0 +1,13 @@
{
"dependencies": {
"expo": "~38.0.0",
"react": "~16.11.0",
"react-dom": "~16.11.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-38.0.0.tar.gz",
"react-native-web": "0.11.7",
"react-native-maps": "~0.27.1"
},
"devDependencies": {
"@babel/core": "7.9.0"
}
}