This is for my personal use, things might not be correctly explained here. For the official docs please check https://github.com/airbnb/react-native-maps
Steps from scratch:
1.react-native init GoogleMapPlayground
2. cd GoogleMapPlayground
| import React, { Component } from 'react'; | |
| import { | |
| AppRegistry, | |
| StyleSheet, | |
| TouchableOpacity, | |
| Text, | |
| ViewPagerAndroid, | |
| View, | |
| } from 'react-native'; | |
| import MapView from 'react-native-maps'; |
| import React from 'react' | |
| import { View, StyleSheet, AsyncStorage } from 'react-native' | |
| import MapView from 'react-native-maps' | |
| const DEFAULT_REGION = { | |
| latitude: 32.068185, | |
| longitude: 34.778051, | |
| latitudeDelta: 0.045, | |
| longitudeDelta: 0.045, | |
| } |
This is for my personal use, things might not be correctly explained here. For the official docs please check https://github.com/airbnb/react-native-maps
Steps from scratch:
1.react-native init GoogleMapPlayground
2. cd GoogleMapPlayground
| import React from 'react' | |
| import { Text, View } from 'react-native' | |
| import { connect } from 'react-redux' | |
| import MapView from 'react-native-maps'; | |
| import styles from './Styles/UserMapStyle' | |
| class UserMap extends React.Component { | |
| constructor (props) { |
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
| package="com.servicemap" | |
| android:versionCode="1" | |
| android:versionName="1.0"> | |
| <uses-permission android:name="android.permission.INTERNET" /> | |
| <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/> | |
| <uses-sdk | |
| android:minSdkVersion="16" |
| // 1.In terminal run: | |
| // create-react-native-app maps | |
| // cd maps | |
| // npm start | |
| // 2. Scan QR code to load project in expo | |
| // 3. npm install react-native-maps --save | |
| // 4. react-native link react-native-maps |
| /** | |
| * Sample React Native App | |
| * https://github.com/facebook/react-native | |
| */ | |
| 'use strict'; | |
| var React = require('react-native'); | |
| var { | |
| AppRegistry, | |
| StyleSheet, |
| 'use strict'; | |
| import {Actions} from "react-native-router-flux"; | |
| // var Sinch = require('./Sinch-javascript/sinch-rtc') | |
| import Camera from 'react-native-camera'; | |
| var GiftedMessenger = require('react-native-gifted-messenger'); | |
| var GiftedSpinner = require('react-native-gifted-spinner'); | |
| var React = require('react-native'); | |
| const timer = require('react-native-timer'); | |
| var { | |
| AppRegistry, |
| _uploadSnap() { | |
| var url = 'http://example.com/upload'; // File upload web service path | |
| var photo = { | |
| uri: this.state.picturePath, // CameralRoll Url | |
| type: 'image/jpeg', | |
| name: 'photo.jpg', | |
| }; | |
| var formData = new FormData(); | |
| formData.append("file", photo); |
| <?php | |
| /** | |
| * This program is free software. It comes without any warranty, to | |
| * the extent permitted by applicable law. You can redistribute it | |
| * and/or modify it under the terms of the Do What The Fuck You Want | |
| * To Public License, Version 2, as published by Sam Hocevar. See | |
| * http://sam.zoy.org/wtfpl/COPYING for more details. | |
| */ | |
| /** |