diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..3c3629e64 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +node_modules diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 000000000..2ab7f953b --- /dev/null +++ b/.eslintrc @@ -0,0 +1,13 @@ +{ + "parser": "babel-eslint", + "extends": "airbnb", + "plugins": [ + "prefer-object-spread" + ], + "rules": { + "prefer-object-spread/prefer-object-spread": 2, + "react/jsx-filename-extension": 0, + "no-use-before-define": 0, + "no-underscore-dangle": 0 + } +} diff --git a/components/AnimatedRegion.js b/components/AnimatedRegion.js index d2f633a60..dba4e01b2 100644 --- a/components/AnimatedRegion.js +++ b/components/AnimatedRegion.js @@ -1,18 +1,18 @@ class AnimatedRegion extends AnimatedWithChildren { - //latitude: AnimatedValue; - //longitude: AnimatedValue; - //latitudeDelta: AnimatedValue; - //longitudeDelta: AnimatedValue; - //_listeners: {[key: string]: { + // latitude: AnimatedValue; + // longitude: AnimatedValue; + // latitudeDelta: AnimatedValue; + // longitudeDelta: AnimatedValue; + // _listeners: {[key: string]: { // latitude: string, // longitude: string, // latitudeDelta: string; // longitudeDelta: string, - //}}; + // }}; constructor(valueIn) { super(); - var value = valueIn || { // probably want to come up with better defaults + const value = valueIn || { // probably want to come up with better defaults latitude: 0, longitude: 0, latitudeDelta: 0, @@ -34,10 +34,10 @@ class AnimatedRegion extends AnimatedWithChildren { } setValue(value) { - //this.latitude.setValue(value.latitude); - //this.longitude.setValue(value.longitude); - //this.latitudeDelta.setValue(value.latitudeDelta); - //this.longitudeDelta.setValue(value.longitudeDelta); + // this.latitude.setValue(value.latitude); + // this.longitude.setValue(value.longitude); + // this.latitudeDelta.setValue(value.latitudeDelta); + // this.longitudeDelta.setValue(value.longitudeDelta); this.latitude._value = value.latitude; this.longitude._value = value.longitude; this.latitudeDelta._value = value.latitudeDelta; @@ -90,8 +90,8 @@ class AnimatedRegion extends AnimatedWithChildren { } addListener(callback) { - var id = String(_uniqueId++); - var jointCallback = ({value: number}) => { + const id = String(_uniqueId++); + const jointCallback = ({ value: number }) => { callback(this.__getValue()); }; this._listeners[id] = { @@ -112,7 +112,7 @@ class AnimatedRegion extends AnimatedWithChildren { } spring(config) { - var animations = []; + const animations = []; config.hasOwnProperty('latitude') && animations.push(timing(this.latitude, { ...config, @@ -141,7 +141,7 @@ class AnimatedRegion extends AnimatedWithChildren { } timing(config) { - var animations = []; + const animations = []; config.hasOwnProperty('latitude') && animations.push(timing(this.latitude, { ...config, diff --git a/components/MapCallout.js b/components/MapCallout.js index a4b4f809b..205c2b8a6 100644 --- a/components/MapCallout.js +++ b/components/MapCallout.js @@ -1,18 +1,13 @@ - -var React = require('react'); -var { - PropTypes, -} = React; - -var ReactNative = require('react-native'); -var { +import React, { PropTypes } from 'react'; +import { View, NativeMethodsMixin, requireNativeComponent, StyleSheet, -} = ReactNative; +} from 'react-native'; -var MapCallout = React.createClass({ +// eslint-disable-next-line react/prefer-es6-class +const MapCallout = React.createClass({ mixins: [NativeMethodsMixin], propTypes: { @@ -21,25 +16,23 @@ var MapCallout = React.createClass({ onPress: PropTypes.func, }, - getDefaultProps: function() { + getDefaultProps() { return { tooltip: false, }; }, - render: function() { + render() { return ; }, }); -var styles = StyleSheet.create({ +const styles = StyleSheet.create({ callout: { position: 'absolute', - //flex: 0, - //backgroundColor: 'transparent', }, }); -var AIRMapCallout = requireNativeComponent('AIRMapCallout', MapCallout); +const AIRMapCallout = requireNativeComponent('AIRMapCallout', MapCallout); module.exports = MapCallout; diff --git a/components/MapCircle.js b/components/MapCircle.js index cd6fe2425..8f42463f9 100644 --- a/components/MapCircle.js +++ b/components/MapCircle.js @@ -1,18 +1,12 @@ - -var React = require('react'); -var { - PropTypes, -} = React; - -var ReactNative = require('react-native'); -var { +import React, { PropTypes } from 'react'; +import { View, NativeMethodsMixin, requireNativeComponent, - StyleSheet, -} = ReactNative; +} from 'react-native'; -var MapCircle = React.createClass({ +// eslint-disable-next-line react/prefer-es6-class +const MapCircle = React.createClass({ mixins: [NativeMethodsMixin], propTypes: { @@ -127,18 +121,20 @@ var MapCircle = React.createClass({ lineDashPattern: PropTypes.arrayOf(PropTypes.number), }, - getDefaultProps: function() { + getDefaultProps() { return { strokeColor: '#000', strokeWidth: 1, }; }, - _onPress: function(e) { - this.props.onPress && this.props.onPress(e); + _onPress(e) { + if (this.props.onPress) { + this.props.onPress(e); + } }, - render: function() { + render() { return ( ); }, }); -var styles = StyleSheet.create({ - polyline: { - position: 'absolute', - width: 0, - height: 0, - }, -}); - -var AIRMapPolyline = requireNativeComponent('AIRMapPolyline', MapPolyline); +const AIRMapPolyline = requireNativeComponent('AIRMapPolyline', MapPolyline); module.exports = MapPolyline; diff --git a/components/MapView.js b/components/MapView.js index 774d7c2b0..7540ef50e 100644 --- a/components/MapView.js +++ b/components/MapView.js @@ -1,29 +1,23 @@ -'use strict'; - -var React = require('react'); -var { - PropTypes, -} = React; -var ReactNative = require('react-native'); -var { +import React, { PropTypes } from 'react'; +import { EdgeInsetsPropType, NativeMethodsMixin, Platform, - ReactNativeViewAttributes, View, Animated, requireNativeComponent, NativeModules, ColorPropType, -} = ReactNative; - -var MapMarker = require('./MapMarker'); -var MapPolyline = require('./MapPolyline'); -var MapPolygon = require('./MapPolygon'); -var MapCircle = require('./MapCircle'); -var MapCallout = require('./MapCallout'); - -var MapView = React.createClass({ + findNodeHandle, +} from 'react-native'; +import MapMarker from './MapMarker'; +import MapPolyline from './MapPolyline'; +import MapPolygon from './MapPolygon'; +import MapCircle from './MapCircle'; +import MapCallout from './MapCallout'; + +// eslint-disable-next-line react/prefer-es6-class +const MapView = React.createClass({ mixins: [NativeMethodsMixin], viewConfig: { @@ -322,13 +316,13 @@ var MapView = React.createClass({ }, - getInitialState: function() { + getInitialState() { return { isReady: Platform.OS === 'ios', }; }, - componentDidMount: function() { + componentDidMount() { const { region, initialRegion } = this.props; if (region && this.state.isReady) { this.refs.map.setNativeProps({ region }); @@ -337,9 +331,9 @@ var MapView = React.createClass({ } }, - componentWillUpdate: function(nextProps) { - var a = this.__lastRegion; - var b = nextProps.region; + componentWillUpdate(nextProps) { + const a = this.__lastRegion; + const b = nextProps.region; if (!a || !b) return; if ( a.latitude !== b.latitude || @@ -351,7 +345,7 @@ var MapView = React.createClass({ } }, - _onMapReady: function() { + _onMapReady() { const { region, initialRegion } = this.props; if (region) { this.refs.map.setNativeProps({ region }); @@ -361,7 +355,7 @@ var MapView = React.createClass({ this.setState({ isReady: true }); }, - _onLayout: function(e) { + _onLayout(e) { const { region, initialRegion, onLayout } = this.props; const { isReady } = this.state; if (region && isReady && !this.__layoutCalled) { @@ -374,7 +368,7 @@ var MapView = React.createClass({ onLayout && onLayout(e); }, - _onChange: function(event: Event) { + _onChange(event: Event) { this.__lastRegion = event.nativeEvent.region; if (event.nativeEvent.continuous) { this.props.onRegionChange && @@ -385,34 +379,34 @@ var MapView = React.createClass({ } }, - animateToRegion: function (region, duration) { + animateToRegion(region, duration) { this._runCommand('animateToRegion', [region, duration || 500]); }, - animateToCoordinate: function (latLng, duration) { + animateToCoordinate(latLng, duration) { this._runCommand('animateToCoordinate', [latLng, duration || 500]); }, - fitToElements: function(animated) { + fitToElements(animated) { this._runCommand('fitToElements', [animated]); }, - fitToSuppliedMarkers: function(markers, animated) { + fitToSuppliedMarkers(markers, animated) { this._runCommand('fitToSuppliedMarkers', [markers, animated]); }, - takeSnapshot: function (width, height, region, callback) { + takeSnapshot(width, height, region, callback) { if (!region) { region = this.props.region || this.props.initialRegion; } this._runCommand('takeSnapshot', [width, height, region, callback]); }, - _getHandle: function() { - return ReactNative.findNodeHandle(this.refs.map); + _getHandle() { + return findNodeHandle(this.refs.map); }, - _runCommand: function (name, args) { + _runCommand(name, args) { switch (Platform.OS) { case 'android': NativeModules.UIManager.dispatchViewManagerCommand( @@ -431,7 +425,7 @@ var MapView = React.createClass({ } }, - render: function() { + render() { let props; if (this.state.isReady) { @@ -464,7 +458,7 @@ var MapView = React.createClass({ }, }); -var AIRMap = requireNativeComponent('AIRMap', MapView, { +let AIRMap = requireNativeComponent('AIRMap', MapView, { nativeOnly: { onChange: true, onMapReady: true, diff --git a/example/.eslintrc b/example/.eslintrc new file mode 100644 index 000000000..7753f32e7 --- /dev/null +++ b/example/.eslintrc @@ -0,0 +1,5 @@ +{ + "rules": { + "no-console": 0 + } +} diff --git a/example/App.js b/example/App.js index bec55f008..3baef2a65 100644 --- a/example/App.js +++ b/example/App.js @@ -1,30 +1,30 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { View, StyleSheet, TouchableOpacity, ScrollView, Text, } = ReactNative; -var DisplayLatLng = require('./examples/DisplayLatLng'); -var ViewsAsMarkers = require('./examples/ViewsAsMarkers'); -var EventListener = require('./examples/EventListener'); -var MarkerTypes = require('./examples/MarkerTypes'); -var DraggableMarkers = require('./examples/DraggableMarkers'); -var PolygonCreator = require('./examples/PolygonCreator'); -var PolylineCreator = require('./examples/PolylineCreator'); -var AnimatedViews = require('./examples/AnimatedViews'); -var AnimatedMarkers = require('./examples/AnimatedMarkers'); -var Callouts = require('./examples/Callouts'); -var Overlays = require('./examples/Overlays'); -var DefaultMarkers = require('./examples/DefaultMarkers'); -var CachedMap = require('./examples/CachedMap'); -var LoadingMap = require('./examples/LoadingMap'); -var TakeSnapshot = require('./examples/TakeSnapshot'); -var FitToSuppliedMarkers = require('./examples/FitToSuppliedMarkers'); +const DisplayLatLng = require('./examples/DisplayLatLng'); +const ViewsAsMarkers = require('./examples/ViewsAsMarkers'); +const EventListener = require('./examples/EventListener'); +const MarkerTypes = require('./examples/MarkerTypes'); +const DraggableMarkers = require('./examples/DraggableMarkers'); +const PolygonCreator = require('./examples/PolygonCreator'); +const PolylineCreator = require('./examples/PolylineCreator'); +const AnimatedViews = require('./examples/AnimatedViews'); +const AnimatedMarkers = require('./examples/AnimatedMarkers'); +const Callouts = require('./examples/Callouts'); +const Overlays = require('./examples/Overlays'); +const DefaultMarkers = require('./examples/DefaultMarkers'); +const CachedMap = require('./examples/CachedMap'); +const LoadingMap = require('./examples/LoadingMap'); +const TakeSnapshot = require('./examples/TakeSnapshot'); +const FitToSuppliedMarkers = require('./examples/FitToSuppliedMarkers'); -var App = React.createClass({ +const App = React.createClass({ getInitialState() { return { Component: null }; @@ -54,7 +54,7 @@ var App = React.createClass({ }, renderExamples(examples) { - var { Component } = this.state; + let { Component } = this.state; return ( {Component && } @@ -62,7 +62,8 @@ var App = React.createClass({ {!Component && ( + showsVerticalScrollIndicator={false} + > {examples.map(this.renderExample)} )} @@ -92,7 +93,7 @@ var App = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/AnimatedMarkers.js b/example/examples/AnimatedMarkers.js index 22001efd1..b59374974 100644 --- a/example/examples/AnimatedMarkers.js +++ b/example/examples/AnimatedMarkers.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -11,9 +11,9 @@ var { Platform, } = ReactNative; -var MapView = require('react-native-maps'); +let MapView = require('react-native-maps'); -var screen = Dimensions.get('window'); +const screen = Dimensions.get('window'); const ASPECT_RATIO = screen.width / screen.height; const LATITUDE = 37.78825; @@ -21,7 +21,7 @@ const LONGITUDE = -122.4324; const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; -var AnimatedMarkers = React.createClass({ +const AnimatedMarkers = React.createClass({ getInitialState() { return { coordinate: new Animated.Region({ @@ -32,7 +32,7 @@ var AnimatedMarkers = React.createClass({ }, animate() { - var { coordinate } = this.state; + const { coordinate } = this.state; coordinate.timing({ latitude: LATITUDE + (Math.random() - 0.5) * LATITUDE_DELTA / 2, longitude: LONGITUDE + (Math.random() - 0.5) * LONGITUDE_DELTA / 2, @@ -66,8 +66,7 @@ var AnimatedMarkers = React.createClass({ }); - -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/AnimatedPriceMarker.js b/example/examples/AnimatedPriceMarker.js index 40047cf48..7de89fd02 100644 --- a/example/examples/AnimatedPriceMarker.js +++ b/example/examples/AnimatedPriceMarker.js @@ -1,10 +1,10 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +const { PropTypes, } = React; -var { +let { StyleSheet, View, Text, @@ -12,13 +12,12 @@ var { } = ReactNative; const PriceMarker = ({ amount, selected, style }) => { - - var background = selected.interpolate({ + const background = selected.interpolate({ inputRange: [0, 1], outputRange: ['#FF5A5F', '#4da2ab'], }); - var border = selected.interpolate({ + const border = selected.interpolate({ inputRange: [0, 1], outputRange: ['#D23F44', '#007a87'], }); @@ -26,19 +25,18 @@ const PriceMarker = ({ amount, selected, style }) => { return ( + backgroundColor: background, + borderColor: border, + }]}> $ {amount} + borderTopColor: border, + }]} /> + borderTopColor: background, + }]} /> ); }; diff --git a/example/examples/AnimatedViews.js b/example/examples/AnimatedViews.js index 519f22243..36d97287c 100644 --- a/example/examples/AnimatedViews.js +++ b/example/examples/AnimatedViews.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -11,11 +11,11 @@ var { Platform, } = ReactNative; -var MapView = require('react-native-maps'); -var PanController = require('./PanController'); -var PriceMarker = require('./AnimatedPriceMarker'); +let MapView = require('react-native-maps'); +let PanController = require('./PanController'); +let PriceMarker = require('./AnimatedPriceMarker'); -var screen = Dimensions.get('window'); +const screen = Dimensions.get('window'); const ASPECT_RATIO = screen.width / screen.height; const LATITUDE = 37.78825; @@ -23,18 +23,18 @@ const LONGITUDE = -122.4324; const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; -var ITEM_SPACING = 10; -var ITEM_PREVIEW = 10; -var ITEM_WIDTH = screen.width - 2 * ITEM_SPACING - 2 * ITEM_PREVIEW; -var SNAP_WIDTH = ITEM_WIDTH + ITEM_SPACING; -var ITEM_PREVIEW_HEIGHT = 150; -var SCALE_END = screen.width / ITEM_WIDTH; -var BREAKPOINT1 = 246; -var BREAKPOINT2 = 350; +const ITEM_SPACING = 10; +const ITEM_PREVIEW = 10; +const ITEM_WIDTH = screen.width - 2 * ITEM_SPACING - 2 * ITEM_PREVIEW; +let SNAP_WIDTH = ITEM_WIDTH + ITEM_SPACING; +const ITEM_PREVIEW_HEIGHT = 150; +const SCALE_END = screen.width / ITEM_WIDTH; +const BREAKPOINT1 = 246; +const BREAKPOINT2 = 350; const ANDROID = Platform.OS === 'android'; -var AnimatedViews = React.createClass({ +const AnimatedViews = React.createClass({ getInitialState() { const panX = new Animated.Value(0); const panY = new Animated.Value(0); @@ -90,19 +90,19 @@ var AnimatedViews = React.createClass({ }, ]; - const animations = markers.map((m, i) => { - const xLeft = -SNAP_WIDTH * i + SNAP_WIDTH/2; - const xRight = -SNAP_WIDTH * i - SNAP_WIDTH/2; + const animations = markers.map((m, i) => { + const xLeft = -SNAP_WIDTH * i + SNAP_WIDTH / 2; + const xRight = -SNAP_WIDTH * i - SNAP_WIDTH / 2; const xPos = -SNAP_WIDTH * i; const isIndex = panX.interpolate({ - inputRange: [xRight - 1, xRight, xLeft, xLeft+1], + inputRange: [xRight - 1, xRight, xLeft, xLeft + 1], outputRange: [0, 1, 1, 0], extrapolate: 'clamp', }); const isNotIndex = panX.interpolate({ - inputRange: [xRight - 1, xRight, xLeft, xLeft+1], + inputRange: [xRight - 1, xRight, xLeft, xLeft + 1], outputRange: [1, 0, 0, 1], extrapolate: 'clamp', }); @@ -131,12 +131,12 @@ var AnimatedViews = React.createClass({ const scale = Animated.add(ONE, Animated.multiply(isIndex, scrollY.interpolate({ inputRange: [BREAKPOINT1, BREAKPOINT2], - outputRange: [0, SCALE_END-1], + outputRange: [0, SCALE_END - 1], extrapolate: 'clamp', }))); // [0 => 1] - var opacity = scrollY.interpolate({ + let opacity = scrollY.interpolate({ inputRange: [BREAKPOINT1, BREAKPOINT2], outputRange: [0, 1], extrapolate: 'clamp', @@ -154,7 +154,7 @@ var AnimatedViews = React.createClass({ outputRange: [1, 0], }); - var markerOpacity = scrollY.interpolate({ + let markerOpacity = scrollY.interpolate({ inputRange: [0, BREAKPOINT1], outputRange: [0, 1], extrapolate: 'clamp', @@ -165,7 +165,7 @@ var AnimatedViews = React.createClass({ outputRange: [1, 0], }); - var markerScale = selected.interpolate({ + const markerScale = selected.interpolate({ inputRange: [0, 1], outputRange: [1, 1.2], }); @@ -204,7 +204,7 @@ var AnimatedViews = React.createClass({ }, componentDidMount() { - var { region, panX, panY, scrollX, markers } = this.state; + let { region, panX, panY, scrollX, markers } = this.state; panX.addListener(this.onPanXChange); panY.addListener(this.onPanYChange); @@ -227,38 +227,38 @@ var AnimatedViews = React.createClass({ // we only want to move the view if they are starting the gesture on top // of the view, so this calculates that and returns true if so. If we return // false, the gesture should get passed to the map view appropriately. - var { panY } = this.state; - var { pageY } = e.nativeEvent; - var topOfMainWindow = ITEM_PREVIEW_HEIGHT + 1 * panY.__getValue(); - var topOfTap = screen.height - pageY; + const { panY } = this.state; + const { pageY } = e.nativeEvent; + const topOfMainWindow = ITEM_PREVIEW_HEIGHT + 1 * panY.__getValue(); + const topOfTap = screen.height - pageY; return topOfTap < topOfMainWindow; }, onMoveShouldSetPanResponder(e) { - var { panY } = this.state; - var { pageY } = e.nativeEvent; - var topOfMainWindow = ITEM_PREVIEW_HEIGHT + 1 * panY.__getValue(); - var topOfTap = screen.height - pageY; + const { panY } = this.state; + const { pageY } = e.nativeEvent; + const topOfMainWindow = ITEM_PREVIEW_HEIGHT + 1 * panY.__getValue(); + const topOfTap = screen.height - pageY; return topOfTap < topOfMainWindow; }, onPanXChange({ value }) { - var { index, region, panX, markers } = this.state; - var newIndex = Math.floor((-1 * value + SNAP_WIDTH / 2) / SNAP_WIDTH); + let { index, region, panX, markers } = this.state; + const newIndex = Math.floor((-1 * value + SNAP_WIDTH / 2) / SNAP_WIDTH); if (index !== newIndex) { this.setState({ index: newIndex }); } }, onPanYChange({ value }) { - var { canMoveHorizontal, region, scrollY, scrollX, markers, index } = this.state; - var shouldBeMovable = Math.abs(value) < 2; + let { canMoveHorizontal, region, scrollY, scrollX, markers, index } = this.state; + const shouldBeMovable = Math.abs(value) < 2; if (shouldBeMovable !== canMoveHorizontal) { this.setState({ canMoveHorizontal: shouldBeMovable }); if (!shouldBeMovable) { - var { coordinate } = markers[index]; + const { coordinate } = markers[index]; region.stopAnimation(); region.timing({ latitude: scrollY.interpolate({ @@ -296,7 +296,7 @@ var AnimatedViews = React.createClass({ }, onRegionChange(region) { - //this.state.region.setValue(region); + // this.state.region.setValue(region); }, render() { @@ -318,7 +318,7 @@ var AnimatedViews = React.createClass({ xMode="snap" snapSpacingX={SNAP_WIDTH} yBounds={[-1 * screen.height, 0]} - xBounds={[-screen.width * (markers.length-1), 0]} + xBounds={[-screen.width * (markers.length - 1), 0]} panY={panY} panX={panX} onStartShouldSetPanResponder={this.onStartShouldSetPanResponder} @@ -387,8 +387,7 @@ var AnimatedViews = React.createClass({ }); - -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, @@ -401,7 +400,7 @@ var styles = StyleSheet.create({ flexDirection: 'row', paddingHorizontal: ITEM_SPACING / 2 + ITEM_PREVIEW, position: 'absolute', - //top: screen.height - ITEM_PREVIEW_HEIGHT - 64, + // top: screen.height - ITEM_PREVIEW_HEIGHT - 64, paddingTop: screen.height - ITEM_PREVIEW_HEIGHT - 64, //paddingTop: !ANDROID ? 0 : screen.height - ITEM_PREVIEW_HEIGHT - 64, }, diff --git a/example/examples/CachedMap.js b/example/examples/CachedMap.js index c46e8665d..227b2379d 100644 --- a/example/examples/CachedMap.js +++ b/example/examples/CachedMap.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { Text, View, Dimensions, @@ -9,14 +9,14 @@ var { TouchableOpacity, } = ReactNative; -var MapView = require('react-native-maps'); +let MapView = require('react-native-maps'); const HORIZONTAL_PADDING = 12; const VERTICAL_PADDING = 6; -var CachedMap = React.createClass({ +const CachedMap = React.createClass({ getInitialState() { - var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2}); + const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2 }); return { dataSource: ds.cloneWithRows(COUNTRIES), cache: true, @@ -35,12 +35,12 @@ var CachedMap = React.createClass({ }, render() { - var { width, height } = Dimensions.get('window'); + let { width, height } = Dimensions.get('window'); return ( - {this.state.cache ? "Cached" : "Not cached"} + {this.state.cache ? 'Cached' : 'Not cached'} { return ( + style={styles.item} + > {region.name} + loadingBackgroundColor={"#eeeeee"} + > ); - }} /> + }} + /> ); }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { flex: 1, }, @@ -105,1719 +108,1719 @@ var styles = StyleSheet.create({ justifyContent: 'flex-end', }, buttonText: { - color: 'white' - } + color: 'white', + }, }); const COUNTRIES = [ { - "latitude": 33.93911, - "longitudeDelta": 10.0, - "name": "Afghanistan", - "longitude": 67.709953, - "latitudeDelta": 10.0 + latitude: 33.93911, + longitudeDelta: 10.0, + name: 'Afghanistan', + longitude: 67.709953, + latitudeDelta: 10.0, }, { - "latitude": 41.153332, - "longitudeDelta": 10.0, - "name": "Albania", - "longitude": 20.168331, - "latitudeDelta": 10.0 + latitude: 41.153332, + longitudeDelta: 10.0, + name: 'Albania', + longitude: 20.168331, + latitudeDelta: 10.0, }, { - "latitude": 28.033886, - "longitudeDelta": 10.0, - "name": "Algeria", - "longitude": 1.659626, - "latitudeDelta": 10.0 + latitude: 28.033886, + longitudeDelta: 10.0, + name: 'Algeria', + longitude: 1.659626, + latitudeDelta: 10.0, }, { - "latitude": -14.270972, - "longitudeDelta": 10.0, - "name": "American Samoa", - "longitude": -170.132217, - "latitudeDelta": 10.0 + latitude: -14.270972, + longitudeDelta: 10.0, + name: 'American Samoa', + longitude: -170.132217, + latitudeDelta: 10.0, }, { - "latitude": 42.546245, - "longitudeDelta": 10.0, - "name": "Andorra", - "longitude": 1.601554, - "latitudeDelta": 10.0 + latitude: 42.546245, + longitudeDelta: 10.0, + name: 'Andorra', + longitude: 1.601554, + latitudeDelta: 10.0, }, { - "latitude": -11.202692, - "longitudeDelta": 10.0, - "name": "Angola", - "longitude": 17.873887, - "latitudeDelta": 10.0 + latitude: -11.202692, + longitudeDelta: 10.0, + name: 'Angola', + longitude: 17.873887, + latitudeDelta: 10.0, }, { - "latitude": 18.220554, - "longitudeDelta": 10.0, - "name": "Anguilla", - "longitude": -63.068615, - "latitudeDelta": 10.0 + latitude: 18.220554, + longitudeDelta: 10.0, + name: 'Anguilla', + longitude: -63.068615, + latitudeDelta: 10.0, }, { - "latitude": -75.250973, - "longitudeDelta": 10.0, - "name": "Antarctica", - "longitude": -0.071389, - "latitudeDelta": 10.0 + latitude: -75.250973, + longitudeDelta: 10.0, + name: 'Antarctica', + longitude: -0.071389, + latitudeDelta: 10.0, }, { - "latitude": 17.060816, - "longitudeDelta": 10.0, - "name": "Antigua and Barbuda", - "longitude": -61.796428, - "latitudeDelta": 10.0 + latitude: 17.060816, + longitudeDelta: 10.0, + name: 'Antigua and Barbuda', + longitude: -61.796428, + latitudeDelta: 10.0, }, { - "latitude": -38.416097, - "longitudeDelta": 10.0, - "name": "Argentina", - "longitude": -63.616672, - "latitudeDelta": 10.0 + latitude: -38.416097, + longitudeDelta: 10.0, + name: 'Argentina', + longitude: -63.616672, + latitudeDelta: 10.0, }, { - "latitude": 40.069099, - "longitudeDelta": 10.0, - "name": "Armenia", - "longitude": 45.038189, - "latitudeDelta": 10.0 + latitude: 40.069099, + longitudeDelta: 10.0, + name: 'Armenia', + longitude: 45.038189, + latitudeDelta: 10.0, }, { - "latitude": 12.52111, - "longitudeDelta": 10.0, - "name": "Aruba", - "longitude": -69.968338, - "latitudeDelta": 10.0 + latitude: 12.52111, + longitudeDelta: 10.0, + name: 'Aruba', + longitude: -69.968338, + latitudeDelta: 10.0, }, { - "latitude": -25.274398, - "longitudeDelta": 10.0, - "name": "Australia", - "longitude": 133.775136, - "latitudeDelta": 10.0 + latitude: -25.274398, + longitudeDelta: 10.0, + name: 'Australia', + longitude: 133.775136, + latitudeDelta: 10.0, }, { - "latitude": 47.516231, - "longitudeDelta": 10.0, - "name": "Austria", - "longitude": 14.550072, - "latitudeDelta": 10.0 + latitude: 47.516231, + longitudeDelta: 10.0, + name: 'Austria', + longitude: 14.550072, + latitudeDelta: 10.0, }, { - "latitude": 40.143105, - "longitudeDelta": 10.0, - "name": "Azerbaijan", - "longitude": 47.576927, - "latitudeDelta": 10.0 + latitude: 40.143105, + longitudeDelta: 10.0, + name: 'Azerbaijan', + longitude: 47.576927, + latitudeDelta: 10.0, }, { - "latitude": 25.03428, - "longitudeDelta": 10.0, - "name": "Bahamas", - "longitude": -77.39628, - "latitudeDelta": 10.0 + latitude: 25.03428, + longitudeDelta: 10.0, + name: 'Bahamas', + longitude: -77.39628, + latitudeDelta: 10.0, }, { - "latitude": 25.930414, - "longitudeDelta": 10.0, - "name": "Bahrain", - "longitude": 50.637772, - "latitudeDelta": 10.0 + latitude: 25.930414, + longitudeDelta: 10.0, + name: 'Bahrain', + longitude: 50.637772, + latitudeDelta: 10.0, }, { - "latitude": 23.684994, - "longitudeDelta": 10.0, - "name": "Bangladesh", - "longitude": 90.356331, - "latitudeDelta": 10.0 + latitude: 23.684994, + longitudeDelta: 10.0, + name: 'Bangladesh', + longitude: 90.356331, + latitudeDelta: 10.0, }, { - "latitude": 13.193887, - "longitudeDelta": 10.0, - "name": "Barbados", - "longitude": -59.543198, - "latitudeDelta": 10.0 + latitude: 13.193887, + longitudeDelta: 10.0, + name: 'Barbados', + longitude: -59.543198, + latitudeDelta: 10.0, }, { - "latitude": 53.709807, - "longitudeDelta": 10.0, - "name": "Belarus", - "longitude": 27.953389, - "latitudeDelta": 10.0 + latitude: 53.709807, + longitudeDelta: 10.0, + name: 'Belarus', + longitude: 27.953389, + latitudeDelta: 10.0, }, { - "latitude": 50.503887, - "longitudeDelta": 10.0, - "name": "Belgium", - "longitude": 4.469936, - "latitudeDelta": 10.0 + latitude: 50.503887, + longitudeDelta: 10.0, + name: 'Belgium', + longitude: 4.469936, + latitudeDelta: 10.0, }, { - "latitude": 17.189877, - "longitudeDelta": 10.0, - "name": "Belize", - "longitude": -88.49765, - "latitudeDelta": 10.0 + latitude: 17.189877, + longitudeDelta: 10.0, + name: 'Belize', + longitude: -88.49765, + latitudeDelta: 10.0, }, { - "latitude": 9.30769, - "longitudeDelta": 10.0, - "name": "Benin", - "longitude": 2.315834, - "latitudeDelta": 10.0 + latitude: 9.30769, + longitudeDelta: 10.0, + name: 'Benin', + longitude: 2.315834, + latitudeDelta: 10.0, }, { - "latitude": 32.321384, - "longitudeDelta": 10.0, - "name": "Bermuda", - "longitude": -64.75737, - "latitudeDelta": 10.0 + latitude: 32.321384, + longitudeDelta: 10.0, + name: 'Bermuda', + longitude: -64.75737, + latitudeDelta: 10.0, }, { - "latitude": 27.514162, - "longitudeDelta": 10.0, - "name": "Bhutan", - "longitude": 90.433601, - "latitudeDelta": 10.0 + latitude: 27.514162, + longitudeDelta: 10.0, + name: 'Bhutan', + longitude: 90.433601, + latitudeDelta: 10.0, }, { - "latitude": -16.290154, - "longitudeDelta": 10.0, - "name": "Bolivia", - "longitude": -63.588653, - "latitudeDelta": 10.0 + latitude: -16.290154, + longitudeDelta: 10.0, + name: 'Bolivia', + longitude: -63.588653, + latitudeDelta: 10.0, }, { - "latitude": 43.915886, - "longitudeDelta": 10.0, - "name": "Bosnia and Herzegovina", - "longitude": 17.679076, - "latitudeDelta": 10.0 + latitude: 43.915886, + longitudeDelta: 10.0, + name: 'Bosnia and Herzegovina', + longitude: 17.679076, + latitudeDelta: 10.0, }, { - "latitude": -22.328474, - "longitudeDelta": 10.0, - "name": "Botswana", - "longitude": 24.684866, - "latitudeDelta": 10.0 + latitude: -22.328474, + longitudeDelta: 10.0, + name: 'Botswana', + longitude: 24.684866, + latitudeDelta: 10.0, }, { - "latitude": -54.423199, - "longitudeDelta": 10.0, - "name": "Bouvet Island", - "longitude": 3.413194, - "latitudeDelta": 10.0 + latitude: -54.423199, + longitudeDelta: 10.0, + name: 'Bouvet Island', + longitude: 3.413194, + latitudeDelta: 10.0, }, { - "latitude": -14.235004, - "longitudeDelta": 10.0, - "name": "Brazil", - "longitude": -51.92528, - "latitudeDelta": 10.0 + latitude: -14.235004, + longitudeDelta: 10.0, + name: 'Brazil', + longitude: -51.92528, + latitudeDelta: 10.0, }, { - "latitude": -6.343194, - "longitudeDelta": 10.0, - "name": "British Indian Ocean Territory", - "longitude": 71.876519, - "latitudeDelta": 10.0 + latitude: -6.343194, + longitudeDelta: 10.0, + name: 'British Indian Ocean Territory', + longitude: 71.876519, + latitudeDelta: 10.0, }, { - "latitude": 18.420695, - "longitudeDelta": 10.0, - "name": "British Virgin Islands", - "longitude": -64.639968, - "latitudeDelta": 10.0 + latitude: 18.420695, + longitudeDelta: 10.0, + name: 'British Virgin Islands', + longitude: -64.639968, + latitudeDelta: 10.0, }, { - "latitude": 4.535277, - "longitudeDelta": 10.0, - "name": "Brunei", - "longitude": 114.727669, - "latitudeDelta": 10.0 + latitude: 4.535277, + longitudeDelta: 10.0, + name: 'Brunei', + longitude: 114.727669, + latitudeDelta: 10.0, }, { - "latitude": 42.733883, - "longitudeDelta": 10.0, - "name": "Bulgaria", - "longitude": 25.48583, - "latitudeDelta": 10.0 + latitude: 42.733883, + longitudeDelta: 10.0, + name: 'Bulgaria', + longitude: 25.48583, + latitudeDelta: 10.0, }, { - "latitude": 12.238333, - "longitudeDelta": 10.0, - "name": "Burkina Faso", - "longitude": -1.561593, - "latitudeDelta": 10.0 + latitude: 12.238333, + longitudeDelta: 10.0, + name: 'Burkina Faso', + longitude: -1.561593, + latitudeDelta: 10.0, }, { - "latitude": -3.373056, - "longitudeDelta": 10.0, - "name": "Burundi", - "longitude": 29.918886, - "latitudeDelta": 10.0 + latitude: -3.373056, + longitudeDelta: 10.0, + name: 'Burundi', + longitude: 29.918886, + latitudeDelta: 10.0, }, { - "latitude": 12.565679, - "longitudeDelta": 10.0, - "name": "Cambodia", - "longitude": 104.990963, - "latitudeDelta": 10.0 + latitude: 12.565679, + longitudeDelta: 10.0, + name: 'Cambodia', + longitude: 104.990963, + latitudeDelta: 10.0, }, { - "latitude": 7.369722, - "longitudeDelta": 10.0, - "name": "Cameroon", - "longitude": 12.354722, - "latitudeDelta": 10.0 + latitude: 7.369722, + longitudeDelta: 10.0, + name: 'Cameroon', + longitude: 12.354722, + latitudeDelta: 10.0, }, { - "latitude": 56.130366, - "longitudeDelta": 10.0, - "name": "Canada", - "longitude": -106.346771, - "latitudeDelta": 10.0 + latitude: 56.130366, + longitudeDelta: 10.0, + name: 'Canada', + longitude: -106.346771, + latitudeDelta: 10.0, }, { - "latitude": 16.002082, - "longitudeDelta": 10.0, - "name": "Cape Verde", - "longitude": -24.013197, - "latitudeDelta": 10.0 + latitude: 16.002082, + longitudeDelta: 10.0, + name: 'Cape Verde', + longitude: -24.013197, + latitudeDelta: 10.0, }, { - "latitude": 19.513469, - "longitudeDelta": 10.0, - "name": "Cayman Islands", - "longitude": -80.566956, - "latitudeDelta": 10.0 + latitude: 19.513469, + longitudeDelta: 10.0, + name: 'Cayman Islands', + longitude: -80.566956, + latitudeDelta: 10.0, }, { - "latitude": 6.611111, - "longitudeDelta": 10.0, - "name": "Central African Republic", - "longitude": 20.939444, - "latitudeDelta": 10.0 + latitude: 6.611111, + longitudeDelta: 10.0, + name: 'Central African Republic', + longitude: 20.939444, + latitudeDelta: 10.0, }, { - "latitude": 15.454166, - "longitudeDelta": 10.0, - "name": "Chad", - "longitude": 18.732207, - "latitudeDelta": 10.0 + latitude: 15.454166, + longitudeDelta: 10.0, + name: 'Chad', + longitude: 18.732207, + latitudeDelta: 10.0, }, { - "latitude": -35.675147, - "longitudeDelta": 10.0, - "name": "Chile", - "longitude": -71.542969, - "latitudeDelta": 10.0 + latitude: -35.675147, + longitudeDelta: 10.0, + name: 'Chile', + longitude: -71.542969, + latitudeDelta: 10.0, }, { - "latitude": 35.86166, - "longitudeDelta": 10.0, - "name": "China", - "longitude": 104.195397, - "latitudeDelta": 10.0 + latitude: 35.86166, + longitudeDelta: 10.0, + name: 'China', + longitude: 104.195397, + latitudeDelta: 10.0, }, { - "latitude": -10.447525, - "longitudeDelta": 10.0, - "name": "Christmas Island", - "longitude": 105.690449, - "latitudeDelta": 10.0 + latitude: -10.447525, + longitudeDelta: 10.0, + name: 'Christmas Island', + longitude: 105.690449, + latitudeDelta: 10.0, }, { - "latitude": -12.164165, - "longitudeDelta": 10.0, - "name": "Cocos [Keeling] Islands", - "longitude": 96.870956, - "latitudeDelta": 10.0 + latitude: -12.164165, + longitudeDelta: 10.0, + name: 'Cocos [Keeling] Islands', + longitude: 96.870956, + latitudeDelta: 10.0, }, { - "latitude": 4.570868, - "longitudeDelta": 10.0, - "name": "Colombia", - "longitude": -74.297333, - "latitudeDelta": 10.0 + latitude: 4.570868, + longitudeDelta: 10.0, + name: 'Colombia', + longitude: -74.297333, + latitudeDelta: 10.0, }, { - "latitude": -11.875001, - "longitudeDelta": 10.0, - "name": "Comoros", - "longitude": 43.872219, - "latitudeDelta": 10.0 + latitude: -11.875001, + longitudeDelta: 10.0, + name: 'Comoros', + longitude: 43.872219, + latitudeDelta: 10.0, }, { - "latitude": -4.038333, - "longitudeDelta": 10.0, - "name": "Congo [DRC]", - "longitude": 21.758664, - "latitudeDelta": 10.0 + latitude: -4.038333, + longitudeDelta: 10.0, + name: 'Congo [DRC]', + longitude: 21.758664, + latitudeDelta: 10.0, }, { - "latitude": -0.228021, - "longitudeDelta": 10.0, - "name": "Congo [Republic]", - "longitude": 15.827659, - "latitudeDelta": 10.0 + latitude: -0.228021, + longitudeDelta: 10.0, + name: 'Congo [Republic]', + longitude: 15.827659, + latitudeDelta: 10.0, }, { - "latitude": -21.236736, - "longitudeDelta": 10.0, - "name": "Cook Islands", - "longitude": -159.777671, - "latitudeDelta": 10.0 + latitude: -21.236736, + longitudeDelta: 10.0, + name: 'Cook Islands', + longitude: -159.777671, + latitudeDelta: 10.0, }, { - "latitude": 9.748917, - "longitudeDelta": 10.0, - "name": "Costa Rica", - "longitude": -83.753428, - "latitudeDelta": 10.0 + latitude: 9.748917, + longitudeDelta: 10.0, + name: 'Costa Rica', + longitude: -83.753428, + latitudeDelta: 10.0, }, { - "latitude": 45.1, - "longitudeDelta": 10.0, - "name": "Croatia", - "longitude": 15.2, - "latitudeDelta": 10.0 + latitude: 45.1, + longitudeDelta: 10.0, + name: 'Croatia', + longitude: 15.2, + latitudeDelta: 10.0, }, { - "latitude": 21.521757, - "longitudeDelta": 10.0, - "name": "Cuba", - "longitude": -77.781167, - "latitudeDelta": 10.0 + latitude: 21.521757, + longitudeDelta: 10.0, + name: 'Cuba', + longitude: -77.781167, + latitudeDelta: 10.0, }, { - "latitude": 35.126413, - "longitudeDelta": 10.0, - "name": "Cyprus", - "longitude": 33.429859, - "latitudeDelta": 10.0 + latitude: 35.126413, + longitudeDelta: 10.0, + name: 'Cyprus', + longitude: 33.429859, + latitudeDelta: 10.0, }, { - "latitude": 49.817492, - "longitudeDelta": 10.0, - "name": "Czech Republic", - "longitude": 15.472962, - "latitudeDelta": 10.0 + latitude: 49.817492, + longitudeDelta: 10.0, + name: 'Czech Republic', + longitude: 15.472962, + latitudeDelta: 10.0, }, { - "latitude": 7.539989, - "longitudeDelta": 10.0, - "name": "C\u00f4te d'Ivoire", - "longitude": -5.54708, - "latitudeDelta": 10.0 + latitude: 7.539989, + longitudeDelta: 10.0, + name: "C\u00f4te d'Ivoire", + longitude: -5.54708, + latitudeDelta: 10.0, }, { - "latitude": 56.26392, - "longitudeDelta": 10.0, - "name": "Denmark", - "longitude": 9.501785, - "latitudeDelta": 10.0 + latitude: 56.26392, + longitudeDelta: 10.0, + name: 'Denmark', + longitude: 9.501785, + latitudeDelta: 10.0, }, { - "latitude": 11.825138, - "longitudeDelta": 10.0, - "name": "Djibouti", - "longitude": 42.590275, - "latitudeDelta": 10.0 + latitude: 11.825138, + longitudeDelta: 10.0, + name: 'Djibouti', + longitude: 42.590275, + latitudeDelta: 10.0, }, { - "latitude": 15.414999, - "longitudeDelta": 10.0, - "name": "Dominica", - "longitude": -61.370976, - "latitudeDelta": 10.0 + latitude: 15.414999, + longitudeDelta: 10.0, + name: 'Dominica', + longitude: -61.370976, + latitudeDelta: 10.0, }, { - "latitude": 18.735693, - "longitudeDelta": 10.0, - "name": "Dominican Republic", - "longitude": -70.162651, - "latitudeDelta": 10.0 + latitude: 18.735693, + longitudeDelta: 10.0, + name: 'Dominican Republic', + longitude: -70.162651, + latitudeDelta: 10.0, }, { - "latitude": -1.831239, - "longitudeDelta": 10.0, - "name": "Ecuador", - "longitude": -78.183406, - "latitudeDelta": 10.0 + latitude: -1.831239, + longitudeDelta: 10.0, + name: 'Ecuador', + longitude: -78.183406, + latitudeDelta: 10.0, }, { - "latitude": 26.820553, - "longitudeDelta": 10.0, - "name": "Egypt", - "longitude": 30.802498, - "latitudeDelta": 10.0 + latitude: 26.820553, + longitudeDelta: 10.0, + name: 'Egypt', + longitude: 30.802498, + latitudeDelta: 10.0, }, { - "latitude": 13.794185, - "longitudeDelta": 10.0, - "name": "El Salvador", - "longitude": -88.89653, - "latitudeDelta": 10.0 + latitude: 13.794185, + longitudeDelta: 10.0, + name: 'El Salvador', + longitude: -88.89653, + latitudeDelta: 10.0, }, { - "latitude": 1.650801, - "longitudeDelta": 10.0, - "name": "Equatorial Guinea", - "longitude": 10.267895, - "latitudeDelta": 10.0 + latitude: 1.650801, + longitudeDelta: 10.0, + name: 'Equatorial Guinea', + longitude: 10.267895, + latitudeDelta: 10.0, }, { - "latitude": 15.179384, - "longitudeDelta": 10.0, - "name": "Eritrea", - "longitude": 39.782334, - "latitudeDelta": 10.0 + latitude: 15.179384, + longitudeDelta: 10.0, + name: 'Eritrea', + longitude: 39.782334, + latitudeDelta: 10.0, }, { - "latitude": 58.595272, - "longitudeDelta": 10.0, - "name": "Estonia", - "longitude": 25.013607, - "latitudeDelta": 10.0 + latitude: 58.595272, + longitudeDelta: 10.0, + name: 'Estonia', + longitude: 25.013607, + latitudeDelta: 10.0, }, { - "latitude": 9.145, - "longitudeDelta": 10.0, - "name": "Ethiopia", - "longitude": 40.489673, - "latitudeDelta": 10.0 + latitude: 9.145, + longitudeDelta: 10.0, + name: 'Ethiopia', + longitude: 40.489673, + latitudeDelta: 10.0, }, { - "latitude": -51.796253, - "longitudeDelta": 10.0, - "name": "Falkland Islands [Islas Malvinas]", - "longitude": -59.523613, - "latitudeDelta": 10.0 + latitude: -51.796253, + longitudeDelta: 10.0, + name: 'Falkland Islands [Islas Malvinas]', + longitude: -59.523613, + latitudeDelta: 10.0, }, { - "latitude": 61.892635, - "longitudeDelta": 10.0, - "name": "Faroe Islands", - "longitude": -6.911806, - "latitudeDelta": 10.0 + latitude: 61.892635, + longitudeDelta: 10.0, + name: 'Faroe Islands', + longitude: -6.911806, + latitudeDelta: 10.0, }, { - "latitude": -16.578193, - "longitudeDelta": 10.0, - "name": "Fiji", - "longitude": 179.414413, - "latitudeDelta": 10.0 + latitude: -16.578193, + longitudeDelta: 10.0, + name: 'Fiji', + longitude: 179.414413, + latitudeDelta: 10.0, }, { - "latitude": 61.92411, - "longitudeDelta": 10.0, - "name": "Finland", - "longitude": 25.748151, - "latitudeDelta": 10.0 + latitude: 61.92411, + longitudeDelta: 10.0, + name: 'Finland', + longitude: 25.748151, + latitudeDelta: 10.0, }, { - "latitude": 46.227638, - "longitudeDelta": 10.0, - "name": "France", - "longitude": 2.213749, - "latitudeDelta": 10.0 + latitude: 46.227638, + longitudeDelta: 10.0, + name: 'France', + longitude: 2.213749, + latitudeDelta: 10.0, }, { - "latitude": 3.933889, - "longitudeDelta": 10.0, - "name": "French Guiana", - "longitude": -53.125782, - "latitudeDelta": 10.0 + latitude: 3.933889, + longitudeDelta: 10.0, + name: 'French Guiana', + longitude: -53.125782, + latitudeDelta: 10.0, }, { - "latitude": -17.679742, - "longitudeDelta": 10.0, - "name": "French Polynesia", - "longitude": -149.406843, - "latitudeDelta": 10.0 + latitude: -17.679742, + longitudeDelta: 10.0, + name: 'French Polynesia', + longitude: -149.406843, + latitudeDelta: 10.0, }, { - "latitude": -49.280366, - "longitudeDelta": 10.0, - "name": "French Southern Territories", - "longitude": 69.348557, - "latitudeDelta": 10.0 + latitude: -49.280366, + longitudeDelta: 10.0, + name: 'French Southern Territories', + longitude: 69.348557, + latitudeDelta: 10.0, }, { - "latitude": -0.803689, - "longitudeDelta": 10.0, - "name": "Gabon", - "longitude": 11.609444, - "latitudeDelta": 10.0 + latitude: -0.803689, + longitudeDelta: 10.0, + name: 'Gabon', + longitude: 11.609444, + latitudeDelta: 10.0, }, { - "latitude": 13.443182, - "longitudeDelta": 10.0, - "name": "Gambia", - "longitude": -15.310139, - "latitudeDelta": 10.0 + latitude: 13.443182, + longitudeDelta: 10.0, + name: 'Gambia', + longitude: -15.310139, + latitudeDelta: 10.0, }, { - "latitude": 31.354676, - "longitudeDelta": 10.0, - "name": "Gaza Strip", - "longitude": 34.308825, - "latitudeDelta": 10.0 + latitude: 31.354676, + longitudeDelta: 10.0, + name: 'Gaza Strip', + longitude: 34.308825, + latitudeDelta: 10.0, }, { - "latitude": 42.315407, - "longitudeDelta": 10.0, - "name": "Georgia", - "longitude": 43.356892, - "latitudeDelta": 10.0 + latitude: 42.315407, + longitudeDelta: 10.0, + name: 'Georgia', + longitude: 43.356892, + latitudeDelta: 10.0, }, { - "latitude": 51.165691, - "longitudeDelta": 10.0, - "name": "Germany", - "longitude": 10.451526, - "latitudeDelta": 10.0 + latitude: 51.165691, + longitudeDelta: 10.0, + name: 'Germany', + longitude: 10.451526, + latitudeDelta: 10.0, }, { - "latitude": 7.946527, - "longitudeDelta": 10.0, - "name": "Ghana", - "longitude": -1.023194, - "latitudeDelta": 10.0 + latitude: 7.946527, + longitudeDelta: 10.0, + name: 'Ghana', + longitude: -1.023194, + latitudeDelta: 10.0, }, { - "latitude": 36.137741, - "longitudeDelta": 10.0, - "name": "Gibraltar", - "longitude": -5.345374, - "latitudeDelta": 10.0 + latitude: 36.137741, + longitudeDelta: 10.0, + name: 'Gibraltar', + longitude: -5.345374, + latitudeDelta: 10.0, }, { - "latitude": 39.074208, - "longitudeDelta": 10.0, - "name": "Greece", - "longitude": 21.824312, - "latitudeDelta": 10.0 + latitude: 39.074208, + longitudeDelta: 10.0, + name: 'Greece', + longitude: 21.824312, + latitudeDelta: 10.0, }, { - "latitude": 71.706936, - "longitudeDelta": 10.0, - "name": "Greenland", - "longitude": -42.604303, - "latitudeDelta": 10.0 + latitude: 71.706936, + longitudeDelta: 10.0, + name: 'Greenland', + longitude: -42.604303, + latitudeDelta: 10.0, }, { - "latitude": 12.262776, - "longitudeDelta": 10.0, - "name": "Grenada", - "longitude": -61.604171, - "latitudeDelta": 10.0 + latitude: 12.262776, + longitudeDelta: 10.0, + name: 'Grenada', + longitude: -61.604171, + latitudeDelta: 10.0, }, { - "latitude": 16.995971, - "longitudeDelta": 10.0, - "name": "Guadeloupe", - "longitude": -62.067641, - "latitudeDelta": 10.0 + latitude: 16.995971, + longitudeDelta: 10.0, + name: 'Guadeloupe', + longitude: -62.067641, + latitudeDelta: 10.0, }, { - "latitude": 13.444304, - "longitudeDelta": 10.0, - "name": "Guam", - "longitude": 144.793731, - "latitudeDelta": 10.0 + latitude: 13.444304, + longitudeDelta: 10.0, + name: 'Guam', + longitude: 144.793731, + latitudeDelta: 10.0, }, { - "latitude": 15.783471, - "longitudeDelta": 10.0, - "name": "Guatemala", - "longitude": -90.230759, - "latitudeDelta": 10.0 + latitude: 15.783471, + longitudeDelta: 10.0, + name: 'Guatemala', + longitude: -90.230759, + latitudeDelta: 10.0, }, { - "latitude": 49.465691, - "longitudeDelta": 10.0, - "name": "Guernsey", - "longitude": -2.585278, - "latitudeDelta": 10.0 + latitude: 49.465691, + longitudeDelta: 10.0, + name: 'Guernsey', + longitude: -2.585278, + latitudeDelta: 10.0, }, { - "latitude": 9.945587, - "longitudeDelta": 10.0, - "name": "Guinea", - "longitude": -9.696645, - "latitudeDelta": 10.0 + latitude: 9.945587, + longitudeDelta: 10.0, + name: 'Guinea', + longitude: -9.696645, + latitudeDelta: 10.0, }, { - "latitude": 11.803749, - "longitudeDelta": 10.0, - "name": "Guinea-Bissau", - "longitude": -15.180413, - "latitudeDelta": 10.0 + latitude: 11.803749, + longitudeDelta: 10.0, + name: 'Guinea-Bissau', + longitude: -15.180413, + latitudeDelta: 10.0, }, { - "latitude": 4.860416, - "longitudeDelta": 10.0, - "name": "Guyana", - "longitude": -58.93018, - "latitudeDelta": 10.0 + latitude: 4.860416, + longitudeDelta: 10.0, + name: 'Guyana', + longitude: -58.93018, + latitudeDelta: 10.0, }, { - "latitude": 18.971187, - "longitudeDelta": 10.0, - "name": "Haiti", - "longitude": -72.285215, - "latitudeDelta": 10.0 + latitude: 18.971187, + longitudeDelta: 10.0, + name: 'Haiti', + longitude: -72.285215, + latitudeDelta: 10.0, }, { - "latitude": -53.08181, - "longitudeDelta": 10.0, - "name": "Heard Island and McDonald Islands", - "longitude": 73.504158, - "latitudeDelta": 10.0 + latitude: -53.08181, + longitudeDelta: 10.0, + name: 'Heard Island and McDonald Islands', + longitude: 73.504158, + latitudeDelta: 10.0, }, { - "latitude": 15.199999, - "longitudeDelta": 10.0, - "name": "Honduras", - "longitude": -86.241905, - "latitudeDelta": 10.0 + latitude: 15.199999, + longitudeDelta: 10.0, + name: 'Honduras', + longitude: -86.241905, + latitudeDelta: 10.0, }, { - "latitude": 22.396428, - "longitudeDelta": 10.0, - "name": "Hong Kong", - "longitude": 114.109497, - "latitudeDelta": 10.0 + latitude: 22.396428, + longitudeDelta: 10.0, + name: 'Hong Kong', + longitude: 114.109497, + latitudeDelta: 10.0, }, { - "latitude": 47.162494, - "longitudeDelta": 10.0, - "name": "Hungary", - "longitude": 19.503304, - "latitudeDelta": 10.0 + latitude: 47.162494, + longitudeDelta: 10.0, + name: 'Hungary', + longitude: 19.503304, + latitudeDelta: 10.0, }, { - "latitude": 64.963051, - "longitudeDelta": 10.0, - "name": "Iceland", - "longitude": -19.020835, - "latitudeDelta": 10.0 + latitude: 64.963051, + longitudeDelta: 10.0, + name: 'Iceland', + longitude: -19.020835, + latitudeDelta: 10.0, }, { - "latitude": 20.593684, - "longitudeDelta": 10.0, - "name": "India", - "longitude": 78.96288, - "latitudeDelta": 10.0 + latitude: 20.593684, + longitudeDelta: 10.0, + name: 'India', + longitude: 78.96288, + latitudeDelta: 10.0, }, { - "latitude": -0.789275, - "longitudeDelta": 10.0, - "name": "Indonesia", - "longitude": 113.921327, - "latitudeDelta": 10.0 + latitude: -0.789275, + longitudeDelta: 10.0, + name: 'Indonesia', + longitude: 113.921327, + latitudeDelta: 10.0, }, { - "latitude": 32.427908, - "longitudeDelta": 10.0, - "name": "Iran", - "longitude": 53.688046, - "latitudeDelta": 10.0 + latitude: 32.427908, + longitudeDelta: 10.0, + name: 'Iran', + longitude: 53.688046, + latitudeDelta: 10.0, }, { - "latitude": 33.223191, - "longitudeDelta": 10.0, - "name": "Iraq", - "longitude": 43.679291, - "latitudeDelta": 10.0 + latitude: 33.223191, + longitudeDelta: 10.0, + name: 'Iraq', + longitude: 43.679291, + latitudeDelta: 10.0, }, { - "latitude": 53.41291, - "longitudeDelta": 10.0, - "name": "Ireland", - "longitude": -8.24389, - "latitudeDelta": 10.0 + latitude: 53.41291, + longitudeDelta: 10.0, + name: 'Ireland', + longitude: -8.24389, + latitudeDelta: 10.0, }, { - "latitude": 54.236107, - "longitudeDelta": 10.0, - "name": "Isle of Man", - "longitude": -4.548056, - "latitudeDelta": 10.0 + latitude: 54.236107, + longitudeDelta: 10.0, + name: 'Isle of Man', + longitude: -4.548056, + latitudeDelta: 10.0, }, { - "latitude": 31.046051, - "longitudeDelta": 10.0, - "name": "Israel", - "longitude": 34.851612, - "latitudeDelta": 10.0 + latitude: 31.046051, + longitudeDelta: 10.0, + name: 'Israel', + longitude: 34.851612, + latitudeDelta: 10.0, }, { - "latitude": 41.87194, - "longitudeDelta": 10.0, - "name": "Italy", - "longitude": 12.56738, - "latitudeDelta": 10.0 + latitude: 41.87194, + longitudeDelta: 10.0, + name: 'Italy', + longitude: 12.56738, + latitudeDelta: 10.0, }, { - "latitude": 18.109581, - "longitudeDelta": 10.0, - "name": "Jamaica", - "longitude": -77.297508, - "latitudeDelta": 10.0 + latitude: 18.109581, + longitudeDelta: 10.0, + name: 'Jamaica', + longitude: -77.297508, + latitudeDelta: 10.0, }, { - "latitude": 36.204824, - "longitudeDelta": 10.0, - "name": "Japan", - "longitude": 138.252924, - "latitudeDelta": 10.0 + latitude: 36.204824, + longitudeDelta: 10.0, + name: 'Japan', + longitude: 138.252924, + latitudeDelta: 10.0, }, { - "latitude": 49.214439, - "longitudeDelta": 10.0, - "name": "Jersey", - "longitude": -2.13125, - "latitudeDelta": 10.0 + latitude: 49.214439, + longitudeDelta: 10.0, + name: 'Jersey', + longitude: -2.13125, + latitudeDelta: 10.0, }, { - "latitude": 30.585164, - "longitudeDelta": 10.0, - "name": "Jordan", - "longitude": 36.238414, - "latitudeDelta": 10.0 + latitude: 30.585164, + longitudeDelta: 10.0, + name: 'Jordan', + longitude: 36.238414, + latitudeDelta: 10.0, }, { - "latitude": 48.019573, - "longitudeDelta": 10.0, - "name": "Kazakhstan", - "longitude": 66.923684, - "latitudeDelta": 10.0 + latitude: 48.019573, + longitudeDelta: 10.0, + name: 'Kazakhstan', + longitude: 66.923684, + latitudeDelta: 10.0, }, { - "latitude": -0.023559, - "longitudeDelta": 10.0, - "name": "Kenya", - "longitude": 37.906193, - "latitudeDelta": 10.0 + latitude: -0.023559, + longitudeDelta: 10.0, + name: 'Kenya', + longitude: 37.906193, + latitudeDelta: 10.0, }, { - "latitude": -3.370417, - "longitudeDelta": 10.0, - "name": "Kiribati", - "longitude": -168.734039, - "latitudeDelta": 10.0 + latitude: -3.370417, + longitudeDelta: 10.0, + name: 'Kiribati', + longitude: -168.734039, + latitudeDelta: 10.0, }, { - "latitude": 42.602636, - "longitudeDelta": 10.0, - "name": "Kosovo", - "longitude": 20.902977, - "latitudeDelta": 10.0 + latitude: 42.602636, + longitudeDelta: 10.0, + name: 'Kosovo', + longitude: 20.902977, + latitudeDelta: 10.0, }, { - "latitude": 29.31166, - "longitudeDelta": 10.0, - "name": "Kuwait", - "longitude": 47.481766, - "latitudeDelta": 10.0 + latitude: 29.31166, + longitudeDelta: 10.0, + name: 'Kuwait', + longitude: 47.481766, + latitudeDelta: 10.0, }, { - "latitude": 41.20438, - "longitudeDelta": 10.0, - "name": "Kyrgyzstan", - "longitude": 74.766098, - "latitudeDelta": 10.0 + latitude: 41.20438, + longitudeDelta: 10.0, + name: 'Kyrgyzstan', + longitude: 74.766098, + latitudeDelta: 10.0, }, { - "latitude": 19.85627, - "longitudeDelta": 10.0, - "name": "Laos", - "longitude": 102.495496, - "latitudeDelta": 10.0 + latitude: 19.85627, + longitudeDelta: 10.0, + name: 'Laos', + longitude: 102.495496, + latitudeDelta: 10.0, }, { - "latitude": 56.879635, - "longitudeDelta": 10.0, - "name": "Latvia", - "longitude": 24.603189, - "latitudeDelta": 10.0 + latitude: 56.879635, + longitudeDelta: 10.0, + name: 'Latvia', + longitude: 24.603189, + latitudeDelta: 10.0, }, { - "latitude": 33.854721, - "longitudeDelta": 10.0, - "name": "Lebanon", - "longitude": 35.862285, - "latitudeDelta": 10.0 + latitude: 33.854721, + longitudeDelta: 10.0, + name: 'Lebanon', + longitude: 35.862285, + latitudeDelta: 10.0, }, { - "latitude": -29.609988, - "longitudeDelta": 10.0, - "name": "Lesotho", - "longitude": 28.233608, - "latitudeDelta": 10.0 + latitude: -29.609988, + longitudeDelta: 10.0, + name: 'Lesotho', + longitude: 28.233608, + latitudeDelta: 10.0, }, { - "latitude": 6.428055, - "longitudeDelta": 10.0, - "name": "Liberia", - "longitude": -9.429499, - "latitudeDelta": 10.0 + latitude: 6.428055, + longitudeDelta: 10.0, + name: 'Liberia', + longitude: -9.429499, + latitudeDelta: 10.0, }, { - "latitude": 26.3351, - "longitudeDelta": 10.0, - "name": "Libya", - "longitude": 17.228331, - "latitudeDelta": 10.0 + latitude: 26.3351, + longitudeDelta: 10.0, + name: 'Libya', + longitude: 17.228331, + latitudeDelta: 10.0, }, { - "latitude": 47.166, - "longitudeDelta": 10.0, - "name": "Liechtenstein", - "longitude": 9.555373, - "latitudeDelta": 10.0 + latitude: 47.166, + longitudeDelta: 10.0, + name: 'Liechtenstein', + longitude: 9.555373, + latitudeDelta: 10.0, }, { - "latitude": 55.169438, - "longitudeDelta": 10.0, - "name": "Lithuania", - "longitude": 23.881275, - "latitudeDelta": 10.0 + latitude: 55.169438, + longitudeDelta: 10.0, + name: 'Lithuania', + longitude: 23.881275, + latitudeDelta: 10.0, }, { - "latitude": 49.815273, - "longitudeDelta": 10.0, - "name": "Luxembourg", - "longitude": 6.129583, - "latitudeDelta": 10.0 + latitude: 49.815273, + longitudeDelta: 10.0, + name: 'Luxembourg', + longitude: 6.129583, + latitudeDelta: 10.0, }, { - "latitude": 22.198745, - "longitudeDelta": 10.0, - "name": "Macau", - "longitude": 113.543873, - "latitudeDelta": 10.0 + latitude: 22.198745, + longitudeDelta: 10.0, + name: 'Macau', + longitude: 113.543873, + latitudeDelta: 10.0, }, { - "latitude": 41.608635, - "longitudeDelta": 10.0, - "name": "Macedonia [FYROM]", - "longitude": 21.745275, - "latitudeDelta": 10.0 + latitude: 41.608635, + longitudeDelta: 10.0, + name: 'Macedonia [FYROM]', + longitude: 21.745275, + latitudeDelta: 10.0, }, { - "latitude": -18.766947, - "longitudeDelta": 10.0, - "name": "Madagascar", - "longitude": 46.869107, - "latitudeDelta": 10.0 + latitude: -18.766947, + longitudeDelta: 10.0, + name: 'Madagascar', + longitude: 46.869107, + latitudeDelta: 10.0, }, { - "latitude": -13.254308, - "longitudeDelta": 10.0, - "name": "Malawi", - "longitude": 34.301525, - "latitudeDelta": 10.0 + latitude: -13.254308, + longitudeDelta: 10.0, + name: 'Malawi', + longitude: 34.301525, + latitudeDelta: 10.0, }, { - "latitude": 4.210484, - "longitudeDelta": 10.0, - "name": "Malaysia", - "longitude": 101.975766, - "latitudeDelta": 10.0 + latitude: 4.210484, + longitudeDelta: 10.0, + name: 'Malaysia', + longitude: 101.975766, + latitudeDelta: 10.0, }, { - "latitude": 3.202778, - "longitudeDelta": 10.0, - "name": "Maldives", - "longitude": 73.22068, - "latitudeDelta": 10.0 + latitude: 3.202778, + longitudeDelta: 10.0, + name: 'Maldives', + longitude: 73.22068, + latitudeDelta: 10.0, }, { - "latitude": 17.570692, - "longitudeDelta": 10.0, - "name": "Mali", - "longitude": -3.996166, - "latitudeDelta": 10.0 + latitude: 17.570692, + longitudeDelta: 10.0, + name: 'Mali', + longitude: -3.996166, + latitudeDelta: 10.0, }, { - "latitude": 35.937496, - "longitudeDelta": 10.0, - "name": "Malta", - "longitude": 14.375416, - "latitudeDelta": 10.0 + latitude: 35.937496, + longitudeDelta: 10.0, + name: 'Malta', + longitude: 14.375416, + latitudeDelta: 10.0, }, { - "latitude": 7.131474, - "longitudeDelta": 10.0, - "name": "Marshall Islands", - "longitude": 171.184478, - "latitudeDelta": 10.0 + latitude: 7.131474, + longitudeDelta: 10.0, + name: 'Marshall Islands', + longitude: 171.184478, + latitudeDelta: 10.0, }, { - "latitude": 14.641528, - "longitudeDelta": 10.0, - "name": "Martinique", - "longitude": -61.024174, - "latitudeDelta": 10.0 + latitude: 14.641528, + longitudeDelta: 10.0, + name: 'Martinique', + longitude: -61.024174, + latitudeDelta: 10.0, }, { - "latitude": 21.00789, - "longitudeDelta": 10.0, - "name": "Mauritania", - "longitude": -10.940835, - "latitudeDelta": 10.0 + latitude: 21.00789, + longitudeDelta: 10.0, + name: 'Mauritania', + longitude: -10.940835, + latitudeDelta: 10.0, }, { - "latitude": -20.348404, - "longitudeDelta": 10.0, - "name": "Mauritius", - "longitude": 57.552152, - "latitudeDelta": 10.0 + latitude: -20.348404, + longitudeDelta: 10.0, + name: 'Mauritius', + longitude: 57.552152, + latitudeDelta: 10.0, }, { - "latitude": -12.8275, - "longitudeDelta": 10.0, - "name": "Mayotte", - "longitude": 45.166244, - "latitudeDelta": 10.0 + latitude: -12.8275, + longitudeDelta: 10.0, + name: 'Mayotte', + longitude: 45.166244, + latitudeDelta: 10.0, }, { - "latitude": 23.634501, - "longitudeDelta": 10.0, - "name": "Mexico", - "longitude": -102.552784, - "latitudeDelta": 10.0 + latitude: 23.634501, + longitudeDelta: 10.0, + name: 'Mexico', + longitude: -102.552784, + latitudeDelta: 10.0, }, { - "latitude": 7.425554, - "longitudeDelta": 10.0, - "name": "Micronesia", - "longitude": 150.550812, - "latitudeDelta": 10.0 + latitude: 7.425554, + longitudeDelta: 10.0, + name: 'Micronesia', + longitude: 150.550812, + latitudeDelta: 10.0, }, { - "latitude": 47.411631, - "longitudeDelta": 10.0, - "name": "Moldova", - "longitude": 28.369885, - "latitudeDelta": 10.0 + latitude: 47.411631, + longitudeDelta: 10.0, + name: 'Moldova', + longitude: 28.369885, + latitudeDelta: 10.0, }, { - "latitude": 43.750298, - "longitudeDelta": 10.0, - "name": "Monaco", - "longitude": 7.412841, - "latitudeDelta": 10.0 + latitude: 43.750298, + longitudeDelta: 10.0, + name: 'Monaco', + longitude: 7.412841, + latitudeDelta: 10.0, }, { - "latitude": 46.862496, - "longitudeDelta": 10.0, - "name": "Mongolia", - "longitude": 103.846656, - "latitudeDelta": 10.0 + latitude: 46.862496, + longitudeDelta: 10.0, + name: 'Mongolia', + longitude: 103.846656, + latitudeDelta: 10.0, }, { - "latitude": 42.708678, - "longitudeDelta": 10.0, - "name": "Montenegro", - "longitude": 19.37439, - "latitudeDelta": 10.0 + latitude: 42.708678, + longitudeDelta: 10.0, + name: 'Montenegro', + longitude: 19.37439, + latitudeDelta: 10.0, }, { - "latitude": 16.742498, - "longitudeDelta": 10.0, - "name": "Montserrat", - "longitude": -62.187366, - "latitudeDelta": 10.0 + latitude: 16.742498, + longitudeDelta: 10.0, + name: 'Montserrat', + longitude: -62.187366, + latitudeDelta: 10.0, }, { - "latitude": 31.791702, - "longitudeDelta": 10.0, - "name": "Morocco", - "longitude": -7.09262, - "latitudeDelta": 10.0 + latitude: 31.791702, + longitudeDelta: 10.0, + name: 'Morocco', + longitude: -7.09262, + latitudeDelta: 10.0, }, { - "latitude": -18.665695, - "longitudeDelta": 10.0, - "name": "Mozambique", - "longitude": 35.529562, - "latitudeDelta": 10.0 + latitude: -18.665695, + longitudeDelta: 10.0, + name: 'Mozambique', + longitude: 35.529562, + latitudeDelta: 10.0, }, { - "latitude": 21.913965, - "longitudeDelta": 10.0, - "name": "Myanmar [Burma]", - "longitude": 95.956223, - "latitudeDelta": 10.0 + latitude: 21.913965, + longitudeDelta: 10.0, + name: 'Myanmar [Burma]', + longitude: 95.956223, + latitudeDelta: 10.0, }, { - "latitude": -22.95764, - "longitudeDelta": 10.0, - "name": "Namibia", - "longitude": 18.49041, - "latitudeDelta": 10.0 + latitude: -22.95764, + longitudeDelta: 10.0, + name: 'Namibia', + longitude: 18.49041, + latitudeDelta: 10.0, }, { - "latitude": -0.522778, - "longitudeDelta": 10.0, - "name": "Nauru", - "longitude": 166.931503, - "latitudeDelta": 10.0 + latitude: -0.522778, + longitudeDelta: 10.0, + name: 'Nauru', + longitude: 166.931503, + latitudeDelta: 10.0, }, { - "latitude": 28.394857, - "longitudeDelta": 10.0, - "name": "Nepal", - "longitude": 84.124008, - "latitudeDelta": 10.0 + latitude: 28.394857, + longitudeDelta: 10.0, + name: 'Nepal', + longitude: 84.124008, + latitudeDelta: 10.0, }, { - "latitude": 52.132633, - "longitudeDelta": 10.0, - "name": "Netherlands", - "longitude": 5.291266, - "latitudeDelta": 10.0 + latitude: 52.132633, + longitudeDelta: 10.0, + name: 'Netherlands', + longitude: 5.291266, + latitudeDelta: 10.0, }, { - "latitude": 12.226079, - "longitudeDelta": 10.0, - "name": "Netherlands Antilles", - "longitude": -69.060087, - "latitudeDelta": 10.0 + latitude: 12.226079, + longitudeDelta: 10.0, + name: 'Netherlands Antilles', + longitude: -69.060087, + latitudeDelta: 10.0, }, { - "latitude": -20.904305, - "longitudeDelta": 10.0, - "name": "New Caledonia", - "longitude": 165.618042, - "latitudeDelta": 10.0 + latitude: -20.904305, + longitudeDelta: 10.0, + name: 'New Caledonia', + longitude: 165.618042, + latitudeDelta: 10.0, }, { - "latitude": -40.900557, - "longitudeDelta": 10.0, - "name": "New Zealand", - "longitude": 174.885971, - "latitudeDelta": 10.0 + latitude: -40.900557, + longitudeDelta: 10.0, + name: 'New Zealand', + longitude: 174.885971, + latitudeDelta: 10.0, }, { - "latitude": 12.865416, - "longitudeDelta": 10.0, - "name": "Nicaragua", - "longitude": -85.207229, - "latitudeDelta": 10.0 + latitude: 12.865416, + longitudeDelta: 10.0, + name: 'Nicaragua', + longitude: -85.207229, + latitudeDelta: 10.0, }, { - "latitude": 17.607789, - "longitudeDelta": 10.0, - "name": "Niger", - "longitude": 8.081666, - "latitudeDelta": 10.0 + latitude: 17.607789, + longitudeDelta: 10.0, + name: 'Niger', + longitude: 8.081666, + latitudeDelta: 10.0, }, { - "latitude": 9.081999, - "longitudeDelta": 10.0, - "name": "Nigeria", - "longitude": 8.675277, - "latitudeDelta": 10.0 + latitude: 9.081999, + longitudeDelta: 10.0, + name: 'Nigeria', + longitude: 8.675277, + latitudeDelta: 10.0, }, { - "latitude": -19.054445, - "longitudeDelta": 10.0, - "name": "Niue", - "longitude": -169.867233, - "latitudeDelta": 10.0 + latitude: -19.054445, + longitudeDelta: 10.0, + name: 'Niue', + longitude: -169.867233, + latitudeDelta: 10.0, }, { - "latitude": -29.040835, - "longitudeDelta": 10.0, - "name": "Norfolk Island", - "longitude": 167.954712, - "latitudeDelta": 10.0 + latitude: -29.040835, + longitudeDelta: 10.0, + name: 'Norfolk Island', + longitude: 167.954712, + latitudeDelta: 10.0, }, { - "latitude": 40.339852, - "longitudeDelta": 10.0, - "name": "North Korea", - "longitude": 127.510093, - "latitudeDelta": 10.0 + latitude: 40.339852, + longitudeDelta: 10.0, + name: 'North Korea', + longitude: 127.510093, + latitudeDelta: 10.0, }, { - "latitude": 17.33083, - "longitudeDelta": 10.0, - "name": "Northern Mariana Islands", - "longitude": 145.38469, - "latitudeDelta": 10.0 + latitude: 17.33083, + longitudeDelta: 10.0, + name: 'Northern Mariana Islands', + longitude: 145.38469, + latitudeDelta: 10.0, }, { - "latitude": 60.472024, - "longitudeDelta": 10.0, - "name": "Norway", - "longitude": 8.468946, - "latitudeDelta": 10.0 + latitude: 60.472024, + longitudeDelta: 10.0, + name: 'Norway', + longitude: 8.468946, + latitudeDelta: 10.0, }, { - "latitude": 21.512583, - "longitudeDelta": 10.0, - "name": "Oman", - "longitude": 55.923255, - "latitudeDelta": 10.0 + latitude: 21.512583, + longitudeDelta: 10.0, + name: 'Oman', + longitude: 55.923255, + latitudeDelta: 10.0, }, { - "latitude": 30.375321, - "longitudeDelta": 10.0, - "name": "Pakistan", - "longitude": 69.345116, - "latitudeDelta": 10.0 + latitude: 30.375321, + longitudeDelta: 10.0, + name: 'Pakistan', + longitude: 69.345116, + latitudeDelta: 10.0, }, { - "latitude": 7.51498, - "longitudeDelta": 10.0, - "name": "Palau", - "longitude": 134.58252, - "latitudeDelta": 10.0 + latitude: 7.51498, + longitudeDelta: 10.0, + name: 'Palau', + longitude: 134.58252, + latitudeDelta: 10.0, }, { - "latitude": 31.952162, - "longitudeDelta": 10.0, - "name": "Palestinian Territories", - "longitude": 35.233154, - "latitudeDelta": 10.0 + latitude: 31.952162, + longitudeDelta: 10.0, + name: 'Palestinian Territories', + longitude: 35.233154, + latitudeDelta: 10.0, }, { - "latitude": 8.537981, - "longitudeDelta": 10.0, - "name": "Panama", - "longitude": -80.782127, - "latitudeDelta": 10.0 + latitude: 8.537981, + longitudeDelta: 10.0, + name: 'Panama', + longitude: -80.782127, + latitudeDelta: 10.0, }, { - "latitude": -6.314993, - "longitudeDelta": 10.0, - "name": "Papua New Guinea", - "longitude": 143.95555, - "latitudeDelta": 10.0 + latitude: -6.314993, + longitudeDelta: 10.0, + name: 'Papua New Guinea', + longitude: 143.95555, + latitudeDelta: 10.0, }, { - "latitude": -23.442503, - "longitudeDelta": 10.0, - "name": "Paraguay", - "longitude": -58.443832, - "latitudeDelta": 10.0 + latitude: -23.442503, + longitudeDelta: 10.0, + name: 'Paraguay', + longitude: -58.443832, + latitudeDelta: 10.0, }, { - "latitude": -9.189967, - "longitudeDelta": 10.0, - "name": "Peru", - "longitude": -75.015152, - "latitudeDelta": 10.0 + latitude: -9.189967, + longitudeDelta: 10.0, + name: 'Peru', + longitude: -75.015152, + latitudeDelta: 10.0, }, { - "latitude": 12.879721, - "longitudeDelta": 10.0, - "name": "Philippines", - "longitude": 121.774017, - "latitudeDelta": 10.0 + latitude: 12.879721, + longitudeDelta: 10.0, + name: 'Philippines', + longitude: 121.774017, + latitudeDelta: 10.0, }, { - "latitude": -24.703615, - "longitudeDelta": 10.0, - "name": "Pitcairn Islands", - "longitude": -127.439308, - "latitudeDelta": 10.0 + latitude: -24.703615, + longitudeDelta: 10.0, + name: 'Pitcairn Islands', + longitude: -127.439308, + latitudeDelta: 10.0, }, { - "latitude": 51.919438, - "longitudeDelta": 10.0, - "name": "Poland", - "longitude": 19.145136, - "latitudeDelta": 10.0 + latitude: 51.919438, + longitudeDelta: 10.0, + name: 'Poland', + longitude: 19.145136, + latitudeDelta: 10.0, }, { - "latitude": 39.399872, - "longitudeDelta": 10.0, - "name": "Portugal", - "longitude": -8.224454, - "latitudeDelta": 10.0 + latitude: 39.399872, + longitudeDelta: 10.0, + name: 'Portugal', + longitude: -8.224454, + latitudeDelta: 10.0, }, { - "latitude": 18.220833, - "longitudeDelta": 10.0, - "name": "Puerto Rico", - "longitude": -66.590149, - "latitudeDelta": 10.0 + latitude: 18.220833, + longitudeDelta: 10.0, + name: 'Puerto Rico', + longitude: -66.590149, + latitudeDelta: 10.0, }, { - "latitude": 25.354826, - "longitudeDelta": 10.0, - "name": "Qatar", - "longitude": 51.183884, - "latitudeDelta": 10.0 + latitude: 25.354826, + longitudeDelta: 10.0, + name: 'Qatar', + longitude: 51.183884, + latitudeDelta: 10.0, }, { - "latitude": 45.943161, - "longitudeDelta": 10.0, - "name": "Romania", - "longitude": 24.96676, - "latitudeDelta": 10.0 + latitude: 45.943161, + longitudeDelta: 10.0, + name: 'Romania', + longitude: 24.96676, + latitudeDelta: 10.0, }, { - "latitude": 61.52401, - "longitudeDelta": 10.0, - "name": "Russia", - "longitude": 105.318756, - "latitudeDelta": 10.0 + latitude: 61.52401, + longitudeDelta: 10.0, + name: 'Russia', + longitude: 105.318756, + latitudeDelta: 10.0, }, { - "latitude": -1.940278, - "longitudeDelta": 10.0, - "name": "Rwanda", - "longitude": 29.873888, - "latitudeDelta": 10.0 + latitude: -1.940278, + longitudeDelta: 10.0, + name: 'Rwanda', + longitude: 29.873888, + latitudeDelta: 10.0, }, { - "latitude": -21.115141, - "longitudeDelta": 10.0, - "name": "R\u00e9union", - "longitude": 55.536384, - "latitudeDelta": 10.0 + latitude: -21.115141, + longitudeDelta: 10.0, + name: 'R\u00e9union', + longitude: 55.536384, + latitudeDelta: 10.0, }, { - "latitude": -24.143474, - "longitudeDelta": 10.0, - "name": "Saint Helena", - "longitude": -10.030696, - "latitudeDelta": 10.0 + latitude: -24.143474, + longitudeDelta: 10.0, + name: 'Saint Helena', + longitude: -10.030696, + latitudeDelta: 10.0, }, { - "latitude": 17.357822, - "longitudeDelta": 10.0, - "name": "Saint Kitts and Nevis", - "longitude": -62.782998, - "latitudeDelta": 10.0 + latitude: 17.357822, + longitudeDelta: 10.0, + name: 'Saint Kitts and Nevis', + longitude: -62.782998, + latitudeDelta: 10.0, }, { - "latitude": 13.909444, - "longitudeDelta": 10.0, - "name": "Saint Lucia", - "longitude": -60.978893, - "latitudeDelta": 10.0 + latitude: 13.909444, + longitudeDelta: 10.0, + name: 'Saint Lucia', + longitude: -60.978893, + latitudeDelta: 10.0, }, { - "latitude": 46.941936, - "longitudeDelta": 10.0, - "name": "Saint Pierre and Miquelon", - "longitude": -56.27111, - "latitudeDelta": 10.0 + latitude: 46.941936, + longitudeDelta: 10.0, + name: 'Saint Pierre and Miquelon', + longitude: -56.27111, + latitudeDelta: 10.0, }, { - "latitude": 12.984305, - "longitudeDelta": 10.0, - "name": "Saint Vincent and the Grenadines", - "longitude": -61.287228, - "latitudeDelta": 10.0 + latitude: 12.984305, + longitudeDelta: 10.0, + name: 'Saint Vincent and the Grenadines', + longitude: -61.287228, + latitudeDelta: 10.0, }, { - "latitude": -13.759029, - "longitudeDelta": 10.0, - "name": "Samoa", - "longitude": -172.104629, - "latitudeDelta": 10.0 + latitude: -13.759029, + longitudeDelta: 10.0, + name: 'Samoa', + longitude: -172.104629, + latitudeDelta: 10.0, }, { - "latitude": 43.94236, - "longitudeDelta": 10.0, - "name": "San Marino", - "longitude": 12.457777, - "latitudeDelta": 10.0 + latitude: 43.94236, + longitudeDelta: 10.0, + name: 'San Marino', + longitude: 12.457777, + latitudeDelta: 10.0, }, { - "latitude": 23.885942, - "longitudeDelta": 10.0, - "name": "Saudi Arabia", - "longitude": 45.079162, - "latitudeDelta": 10.0 + latitude: 23.885942, + longitudeDelta: 10.0, + name: 'Saudi Arabia', + longitude: 45.079162, + latitudeDelta: 10.0, }, { - "latitude": 14.497401, - "longitudeDelta": 10.0, - "name": "Senegal", - "longitude": -14.452362, - "latitudeDelta": 10.0 + latitude: 14.497401, + longitudeDelta: 10.0, + name: 'Senegal', + longitude: -14.452362, + latitudeDelta: 10.0, }, { - "latitude": 44.016521, - "longitudeDelta": 10.0, - "name": "Serbia", - "longitude": 21.005859, - "latitudeDelta": 10.0 + latitude: 44.016521, + longitudeDelta: 10.0, + name: 'Serbia', + longitude: 21.005859, + latitudeDelta: 10.0, }, { - "latitude": -4.679574, - "longitudeDelta": 10.0, - "name": "Seychelles", - "longitude": 55.491977, - "latitudeDelta": 10.0 + latitude: -4.679574, + longitudeDelta: 10.0, + name: 'Seychelles', + longitude: 55.491977, + latitudeDelta: 10.0, }, { - "latitude": 8.460555, - "longitudeDelta": 10.0, - "name": "Sierra Leone", - "longitude": -11.779889, - "latitudeDelta": 10.0 + latitude: 8.460555, + longitudeDelta: 10.0, + name: 'Sierra Leone', + longitude: -11.779889, + latitudeDelta: 10.0, }, { - "latitude": 1.352083, - "longitudeDelta": 10.0, - "name": "Singapore", - "longitude": 103.819836, - "latitudeDelta": 10.0 + latitude: 1.352083, + longitudeDelta: 10.0, + name: 'Singapore', + longitude: 103.819836, + latitudeDelta: 10.0, }, { - "latitude": 48.669026, - "longitudeDelta": 10.0, - "name": "Slovakia", - "longitude": 19.699024, - "latitudeDelta": 10.0 + latitude: 48.669026, + longitudeDelta: 10.0, + name: 'Slovakia', + longitude: 19.699024, + latitudeDelta: 10.0, }, { - "latitude": 46.151241, - "longitudeDelta": 10.0, - "name": "Slovenia", - "longitude": 14.995463, - "latitudeDelta": 10.0 + latitude: 46.151241, + longitudeDelta: 10.0, + name: 'Slovenia', + longitude: 14.995463, + latitudeDelta: 10.0, }, { - "latitude": -9.64571, - "longitudeDelta": 10.0, - "name": "Solomon Islands", - "longitude": 160.156194, - "latitudeDelta": 10.0 + latitude: -9.64571, + longitudeDelta: 10.0, + name: 'Solomon Islands', + longitude: 160.156194, + latitudeDelta: 10.0, }, { - "latitude": 5.152149, - "longitudeDelta": 10.0, - "name": "Somalia", - "longitude": 46.199616, - "latitudeDelta": 10.0 + latitude: 5.152149, + longitudeDelta: 10.0, + name: 'Somalia', + longitude: 46.199616, + latitudeDelta: 10.0, }, { - "latitude": -30.559482, - "longitudeDelta": 10.0, - "name": "South Africa", - "longitude": 22.937506, - "latitudeDelta": 10.0 + latitude: -30.559482, + longitudeDelta: 10.0, + name: 'South Africa', + longitude: 22.937506, + latitudeDelta: 10.0, }, { - "latitude": -54.429579, - "longitudeDelta": 10.0, - "name": "South Georgia and the South Sandwich Islands", - "longitude": -36.587909, - "latitudeDelta": 10.0 + latitude: -54.429579, + longitudeDelta: 10.0, + name: 'South Georgia and the South Sandwich Islands', + longitude: -36.587909, + latitudeDelta: 10.0, }, { - "latitude": 35.907757, - "longitudeDelta": 10.0, - "name": "South Korea", - "longitude": 127.766922, - "latitudeDelta": 10.0 + latitude: 35.907757, + longitudeDelta: 10.0, + name: 'South Korea', + longitude: 127.766922, + latitudeDelta: 10.0, }, { - "latitude": 40.463667, - "longitudeDelta": 10.0, - "name": "Spain", - "longitude": -3.74922, - "latitudeDelta": 10.0 + latitude: 40.463667, + longitudeDelta: 10.0, + name: 'Spain', + longitude: -3.74922, + latitudeDelta: 10.0, }, { - "latitude": 7.873054, - "longitudeDelta": 10.0, - "name": "Sri Lanka", - "longitude": 80.771797, - "latitudeDelta": 10.0 + latitude: 7.873054, + longitudeDelta: 10.0, + name: 'Sri Lanka', + longitude: 80.771797, + latitudeDelta: 10.0, }, { - "latitude": 12.862807, - "longitudeDelta": 10.0, - "name": "Sudan", - "longitude": 30.217636, - "latitudeDelta": 10.0 + latitude: 12.862807, + longitudeDelta: 10.0, + name: 'Sudan', + longitude: 30.217636, + latitudeDelta: 10.0, }, { - "latitude": 3.919305, - "longitudeDelta": 10.0, - "name": "Suriname", - "longitude": -56.027783, - "latitudeDelta": 10.0 + latitude: 3.919305, + longitudeDelta: 10.0, + name: 'Suriname', + longitude: -56.027783, + latitudeDelta: 10.0, }, { - "latitude": 77.553604, - "longitudeDelta": 10.0, - "name": "Svalbard and Jan Mayen", - "longitude": 23.670272, - "latitudeDelta": 10.0 + latitude: 77.553604, + longitudeDelta: 10.0, + name: 'Svalbard and Jan Mayen', + longitude: 23.670272, + latitudeDelta: 10.0, }, { - "latitude": -26.522503, - "longitudeDelta": 10.0, - "name": "Swaziland", - "longitude": 31.465866, - "latitudeDelta": 10.0 + latitude: -26.522503, + longitudeDelta: 10.0, + name: 'Swaziland', + longitude: 31.465866, + latitudeDelta: 10.0, }, { - "latitude": 60.128161, - "longitudeDelta": 10.0, - "name": "Sweden", - "longitude": 18.643501, - "latitudeDelta": 10.0 + latitude: 60.128161, + longitudeDelta: 10.0, + name: 'Sweden', + longitude: 18.643501, + latitudeDelta: 10.0, }, { - "latitude": 46.818188, - "longitudeDelta": 10.0, - "name": "Switzerland", - "longitude": 8.227512, - "latitudeDelta": 10.0 + latitude: 46.818188, + longitudeDelta: 10.0, + name: 'Switzerland', + longitude: 8.227512, + latitudeDelta: 10.0, }, { - "latitude": 34.802075, - "longitudeDelta": 10.0, - "name": "Syria", - "longitude": 38.996815, - "latitudeDelta": 10.0 + latitude: 34.802075, + longitudeDelta: 10.0, + name: 'Syria', + longitude: 38.996815, + latitudeDelta: 10.0, }, { - "latitude": 0.18636, - "longitudeDelta": 10.0, - "name": "S\u00e3o Tom\u00e9 and Pr\u00edncipe", - "longitude": 6.613081, - "latitudeDelta": 10.0 + latitude: 0.18636, + longitudeDelta: 10.0, + name: 'S\u00e3o Tom\u00e9 and Pr\u00edncipe', + longitude: 6.613081, + latitudeDelta: 10.0, }, { - "latitude": 23.69781, - "longitudeDelta": 10.0, - "name": "Taiwan", - "longitude": 120.960515, - "latitudeDelta": 10.0 + latitude: 23.69781, + longitudeDelta: 10.0, + name: 'Taiwan', + longitude: 120.960515, + latitudeDelta: 10.0, }, { - "latitude": 38.861034, - "longitudeDelta": 10.0, - "name": "Tajikistan", - "longitude": 71.276093, - "latitudeDelta": 10.0 + latitude: 38.861034, + longitudeDelta: 10.0, + name: 'Tajikistan', + longitude: 71.276093, + latitudeDelta: 10.0, }, { - "latitude": -6.369028, - "longitudeDelta": 10.0, - "name": "Tanzania", - "longitude": 34.888822, - "latitudeDelta": 10.0 + latitude: -6.369028, + longitudeDelta: 10.0, + name: 'Tanzania', + longitude: 34.888822, + latitudeDelta: 10.0, }, { - "latitude": 15.870032, - "longitudeDelta": 10.0, - "name": "Thailand", - "longitude": 100.992541, - "latitudeDelta": 10.0 + latitude: 15.870032, + longitudeDelta: 10.0, + name: 'Thailand', + longitude: 100.992541, + latitudeDelta: 10.0, }, { - "latitude": -8.874217, - "longitudeDelta": 10.0, - "name": "Timor-Leste", - "longitude": 125.727539, - "latitudeDelta": 10.0 + latitude: -8.874217, + longitudeDelta: 10.0, + name: 'Timor-Leste', + longitude: 125.727539, + latitudeDelta: 10.0, }, { - "latitude": 8.619543, - "longitudeDelta": 10.0, - "name": "Togo", - "longitude": 0.824782, - "latitudeDelta": 10.0 + latitude: 8.619543, + longitudeDelta: 10.0, + name: 'Togo', + longitude: 0.824782, + latitudeDelta: 10.0, }, { - "latitude": -8.967363, - "longitudeDelta": 10.0, - "name": "Tokelau", - "longitude": -171.855881, - "latitudeDelta": 10.0 + latitude: -8.967363, + longitudeDelta: 10.0, + name: 'Tokelau', + longitude: -171.855881, + latitudeDelta: 10.0, }, { - "latitude": -21.178986, - "longitudeDelta": 10.0, - "name": "Tonga", - "longitude": -175.198242, - "latitudeDelta": 10.0 + latitude: -21.178986, + longitudeDelta: 10.0, + name: 'Tonga', + longitude: -175.198242, + latitudeDelta: 10.0, }, { - "latitude": 10.691803, - "longitudeDelta": 10.0, - "name": "Trinidad and Tobago", - "longitude": -61.222503, - "latitudeDelta": 10.0 + latitude: 10.691803, + longitudeDelta: 10.0, + name: 'Trinidad and Tobago', + longitude: -61.222503, + latitudeDelta: 10.0, }, { - "latitude": 33.886917, - "longitudeDelta": 10.0, - "name": "Tunisia", - "longitude": 9.537499, - "latitudeDelta": 10.0 + latitude: 33.886917, + longitudeDelta: 10.0, + name: 'Tunisia', + longitude: 9.537499, + latitudeDelta: 10.0, }, { - "latitude": 38.963745, - "longitudeDelta": 10.0, - "name": "Turkey", - "longitude": 35.243322, - "latitudeDelta": 10.0 + latitude: 38.963745, + longitudeDelta: 10.0, + name: 'Turkey', + longitude: 35.243322, + latitudeDelta: 10.0, }, { - "latitude": 38.969719, - "longitudeDelta": 10.0, - "name": "Turkmenistan", - "longitude": 59.556278, - "latitudeDelta": 10.0 + latitude: 38.969719, + longitudeDelta: 10.0, + name: 'Turkmenistan', + longitude: 59.556278, + latitudeDelta: 10.0, }, { - "latitude": 21.694025, - "longitudeDelta": 10.0, - "name": "Turks and Caicos Islands", - "longitude": -71.797928, - "latitudeDelta": 10.0 + latitude: 21.694025, + longitudeDelta: 10.0, + name: 'Turks and Caicos Islands', + longitude: -71.797928, + latitudeDelta: 10.0, }, { - "latitude": -7.109535, - "longitudeDelta": 10.0, - "name": "Tuvalu", - "longitude": 177.64933, - "latitudeDelta": 10.0 + latitude: -7.109535, + longitudeDelta: 10.0, + name: 'Tuvalu', + longitude: 177.64933, + latitudeDelta: 10.0, }, { - "latitude": 18.335765, - "longitudeDelta": 10.0, - "name": "U.S. Virgin Islands", - "longitude": -64.896335, - "latitudeDelta": 10.0 + latitude: 18.335765, + longitudeDelta: 10.0, + name: 'U.S. Virgin Islands', + longitude: -64.896335, + latitudeDelta: 10.0, }, { - "latitude": 1.373333, - "longitudeDelta": 10.0, - "name": "Uganda", - "longitude": 32.290275, - "latitudeDelta": 10.0 + latitude: 1.373333, + longitudeDelta: 10.0, + name: 'Uganda', + longitude: 32.290275, + latitudeDelta: 10.0, }, { - "latitude": 48.379433, - "longitudeDelta": 10.0, - "name": "Ukraine", - "longitude": 31.16558, - "latitudeDelta": 10.0 + latitude: 48.379433, + longitudeDelta: 10.0, + name: 'Ukraine', + longitude: 31.16558, + latitudeDelta: 10.0, }, { - "latitude": 23.424076, - "longitudeDelta": 10.0, - "name": "United Arab Emirates", - "longitude": 53.847818, - "latitudeDelta": 10.0 + latitude: 23.424076, + longitudeDelta: 10.0, + name: 'United Arab Emirates', + longitude: 53.847818, + latitudeDelta: 10.0, }, { - "latitude": 55.378051, - "longitudeDelta": 10.0, - "name": "United Kingdom", - "longitude": -3.435973, - "latitudeDelta": 10.0 + latitude: 55.378051, + longitudeDelta: 10.0, + name: 'United Kingdom', + longitude: -3.435973, + latitudeDelta: 10.0, }, { - "latitude": 37.09024, - "longitudeDelta": 10.0, - "name": "United States", - "longitude": -95.712891, - "latitudeDelta": 10.0 + latitude: 37.09024, + longitudeDelta: 10.0, + name: 'United States', + longitude: -95.712891, + latitudeDelta: 10.0, }, { - "latitude": -32.522779, - "longitudeDelta": 10.0, - "name": "Uruguay", - "longitude": -55.765835, - "latitudeDelta": 10.0 + latitude: -32.522779, + longitudeDelta: 10.0, + name: 'Uruguay', + longitude: -55.765835, + latitudeDelta: 10.0, }, { - "latitude": 41.377491, - "longitudeDelta": 10.0, - "name": "Uzbekistan", - "longitude": 64.585262, - "latitudeDelta": 10.0 + latitude: 41.377491, + longitudeDelta: 10.0, + name: 'Uzbekistan', + longitude: 64.585262, + latitudeDelta: 10.0, }, { - "latitude": -15.376706, - "longitudeDelta": 10.0, - "name": "Vanuatu", - "longitude": 166.959158, - "latitudeDelta": 10.0 + latitude: -15.376706, + longitudeDelta: 10.0, + name: 'Vanuatu', + longitude: 166.959158, + latitudeDelta: 10.0, }, { - "latitude": 41.902916, - "longitudeDelta": 10.0, - "name": "Vatican City", - "longitude": 12.453389, - "latitudeDelta": 10.0 + latitude: 41.902916, + longitudeDelta: 10.0, + name: 'Vatican City', + longitude: 12.453389, + latitudeDelta: 10.0, }, { - "latitude": 6.42375, - "longitudeDelta": 10.0, - "name": "Venezuela", - "longitude": -66.58973, - "latitudeDelta": 10.0 + latitude: 6.42375, + longitudeDelta: 10.0, + name: 'Venezuela', + longitude: -66.58973, + latitudeDelta: 10.0, }, { - "latitude": 14.058324, - "longitudeDelta": 10.0, - "name": "Vietnam", - "longitude": 108.277199, - "latitudeDelta": 10.0 + latitude: 14.058324, + longitudeDelta: 10.0, + name: 'Vietnam', + longitude: 108.277199, + latitudeDelta: 10.0, }, { - "latitude": -13.768752, - "longitudeDelta": 10.0, - "name": "Wallis and Futuna", - "longitude": -177.156097, - "latitudeDelta": 10.0 + latitude: -13.768752, + longitudeDelta: 10.0, + name: 'Wallis and Futuna', + longitude: -177.156097, + latitudeDelta: 10.0, }, { - "latitude": 24.215527, - "longitudeDelta": 10.0, - "name": "Western Sahara", - "longitude": -12.885834, - "latitudeDelta": 10.0 + latitude: 24.215527, + longitudeDelta: 10.0, + name: 'Western Sahara', + longitude: -12.885834, + latitudeDelta: 10.0, }, { - "latitude": 15.552727, - "longitudeDelta": 10.0, - "name": "Yemen", - "longitude": 48.516388, - "latitudeDelta": 10.0 + latitude: 15.552727, + longitudeDelta: 10.0, + name: 'Yemen', + longitude: 48.516388, + latitudeDelta: 10.0, }, { - "latitude": -13.133897, - "longitudeDelta": 10.0, - "name": "Zambia", - "longitude": 27.849332, - "latitudeDelta": 10.0 + latitude: -13.133897, + longitudeDelta: 10.0, + name: 'Zambia', + longitude: 27.849332, + latitudeDelta: 10.0, }, { - "latitude": -19.015438, - "longitudeDelta": 10.0, - "name": "Zimbabwe", - "longitude": 29.154857, - "latitudeDelta": 10.0 - } + latitude: -19.015438, + longitudeDelta: 10.0, + name: 'Zimbabwe', + longitude: 29.154857, + latitudeDelta: 10.0, + }, ]; diff --git a/example/examples/Callouts.js b/example/examples/Callouts.js index 0034a30d3..46b219142 100644 --- a/example/examples/Callouts.js +++ b/example/examples/Callouts.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -10,11 +10,11 @@ var { Image, } = ReactNative; -var MapView = require('react-native-maps'); -var PriceMarker = require('./PriceMarker'); -var CustomCallout = require('./CustomCallout'); +let MapView = require('react-native-maps'); +const PriceMarker = require('./PriceMarker'); +let CustomCallout = require('./CustomCallout'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; @@ -23,7 +23,7 @@ const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; const SPACE = 0.01; -var Callouts = React.createClass({ +const Callouts = React.createClass({ getInitialState() { return { region: { @@ -115,7 +115,7 @@ var Callouts = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/CustomCallout.js b/example/examples/CustomCallout.js index 080d715b6..05edd66b1 100644 --- a/example/examples/CustomCallout.js +++ b/example/examples/CustomCallout.js @@ -1,12 +1,12 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, View, Text, } = ReactNative; -var CustomCallout = React.createClass({ +const CustomCallout = React.createClass({ render() { return ( @@ -22,7 +22,7 @@ var CustomCallout = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { flexDirection: 'column', alignSelf: 'flex-start', @@ -40,8 +40,8 @@ var styles = StyleSheet.create({ }, dollar: { - //color: '#FFFFFF', - //fontSize: 10, + // color: '#FFFFFF', + // fontSize: 10, }, amount: { flex: 1, diff --git a/example/examples/DefaultMarkers.js b/example/examples/DefaultMarkers.js index b4c978d5a..da64fb5b0 100644 --- a/example/examples/DefaultMarkers.js +++ b/example/examples/DefaultMarkers.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -9,9 +9,9 @@ var { TouchableOpacity, } = ReactNative; -var MapView = require('react-native-maps'); +let MapView = require('react-native-maps'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; @@ -21,10 +21,10 @@ const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; let id = 0; function randomColor() { - return '#'+Math.floor(Math.random()*16777215).toString(16); + return '#' + Math.floor(Math.random() * 16777215).toString(16); } -var DefaultMarkers = React.createClass({ +const DefaultMarkers = React.createClass({ getInitialState() { return { region: { @@ -76,7 +76,7 @@ var DefaultMarkers = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/DisplayLatLng.js b/example/examples/DisplayLatLng.js index 8d8d70d8e..c7960e12d 100644 --- a/example/examples/DisplayLatLng.js +++ b/example/examples/DisplayLatLng.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -9,9 +9,9 @@ var { TouchableOpacity, } = ReactNative; -var MapView = require('react-native-maps'); +let MapView = require('react-native-maps'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; @@ -19,7 +19,7 @@ const LONGITUDE = -122.4324; const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; -var DisplayLatLng = React.createClass({ +const DisplayLatLng = React.createClass({ getInitialState() { return { region: { @@ -44,7 +44,7 @@ var DisplayLatLng = React.createClass({ }, randomRegion() { - var { region } = this.state; + const { region } = this.state; return { ...this.state.region, latitude: region.latitude + (Math.random() - 0.5) * region.latitudeDelta / 2, @@ -64,7 +64,7 @@ var DisplayLatLng = React.createClass({ > - + {`${this.state.region.latitude.toPrecision(7)}, ${this.state.region.longitude.toPrecision(7)}`} @@ -81,7 +81,7 @@ var DisplayLatLng = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/DraggableMarkers.js b/example/examples/DraggableMarkers.js index ad888a837..88db4c3b8 100644 --- a/example/examples/DraggableMarkers.js +++ b/example/examples/DraggableMarkers.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -10,10 +10,10 @@ var { Image, } = ReactNative; -var MapView = require('react-native-maps'); -var PriceMarker = require('./PriceMarker'); +let MapView = require('react-native-maps'); +let PriceMarker = require('./PriceMarker'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; @@ -22,7 +22,7 @@ const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; const SPACE = 0.01; -var MarkerTypes = React.createClass({ +const MarkerTypes = React.createClass({ getInitialState() { return { a: { @@ -33,7 +33,7 @@ var MarkerTypes = React.createClass({ latitude: LATITUDE - SPACE, longitude: LONGITUDE - SPACE, }, - } + }; }, render() { return ( @@ -74,7 +74,7 @@ var MarkerTypes = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/EventListener.js b/example/examples/EventListener.js index 1515ee80f..9ca37bcf0 100644 --- a/example/examples/EventListener.js +++ b/example/examples/EventListener.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -10,24 +10,24 @@ var { ScrollView, } = ReactNative; -var MapView = require('react-native-maps'); -var PriceMarker = require('./PriceMarker'); +let MapView = require('react-native-maps'); +let PriceMarker = require('./PriceMarker'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; const LONGITUDE = -122.4324; const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; -var id = 0; +let id = 0; -var Event = React.createClass({ +let Event = React.createClass({ shouldComponentUpdate(nextProps) { return this.props.event.id !== nextProps.event.id; }, render() { - var { event } = this.props; + const { event } = this.props; return ( {event.name} @@ -37,7 +37,7 @@ var Event = React.createClass({ }, }); -var DisplayLatLng = React.createClass({ +const DisplayLatLng = React.createClass({ getInitialState() { return { region: { @@ -53,14 +53,14 @@ var DisplayLatLng = React.createClass({ makeEvent(e, name) { return { id: id++, - name: name, + name, data: e.nativeEvent ? e.nativeEvent : e, }; }, recordEvent(name) { return e => { - var { events } = this.state; + const { events } = this.state; this.setState({ events: [ this.makeEvent(e, name), @@ -115,7 +115,7 @@ var DisplayLatLng = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/FitToSuppliedMarkers.js b/example/examples/FitToSuppliedMarkers.js index bc5b86706..d72ebb907 100644 --- a/example/examples/FitToSuppliedMarkers.js +++ b/example/examples/FitToSuppliedMarkers.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -10,10 +10,10 @@ var { Image, } = ReactNative; -var MapView = require('react-native-maps'); -var PriceMarker = require('./PriceMarker'); +let MapView = require('react-native-maps'); +const PriceMarker = require('./PriceMarker'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; @@ -22,11 +22,11 @@ const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; const SPACE = 0.01; -var markerIDs = ['Marker1', 'Marker2', 'Marker3', 'Marker4', 'Marker5']; -var timeout = 4000; -var animationTimeout; +const markerIDs = ['Marker1', 'Marker2', 'Marker3', 'Marker4', 'Marker5']; +const timeout = 4000; +let animationTimeout; -var FocusOnMarkers = React.createClass({ +const FocusOnMarkers = React.createClass({ getInitialState() { return { a: { @@ -49,17 +49,17 @@ var FocusOnMarkers = React.createClass({ latitude: LATITUDE - (SPACE * 4), longitude: LONGITUDE - (SPACE * 4), }, - } + }; }, focusMap(markers, animated) { - console.log("Markers received to populate map: " + markers); + console.log('Markers received to populate map: ' + markers); this.refs.map.fitToSuppliedMarkers(markers, animated); }, focus1() { animationTimeout = setTimeout(() => { this.focusMap([ markerIDs[1], - markerIDs[4] + markerIDs[4], ], true); this.focus2(); @@ -69,17 +69,17 @@ var FocusOnMarkers = React.createClass({ animationTimeout = setTimeout(() => { this.focusMap([ markerIDs[2], - markerIDs[3] + markerIDs[3], ], false); - this.focus3() + this.focus3(); }, timeout); }, focus3() { animationTimeout = setTimeout(() => { this.focusMap([ markerIDs[1], - markerIDs[2] + markerIDs[2], ], false); this.focus4(); @@ -89,16 +89,16 @@ var FocusOnMarkers = React.createClass({ animationTimeout = setTimeout(() => { this.focusMap([ markerIDs[0], - markerIDs[3] + markerIDs[3], ], true); this.focus1(); - }, timeout) + }, timeout); }, componentDidMount() { animationTimeout = setTimeout(() => { this.focus1(); - }, timeout) + }, timeout); }, componentWillUnmount() { if (animationTimeout) { @@ -144,7 +144,7 @@ var FocusOnMarkers = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/LoadingMap.js b/example/examples/LoadingMap.js index 22bdc2b23..1cb4c6ef4 100644 --- a/example/examples/LoadingMap.js +++ b/example/examples/LoadingMap.js @@ -1,15 +1,15 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { Text, View, Dimensions, StyleSheet, } = ReactNative; -var MapView = require('react-native-maps'); +let MapView = require('react-native-maps'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; @@ -18,7 +18,7 @@ const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; const SPACE = 0.01; -var LoadingMap = React.createClass({ +const LoadingMap = React.createClass({ getInitialState() { return { region: { @@ -37,7 +37,7 @@ var LoadingMap = React.createClass({ style={styles.map} initialRegion={this.state.region} onPress={this.onMapPress} - loadingEnabled={true} + loadingEnabled loadingIndicatorColor={"#666666"} loadingBackgroundColor={"#eeeeee"} > @@ -75,7 +75,7 @@ var LoadingMap = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/MarkerTypes.js b/example/examples/MarkerTypes.js index dbd6671c5..3d9f5b103 100644 --- a/example/examples/MarkerTypes.js +++ b/example/examples/MarkerTypes.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -10,10 +10,10 @@ var { Image, } = ReactNative; -var MapView = require('react-native-maps'); -var PriceMarker = require('./PriceMarker'); +let MapView = require('react-native-maps'); +const PriceMarker = require('./PriceMarker'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; @@ -22,7 +22,7 @@ const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; const SPACE = 0.01; -var MarkerTypes = React.createClass({ +const MarkerTypes = React.createClass({ render() { return ( @@ -35,7 +35,7 @@ var MarkerTypes = React.createClass({ latitudeDelta: LATITUDE_DELTA, longitudeDelta: LONGITUDE_DELTA, }} - > + > + /> ); }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, @@ -83,7 +83,7 @@ var styles = StyleSheet.create({ marginLeft: 33, marginTop: 18, fontWeight: 'bold', - } + }, }); module.exports = MarkerTypes; diff --git a/example/examples/Overlays.js b/example/examples/Overlays.js index 590007250..67cc13550 100644 --- a/example/examples/Overlays.js +++ b/example/examples/Overlays.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -10,9 +10,9 @@ var { Image, } = ReactNative; -var MapView = require('react-native-maps'); +let MapView = require('react-native-maps'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; @@ -21,7 +21,7 @@ const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; const SPACE = 0.01; -var Overlays = React.createClass({ +const Overlays = React.createClass({ getInitialState() { return { region: { @@ -109,7 +109,7 @@ var Overlays = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/PanController.js b/example/examples/PanController.js index a5338fa74..a490110c8 100644 --- a/example/examples/PanController.js +++ b/example/examples/PanController.js @@ -1,77 +1,77 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +const { PropTypes, } = React; -var { +let { View, Animated, PanResponder, } = ReactNative; -var ModePropType = PropTypes.oneOf(["decay", "snap", "spring-origin"]); -var OvershootPropType = PropTypes.oneOf(["spring", "clamp"]); -var AnimatedPropType = PropTypes.any; +const ModePropType = PropTypes.oneOf(['decay', 'snap', 'spring-origin']); +const OvershootPropType = PropTypes.oneOf(['spring', 'clamp']); +const AnimatedPropType = PropTypes.any; -var PanController = React.createClass({ +const PanController = React.createClass({ - propTypes: { + propTypes: { // Component Config - lockDirection: PropTypes.bool, - horizontal: PropTypes.bool, - vertical: PropTypes.bool, - overshootX: OvershootPropType, - overshootY: OvershootPropType, - xBounds: PropTypes.arrayOf(PropTypes.number), - yBounds: PropTypes.arrayOf(PropTypes.number), - xMode: ModePropType, - yMode: ModePropType, - snapSpacingX: PropTypes.number, // TODO: also allow an array of values? - snapSpacingY: PropTypes.number, + lockDirection: PropTypes.bool, + horizontal: PropTypes.bool, + vertical: PropTypes.bool, + overshootX: OvershootPropType, + overshootY: OvershootPropType, + xBounds: PropTypes.arrayOf(PropTypes.number), + yBounds: PropTypes.arrayOf(PropTypes.number), + xMode: ModePropType, + yMode: ModePropType, + snapSpacingX: PropTypes.number, // TODO: also allow an array of values? + snapSpacingY: PropTypes.number, // Animated Values - panX: AnimatedPropType, - panY: AnimatedPropType, + panX: AnimatedPropType, + panY: AnimatedPropType, // Animation Config - overshootSpringConfig: PropTypes.any, - momentumDecayConfig: PropTypes.any, - springOriginConfig: PropTypes.any, - directionLockDistance: PropTypes.number, - overshootReductionFactor: PropTypes.number, + overshootSpringConfig: PropTypes.any, + momentumDecayConfig: PropTypes.any, + springOriginConfig: PropTypes.any, + directionLockDistance: PropTypes.number, + overshootReductionFactor: PropTypes.number, // Events - onOvershoot: PropTypes.func, - onDirectionChange: PropTypes.func, - onReleaseX: PropTypes.func, - onReleaseY: PropTypes.func, - onRelease: PropTypes.func, + onOvershoot: PropTypes.func, + onDirectionChange: PropTypes.func, + onReleaseX: PropTypes.func, + onReleaseY: PropTypes.func, + onRelease: PropTypes.func, //...PanResponderPropTypes, - }, - - getDefaultProps() { - return { - horizontal: false, - vertical: false, - lockDirection: true, - overshootX: "spring", - overshootY: "spring", - panX: new Animated.Value(0), - panY: new Animated.Value(0), - xBounds: [-Infinity, Infinity], - yBounds: [-Infinity, Infinity], - yMode: "decay", - xMode: "decay", - overshootSpringConfig: { friction: 7, tension: 40 }, - momentumDecayConfig: { deceleration: 0.993 }, - springOriginConfig: { friction: 7, tension: 40 }, - overshootReductionFactor: 3, - directionLockDistance: 10, - onStartShouldSetPanResponder: () => true, - onMoveShouldSetPanResponder: () => true, - }; - }, + }, + + getDefaultProps() { + return { + horizontal: false, + vertical: false, + lockDirection: true, + overshootX: 'spring', + overshootY: 'spring', + panX: new Animated.Value(0), + panY: new Animated.Value(0), + xBounds: [-Infinity, Infinity], + yBounds: [-Infinity, Infinity], + yMode: 'decay', + xMode: 'decay', + overshootSpringConfig: { friction: 7, tension: 40 }, + momentumDecayConfig: { deceleration: 0.993 }, + springOriginConfig: { friction: 7, tension: 40 }, + overshootReductionFactor: 3, + directionLockDistance: 10, + onStartShouldSetPanResponder: () => true, + onMoveShouldSetPanResponder: () => true, + }; + }, // getInitialState() { // //TODO: @@ -86,28 +86,28 @@ var PanController = React.createClass({ // }; // }, - _responder: null, - _listener: null, - _direction: null, - - componentWillMount() { - this._responder = PanResponder.create({ - onStartShouldSetPanResponder: this.props.onStartShouldSetPanResponder, - onMoveShouldSetPanResponder: this.props.onMoveShouldSetPanResponder, - onPanResponderGrant: (...args) => { - if (this.props.onPanResponderGrant) { - this.props.onPanResponderGrant(...args); - } - var { panX, panY, horizontal, vertical, xMode, yMode } = this.props; + _responder: null, + _listener: null, + _direction: null, + + componentWillMount() { + this._responder = PanResponder.create({ + onStartShouldSetPanResponder: this.props.onStartShouldSetPanResponder, + onMoveShouldSetPanResponder: this.props.onMoveShouldSetPanResponder, + onPanResponderGrant: (...args) => { + if (this.props.onPanResponderGrant) { + this.props.onPanResponderGrant(...args); + } + let { panX, panY, horizontal, vertical, xMode, yMode } = this.props; - this.handleResponderGrant(panX, xMode); - this.handleResponderGrant(panY, yMode); + this.handleResponderGrant(panX, xMode); + this.handleResponderGrant(panY, yMode); - this._direction = horizontal && !vertical ? 'x' : (vertical && !horizontal ? 'y' : null); - }, + this._direction = horizontal && !vertical ? 'x' : (vertical && !horizontal ? 'y' : null); + }, - onPanResponderMove: (_, { dx, dy, x0, y0 }) => { - var { + onPanResponderMove: (_, { dx, dy, x0, y0 }) => { + let { panX, panY, xBounds, @@ -120,38 +120,38 @@ var PanController = React.createClass({ directionLockDistance, } = this.props; - if (!this._direction) { - var dx2 = dx * dx; - var dy2 = dy * dy; - if (dx2 + dy2 > directionLockDistance) { - this._direction = dx2 > dy2 ? 'x' : 'y'; - if (this.props.onDirectionChange) { - this.props.onDirectionChange(this._direction, { dx, dy, x0, y0 }); - } + if (!this._direction) { + const dx2 = dx * dx; + const dy2 = dy * dy; + if (dx2 + dy2 > directionLockDistance) { + this._direction = dx2 > dy2 ? 'x' : 'y'; + if (this.props.onDirectionChange) { + this.props.onDirectionChange(this._direction, { dx, dy, x0, y0 }); } } + } - var dir = this._direction; + const dir = this._direction; - if (this.props.onPanResponderMove) { - this.props.onPanResponderMove(_, { dx, dy, x0, y0 }); - } + if (this.props.onPanResponderMove) { + this.props.onPanResponderMove(_, { dx, dy, x0, y0 }); + } - if (horizontal && (!lockDirection || dir === 'x')) { - var [xMin, xMax] = xBounds; + if (horizontal && (!lockDirection || dir === 'x')) { + let [xMin, xMax] = xBounds; - this.handleResponderMove(panX, dx, xMin, xMax, overshootX); - } + this.handleResponderMove(panX, dx, xMin, xMax, overshootX); + } - if (vertical && (!lockDirection || dir === 'y')) { - var [yMin, yMax] = yBounds; + if (vertical && (!lockDirection || dir === 'y')) { + let [yMin, yMax] = yBounds; - this.handleResponderMove(panY, dy, yMin, yMax, overshootY); - } - }, + this.handleResponderMove(panY, dy, yMin, yMax, overshootY); + } + }, - onPanResponderRelease: (_, { vx, vy, dx, dy }) => { - var { + onPanResponderRelease: (_, { vx, vy, dx, dy }) => { + let { panX, panY, xBounds, @@ -167,265 +167,264 @@ var PanController = React.createClass({ snapSpacingY, } = this.props; - var cancel = false; + let cancel = false; - var dir = this._direction; + const dir = this._direction; - if (this.props.onRelease) { - cancel = false === this.props.onRelease({ vx, vy, dx, dy }); - } + if (this.props.onRelease) { + cancel = false === this.props.onRelease({ vx, vy, dx, dy }); + } - if (!cancel && horizontal && (!lockDirection || dir === 'x')) { - var [xMin, xMax] = xBounds; - if (this.props.onReleaseX) { - cancel = false === this.props.onReleaseX({ vx, vy, dx, dy }); - } - !cancel && this.handleResponderRelease(panX, xMin, xMax, vx, overshootX, xMode, snapSpacingX); + if (!cancel && horizontal && (!lockDirection || dir === 'x')) { + let [xMin, xMax] = xBounds; + if (this.props.onReleaseX) { + cancel = false === this.props.onReleaseX({ vx, vy, dx, dy }); } + !cancel && this.handleResponderRelease(panX, xMin, xMax, vx, overshootX, xMode, snapSpacingX); + } - if (!cancel && vertical && (!lockDirection || dir === 'y')) { - var [yMin, yMax] = yBounds; - if (this.props.onReleaseY) { - cancel = false === this.props.onReleaseY({ vx, vy, dx, dy }); - } - !cancel && this.handleResponderRelease(panY, yMin, yMax, vy, overshootY, yMode, snapSpacingY); + if (!cancel && vertical && (!lockDirection || dir === 'y')) { + let [yMin, yMax] = yBounds; + if (this.props.onReleaseY) { + cancel = false === this.props.onReleaseY({ vx, vy, dx, dy }); } - - this._direction = horizontal && !vertical ? 'x' : (vertical && !horizontal ? 'y' : null); + !cancel && this.handleResponderRelease(panY, yMin, yMax, vy, overshootY, yMode, snapSpacingY); } - }); - }, - handleResponderMove(anim, delta, min, max, overshoot) { - var val = anim._offset + delta; + this._direction = horizontal && !vertical ? 'x' : (vertical && !horizontal ? 'y' : null); + }, + }); + }, + + handleResponderMove(anim, delta, min, max, overshoot) { + let val = anim._offset + delta; + + if (val > max) { + switch (overshoot) { + case 'spring': + val = max + (val - max) / this.props.overshootReductionFactor; + break; + case 'clamp': + val = max; + break; + } + } + if (val < min) { + switch (overshoot) { + case 'spring': + val = min - (min - val) / this.props.overshootReductionFactor; + break; + case 'clamp': + val = min; + break; + } + } + val = val - anim._offset; + anim.setValue(val); + }, - if (val > max) { - switch (overshoot) { - case "spring": - val = max + (val - max) / this.props.overshootReductionFactor; - break; - case "clamp": - val = max; - break; - } + handleResponderRelease(anim, min, max, velocity, overshoot, mode, snapSpacing) { + anim.flattenOffset(); + + + if (anim._value < min) { + if (this.props.onOvershoot) { + this.props.onOvershoot(); // TODO: what args should we pass to this } - if (val < min) { - switch (overshoot) { - case "spring": - val = min - (min - val) / this.props.overshootReductionFactor; - break; - case "clamp": - val = min; - break; - } + switch (overshoot) { + case 'spring': + Animated.spring(anim, { + ...this.props.overshootSpringConfig, + toValue: min, + velocity, + }).start(); + break; + case 'clamp': + anim.setValue(min); + break; } - val = val - anim._offset; - anim.setValue(val); - }, + } else if (anim._value > max) { + if (this.props.onOvershoot) { + this.props.onOvershoot(); // TODO: what args should we pass to this + } + switch (overshoot) { + case 'spring': + Animated.spring(anim, { + ...this.props.overshootSpringConfig, + toValue: max, + velocity, + }).start(); + break; + case 'clamp': + anim.setValue(min); + break; + } + } else { + switch (mode) { + case 'snap': + this.handleSnappedScroll(anim, min, max, velocity, snapSpacing, overshoot); + break; + + case 'decay': + this.handleMomentumScroll(anim, min, max, velocity, overshoot); + break; + + case 'spring-origin': + Animated.spring(anim, { + ...this.props.springOriginConfig, + toValue: 0, + velocity, + }).start(); + break; + } + } + }, - handleResponderRelease(anim, min, max, velocity, overshoot, mode, snapSpacing) { - anim.flattenOffset(); + handleResponderGrant(anim, mode) { + switch (mode) { + case 'spring-origin': + anim.setValue(0); + break; + case 'snap': + case 'decay': + anim.setOffset(anim._value + anim._offset); + anim.setValue(0); + break; + } + }, + handleMomentumScroll(anim, min, max, velocity, overshoot) { + Animated.decay(anim, { + ...this.props.momentumDecayConfig, + velocity, + }).start(() => { + anim.removeListener(this._listener); + }); - if (anim._value < min) { + this._listener = anim.addListener(({ value }) => { + if (value < min) { + anim.removeListener(this._listener); if (this.props.onOvershoot) { - this.props.onOvershoot(); //TODO: what args should we pass to this + this.props.onOvershoot(); // TODO: what args should we pass to this } switch (overshoot) { - case "spring": + case 'spring': Animated.spring(anim, { - ...this.props.overshootSpringConfig, + ...this.props.overshootSpringConfig, toValue: min, - velocity, - }).start(); - break; - case "clamp": - anim.setValue(min); - break; + velocity, + }).start(); + break; + case 'clamp': + anim.setValue(min); + break; + } + } else if (value > max) { + anim.removeListener(this._listener); + if (this.props.onOvershoot) { + this.props.onOvershoot(); // TODO: what args should we pass to this + } + switch (overshoot) { + case 'spring': + Animated.spring(anim, { + ...this.props.overshootSpringConfig, + toValue: max, + velocity, + }).start(); + break; + case 'clamp': + anim.setValue(min); + break; + } } - } else if (anim._value > max) { - if (this.props.onOvershoot) { - this.props.onOvershoot(); //TODO: what args should we pass to this - } - switch (overshoot) { - case "spring": - Animated.spring(anim, { - ...this.props.overshootSpringConfig, - toValue: max, - velocity, - }).start(); - break; -case "clamp": - anim.setValue(min); - break; -} -} else { - - switch (mode) { - case "snap": - this.handleSnappedScroll(anim, min, max, velocity, snapSpacing, overshoot); - break; - - case "decay": - this.handleMomentumScroll(anim, min, max, velocity, overshoot); - break; - - case "spring-origin": - Animated.spring(anim, { - ...this.props.springOriginConfig, - toValue: 0, - velocity, - }).start(); - break; -} -} -}, - -handleResponderGrant(anim, mode) { - switch (mode) { - case "spring-origin": - anim.setValue(0); - break; - case "snap": - case "decay": - anim.setOffset(anim._value + anim._offset); - anim.setValue(0); - break; - } -}, - -handleMomentumScroll(anim, min, max, velocity, overshoot) { - Animated.decay(anim, { - ...this.props.momentumDecayConfig, - velocity, -}).start(() => { - anim.removeListener(this._listener); -}); - -this._listener = anim.addListener(({ value }) => { - if (value < min) { - anim.removeListener(this._listener); - if (this.props.onOvershoot) { - this.props.onOvershoot(); //TODO: what args should we pass to this - } - switch (overshoot) { - case "spring": + }); + }, + + handleSnappedScroll(anim, min, max, velocity, spacing) { + let endX = this.momentumCenter(anim._value, velocity, spacing); + endX = Math.max(endX, min); + endX = Math.min(endX, max); + const bounds = [endX - spacing / 2, endX + spacing / 2]; + const endV = this.velocityAtBounds(anim._value, velocity, bounds); + + this._listener = anim.addListener(({ value }) => { + if (value > bounds[0] && value < bounds[1]) { Animated.spring(anim, { - ...this.props.overshootSpringConfig, - toValue: min, - velocity, - }).start(); - break; - case "clamp": - anim.setValue(min); - break; - } -} else if (value > max) { - anim.removeListener(this._listener); - if (this.props.onOvershoot) { - this.props.onOvershoot(); //TODO: what args should we pass to this - } - switch (overshoot) { - case "spring": - Animated.spring(anim, { - ...this.props.overshootSpringConfig, - toValue: max, - velocity, - }).start(); - break; -case "clamp": - anim.setValue(min); - break; -} -} -}); -}, - -handleSnappedScroll(anim, min, max, velocity, spacing) { - var endX = this.momentumCenter(anim._value, velocity, spacing); - endX = Math.max(endX, min); - endX = Math.min(endX, max); - var bounds = [endX-spacing/2, endX+spacing/2]; - var endV = this.velocityAtBounds(anim._value, velocity, bounds); - - this._listener = anim.addListener(( { value } ) => { - if (value > bounds[0] && value < bounds[1]) { - Animated.spring(anim, { - toValue: endX, - velocity: endV, - }).start(); - } - }); + toValue: endX, + velocity: endV, + }).start(); + } + }); - Animated.decay(anim, { + Animated.decay(anim, { ...this.props.momentumDecayConfig, - velocity, -}).start(()=> { - anim.removeListener(this._listener); -}); -}, - -closestCenter(x, spacing) { - var plus = (x % spacing) < spacing / 2 ? 0 : spacing; - return Math.round(x / spacing) * spacing + plus; -}, - -momentumCenter(x0, vx, spacing) { - var t = 0; - var deceleration = this.props.momentumDecayConfig.deceleration || 0.997; - var x1 = x0; - var x = x1; - - while (true) { - t += 16; - x = x0 + (vx / (1 - deceleration)) * + velocity, + }).start(() => { + anim.removeListener(this._listener); + }); + }, + + closestCenter(x, spacing) { + const plus = (x % spacing) < spacing / 2 ? 0 : spacing; + return Math.round(x / spacing) * spacing + plus; + }, + + momentumCenter(x0, vx, spacing) { + let t = 0; + const deceleration = this.props.momentumDecayConfig.deceleration || 0.997; + let x1 = x0; + let x = x1; + + while (true) { + t += 16; + x = x0 + (vx / (1 - deceleration)) * (1 - Math.exp(-(1 - deceleration) * t)); - if (Math.abs(x-x1) < 0.1) { + if (Math.abs(x - x1) < 0.1) { + x1 = x; + break; + } x1 = x; - break; } - x1 = x; - } - return this.closestCenter(x1, spacing); -}, - -velocityAtBounds(x0, vx, bounds) { - var t = 0; - var deceleration = this.props.momentumDecayConfig.deceleration || 0.997; - var x1 = x0; - var x = x1; - var vf; - while (true) { - t += 16; - x = x0 + (vx / (1 - deceleration)) * + return this.closestCenter(x1, spacing); + }, + + velocityAtBounds(x0, vx, bounds) { + let t = 0; + const deceleration = this.props.momentumDecayConfig.deceleration || 0.997; + let x1 = x0; + let x = x1; + let vf; + while (true) { + t += 16; + x = x0 + (vx / (1 - deceleration)) * (1 - Math.exp(-(1 - deceleration) * t)); - vf = (x-x1) / 16; - if (x > bounds[0] && x < bounds[1]) { - break; - } - if (Math.abs(vf) < 0.1) { - break; + vf = (x - x1) / 16; + if (x > bounds[0] && x < bounds[1]) { + break; + } + if (Math.abs(vf) < 0.1) { + break; + } + x1 = x; } - x1 = x; - } - return vf; -}, + return vf; + }, -//componentDidMount() { +// componentDidMount() { // //TODO: we may need to measure the children width/height here? -//}, +// }, // -//componentWillUnmount() { +// componentWillUnmount() { // -//}, +// }, // -//componentDidUnmount() { +// componentDidUnmount() { // -//}, +// }, -render: function () { - return -}, + render() { + return ; + }, }); module.exports = PanController; diff --git a/example/examples/PolygonCreator.js b/example/examples/PolygonCreator.js index bd5585f35..3b0654efc 100644 --- a/example/examples/PolygonCreator.js +++ b/example/examples/PolygonCreator.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -9,19 +9,19 @@ var { TouchableOpacity, } = ReactNative; -var MapView = require('react-native-maps'); -var PriceMarker = require('./PriceMarker'); +let MapView = require('react-native-maps'); +const PriceMarker = require('./PriceMarker'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; const LONGITUDE = -122.4324; const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; -var id = 0; +let id = 0; -var DisplayLatLng = React.createClass({ +const DisplayLatLng = React.createClass({ getInitialState() { return { region: { @@ -36,7 +36,7 @@ var DisplayLatLng = React.createClass({ }, finish() { - var { polygons, editing } = this.state; + let { polygons, editing } = this.state; this.setState({ polygons: [...polygons, editing], editing: null, @@ -44,7 +44,7 @@ var DisplayLatLng = React.createClass({ }, onPress(e) { - var { editing } = this.state; + const { editing } = this.state; if (!editing) { this.setState({ editing: { @@ -66,13 +66,13 @@ var DisplayLatLng = React.createClass({ }, render() { - var mapOptions = { + const mapOptions = { scrollEnabled: true, }; if (this.state.editing) { mapOptions.scrollEnabled = false; - mapOptions.onPanDrag = this.onPress; + mapOptions.onPanDrag = this.onPress; } return ( @@ -113,7 +113,7 @@ var DisplayLatLng = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/PolylineCreator.js b/example/examples/PolylineCreator.js index 02642f144..c48bdf76c 100644 --- a/example/examples/PolylineCreator.js +++ b/example/examples/PolylineCreator.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -9,19 +9,19 @@ var { TouchableOpacity, } = ReactNative; -var MapView = require('react-native-maps'); -var PriceMarker = require('./PriceMarker'); +let MapView = require('react-native-maps'); +const PriceMarker = require('./PriceMarker'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; const LONGITUDE = -122.4324; const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; -var id = 0; +let id = 0; -var PolylineCreator = React.createClass({ +const PolylineCreator = React.createClass({ getInitialState() { return { region: { @@ -36,7 +36,7 @@ var PolylineCreator = React.createClass({ }, finish() { - var { polygons, editing } = this.state; + let { polygons, editing } = this.state; this.setState({ polygons: [...polygons, editing], editing: null, @@ -44,7 +44,7 @@ var PolylineCreator = React.createClass({ }, onPanDrag(e) { - var { editing } = this.state; + const { editing } = this.state; if (!editing) { this.setState({ editing: { @@ -105,7 +105,7 @@ var PolylineCreator = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/PriceMarker.js b/example/examples/PriceMarker.js index df1ceda15..55c0f3ffc 100644 --- a/example/examples/PriceMarker.js +++ b/example/examples/PriceMarker.js @@ -1,12 +1,12 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, View, Text, } = ReactNative; -var PriceMarker = React.createClass({ +const PriceMarker = React.createClass({ getDefaultProps() { return { fontSize: 13, @@ -26,7 +26,7 @@ var PriceMarker = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { flexDirection: 'column', alignSelf: 'flex-start', diff --git a/example/examples/TakeSnapshot.js b/example/examples/TakeSnapshot.js index 3a749a62c..dd610ca2f 100644 --- a/example/examples/TakeSnapshot.js +++ b/example/examples/TakeSnapshot.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -10,10 +10,10 @@ var { Image, } = ReactNative; -var MapView = require('react-native-maps'); -var PriceMarker = require('./PriceMarker'); +let MapView = require('react-native-maps'); +const PriceMarker = require('./PriceMarker'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; @@ -22,9 +22,9 @@ const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; const SPACE = 0.01; -var MarkerTypes = React.createClass({ +const MarkerTypes = React.createClass({ getInitialState() { - return { mapSnapshot: null } + return { mapSnapshot: null }; }, takeSnapshot() { @@ -32,10 +32,10 @@ var MarkerTypes = React.createClass({ latitude: LATITUDE - SPACE, longitude: LONGITUDE - SPACE, latitudeDelta: 0.01, - longitudeDelta: 0.01 * ASPECT_RATIO + longitudeDelta: 0.01 * ASPECT_RATIO, }, (err, data) => { - if (err) console.log(err) - this.setState({ mapSnapshot: data }) + if (err) console.log(err); + this.setState({ mapSnapshot: data }); }); }, @@ -51,7 +51,7 @@ var MarkerTypes = React.createClass({ latitudeDelta: LATITUDE_DELTA, longitudeDelta: LONGITUDE_DELTA, }} - > + > + /> + /> @@ -80,11 +80,12 @@ var MarkerTypes = React.createClass({ {this.state.mapSnapshot ? this.setState({ mapSnapshot: null })}> + onPress={() => this.setState({ mapSnapshot: null })} + > + /> : null} @@ -92,7 +93,7 @@ var MarkerTypes = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, @@ -129,7 +130,7 @@ var styles = StyleSheet.create({ overlay: { backgroundColor: 'rgba(0,0,0,0.5)', justifyContent: 'center', - } + }, }); module.exports = MarkerTypes; diff --git a/example/examples/ViewsAsMarkers.js b/example/examples/ViewsAsMarkers.js index 3dfdc7ac5..00188c809 100644 --- a/example/examples/ViewsAsMarkers.js +++ b/example/examples/ViewsAsMarkers.js @@ -1,6 +1,6 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { StyleSheet, PropTypes, View, @@ -9,10 +9,10 @@ var { TouchableOpacity, } = ReactNative; -var MapView = require('react-native-maps'); -var PriceMarker = require('./PriceMarker'); +let MapView = require('react-native-maps'); +let PriceMarker = require('./PriceMarker'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; const LATITUDE = 37.78825; @@ -20,7 +20,7 @@ const LONGITUDE = -122.4324; const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = LATITUDE_DELTA * ASPECT_RATIO; -var DisplayLatLng = React.createClass({ +const DisplayLatLng = React.createClass({ getInitialState() { return { region: { @@ -69,7 +69,7 @@ var DisplayLatLng = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ container: { position: 'absolute', top: 0, diff --git a/example/examples/finalindexfile.js b/example/examples/finalindexfile.js index ffa045044..05f9c9010 100644 --- a/example/examples/finalindexfile.js +++ b/example/examples/finalindexfile.js @@ -4,9 +4,9 @@ */ 'use strict'; -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +let { AppRegistry, StyleSheet, Text, @@ -15,10 +15,10 @@ var { Animated, TouchableOpacity, } = ReactNative; -var MapView = require('react-native-maps'); -var PriceMarker = require('./components/PriceMarker'); +let MapView = require('react-native-maps'); +let PriceMarker = require('./components/PriceMarker'); -var { width, height } = Dimensions.get('window'); +let { width, height } = Dimensions.get('window'); const LATITUDE = 37.78825; const LONGITUDE = -122.4324; @@ -29,7 +29,7 @@ const LNGD = LONGITUDE + 77.03659; const LATITUDE_DELTA = 0.0922; const LONGITUDE_DELTA = 0.1218; -var MapViewTest = React.createClass({ +const MapViewTest = React.createClass({ getInitialState() { const scale = new Animated.Value(1); const latitudeDelta = scale.interpolate({ @@ -46,8 +46,8 @@ var MapViewTest = React.createClass({ region: new Animated.Region({ latitude: LATITUDE, longitude: LONGITUDE, - latitudeDelta: latitudeDelta, - longitudeDelta: longitudeDelta, + latitudeDelta, + longitudeDelta, }), markers: [], coord: { @@ -58,13 +58,13 @@ var MapViewTest = React.createClass({ }, onRegionChange(region) { - //console.log("onRegionChange", region); + // console.log("onRegionChange", region); this.state.region.setValue(region); - //this.setState({ region }); + // this.setState({ region }); }, onAnimate() { - var { val } = this.state; + const { val } = this.state; Animated.sequence([ Animated.timing(val, { toValue: 0, duration: 500 }), Animated.timing(val, { toValue: 1, duration: 500 }), @@ -72,11 +72,11 @@ var MapViewTest = React.createClass({ }, onAddMarker() { - var coordinate = { + const coordinate = { latitude: LATITUDE + LATITUDE_DELTA * (Math.random() - 0.5), longitude: LONGITUDE + LONGITUDE_DELTA * (Math.random() - 0.5), }; - var markers = [...this.state.markers, coordinate]; + let markers = [...this.state.markers, coordinate]; if (markers.length > 5) { markers = markers.slice(1); } @@ -84,8 +84,8 @@ var MapViewTest = React.createClass({ }, onAnimateZoom() { - var { scale, region } = this.state; - var toValue = scale.__getValue() > 1 ? 1 : 2; + let { scale, region } = this.state; + const toValue = scale.__getValue() > 1 ? 1 : 2; Animated.parallel([ Animated.spring(region.latitude, { toValue: LATITUDE + LATITUDE_DELTA * (Math.random() - 0.5), @@ -105,7 +105,7 @@ var MapViewTest = React.createClass({ latitude: LATITUDE + LATITUDE_DELTA * (Math.random() - 0.5), longitude: LONGITUDE + LONGITUDE_DELTA * (Math.random() - 0.5), }, - }) + }); }, onAnimateMapRegion() { @@ -122,7 +122,6 @@ var MapViewTest = React.createClass({ }, render() { - return ( console.log("Map::onRegionChangeComplete", e.nativeEvent)} - onPress={(e) => console.log("Map::onPress", e.nativeEvent)} - onPanDrag={(e) => console.log("Map::onPanDrag", e.nativeEvent)} - onLongPress={(e) => console.log("Map::onLongPress", e.nativeEvent)} - onMarkerPress={(e) => console.log("Map::onMarkerPress", e.nativeEvent)} - onMarkerSelect={(e) => console.log("Map::onMarkerSelect", e.nativeEvent)} - onMarkerDeselect={(e) => console.log("Map::onMarkerDeselect", e.nativeEvent)} - onCalloutPress={(e) => console.log("Map::onCalloutPress", e.nativeEvent)} - onMapPress={(e) => console.log("Map::onMapPress", e.nativeEvent)} - > + onRegionChangeComplete={(e) => console.log('Map::onRegionChangeComplete', e.nativeEvent)} + onPress={(e) => console.log('Map::onPress', e.nativeEvent)} + onPanDrag={(e) => console.log('Map::onPanDrag', e.nativeEvent)} + onLongPress={(e) => console.log('Map::onLongPress', e.nativeEvent)} + onMarkerPress={(e) => console.log('Map::onMarkerPress', e.nativeEvent)} + onMarkerSelect={(e) => console.log('Map::onMarkerSelect', e.nativeEvent)} + onMarkerDeselect={(e) => console.log('Map::onMarkerDeselect', e.nativeEvent)} + onCalloutPress={(e) => console.log('Map::onCalloutPress', e.nativeEvent)} + onMapPress={(e) => console.log('Map::onMapPress', e.nativeEvent)} + > + /> + /> + /> console.log("Marker::onPress", e.nativeEvent)} - onCalloutPress={(e) => console.log("Marker::onCalloutPress", e.nativeEvent)} - > + onPress={(e) => console.log('Marker::onPress', e.nativeEvent)} + onCalloutPress={(e) => console.log('Marker::onCalloutPress', e.nativeEvent)} + > console.log("Callout::onPress", e.nativeEvent)} - > + onPress={(e) => console.log('Callout::onPress', e.nativeEvent)} + > Well hello there... @@ -192,14 +191,14 @@ var MapViewTest = React.createClass({ console.log("Marker::onPress", e.nativeEvent)} - onCalloutPress={(e) => console.log("Marker::onCalloutPress", e.nativeEvent)} - > + onPress={(e) => console.log('Marker::onPress', e.nativeEvent)} + onCalloutPress={(e) => console.log('Marker::onCalloutPress', e.nativeEvent)} + > console.log("Callout::onPress", e.nativeEvent)} - > + onPress={(e) => console.log('Callout::onPress', e.nativeEvent)} + > Well hello there... @@ -242,7 +241,7 @@ var MapViewTest = React.createClass({ }, }); -var styles = StyleSheet.create({ +let styles = StyleSheet.create({ map: { height: 350, margin: 10, @@ -279,13 +278,13 @@ var styles = StyleSheet.create({ backgroundColor: 'blue', }, callout: { - //flex: 0, - //flexDirection: 'column', - //position: 'absolute', - //flex: 0, - //backgroundColor: '#fff', - //width: 100, - //height: 100, + // flex: 0, + // flexDirection: 'column', + // position: 'absolute', + // flex: 0, + // backgroundColor: '#fff', + // width: 100, + // height: 100, }, }); diff --git a/example/index.android.js b/example/index.android.js index 7a347e3a6..d3cb8508d 100644 --- a/example/index.android.js +++ b/example/index.android.js @@ -1,14 +1,14 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +const { AppRegistry, } = ReactNative; -var App = require('./App'); +let App = require('./App'); -var AirMapsExplorer = React.createClass({ +const AirMapsExplorer = React.createClass({ render() { - return + return ; }, }); diff --git a/example/index.ios.js b/example/index.ios.js index 7a347e3a6..d3cb8508d 100644 --- a/example/index.ios.js +++ b/example/index.ios.js @@ -1,14 +1,14 @@ -var React = require('react'); -var ReactNative = require('react-native'); -var { +let React = require('react'); +const ReactNative = require('react-native'); +const { AppRegistry, } = ReactNative; -var App = require('./App'); +let App = require('./App'); -var AirMapsExplorer = React.createClass({ +const AirMapsExplorer = React.createClass({ render() { - return + return ; }, }); diff --git a/index.js b/index.js index ab0e84b48..50d803692 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,3 @@ -var MapView = require('./components/MapView'); +const MapView = require('./components/MapView'); module.exports = MapView; diff --git a/package.json b/package.json index 00a4591f2..4f13c1cc2 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "author": "Leland Richardson ", "version": "0.7.1", "scripts": { - "start": "react-native start" + "start": "react-native start", + "lint": "eslint ." }, "repository": { "type": "git", @@ -25,8 +26,13 @@ "react-native": ">=0.30.0" }, "devDependencies": { - "react": "15.2.0", - "react-native": "^0.29.2" + "babel-eslint": "^6.1.2", + "eslint": "^3.3.1", + "eslint-config-airbnb": "^10.0.1", + "eslint-plugin-import": "^1.14.0", + "eslint-plugin-jsx-a11y": "^2.1.0", + "eslint-plugin-prefer-object-spread": "^1.1.0", + "eslint-plugin-react": "^6.1.2" }, "rnpm": { "android": {