How to use the react-native-config.MAPBOX_STYLE_URL function in react-native-config

To help you get started, we’ve selected a few react-native-config examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github developmentseed / observe / app / screens / Explore.js View on Github external
getCurrentTraceLength,
  getCurrentTraceStatus,
  getTracesGeojson,
  getPhotosGeojson
} from '../selectors'
import BasemapModal from '../components/BasemapModal'
import ActionButton from '../components/ActionButton'
import Icon from '../components/Collecticons'
import { colors } from '../style/variables'
import { CameraButton } from '../components/CameraButton'
import { RecordButton } from '../components/RecordButton'

import icons from '../assets/icons'
import { authorize } from '../services/auth'

let osmStyleURL = Config.MAPBOX_STYLE_URL || MapboxGL.StyleURL.Street
let satelliteStyleURL = Config.MAPBOX_SATELLITE_STYLE_URL || MapboxGL.StyleURL.Satellite

// fix asset URLs for Android
if (!osmStyleURL.includes(':/') && Platform.OS === 'android') {
  osmStyleURL = `asset://${osmStyleURL}`
}

if (!satelliteStyleURL.includes(':/') && Platform.OS === 'android') {
  satelliteStyleURL = `asset://${satelliteStyleURL}`
}

const Container = styled.View`
  flex: 1;
  display: flex;
  flex-flow: column nowrap;
`
github developmentseed / observe / app / screens / Traces / TraceDetailScreen.js View on Github external
import PageWrapper from '../../components/PageWrapper'
import { DescriptionInputField } from '../../components/Input'
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
import _find from 'lodash.find'
import ConfirmDialog from '../../components/ConfirmDialog'
import { NavigationEvents } from 'react-navigation'
import { getTraceLength, getTraceBounds } from '../../utils/traces'
import formatDate from '../../utils/format-date'
import { colors } from '../../style/variables'
import { editTrace } from '../../actions/traces'
import MapboxGL from '@react-native-mapbox-gl/maps'
import Config from 'react-native-config'
import style from '../../style/map'
import { Platform } from 'react-native'

let osmStyleURL = Config.MAPBOX_STYLE_URL || MapboxGL.StyleURL.Street

// fix asset URLs for Android
if (!osmStyleURL.includes(':/') && Platform.OS === 'android') {
  osmStyleURL = `asset://${osmStyleURL}`
}

const DescriptionView = styled.View`
  padding-top: 10;
`

const DescriptionTitle = styled.Text`
  font-weight: bold;
`
const Text = styled.Text`
  padding-top: 5
`
github developmentseed / observe / app / screens / OfflineMaps / ViewOfflineAreaDetail.js View on Github external
import EditMapModal from '../../components/EditMapModal'
import PageWrapper from '../../components/PageWrapper'
import {
  deleteOfflineResource,
  refreshOfflineResource,
  renameOfflineResource
} from '../../actions/map'
import { getOfflineResourceStatus } from '../../selectors'

const Text = styled.Text`
`
const Bold = styled.Text`
  font-weight: bold;
`

let osmStyleURL = Config.MAPBOX_STYLE_URL || MapboxGL.StyleURL.Street

// fix asset URLs
if (!osmStyleURL.includes(':/')) {
  osmStyleURL = `asset://${osmStyleURL}`
}

class ViewOfflineAreaDetail extends React.Component {
  static navigationOptions = ({ navigation }) => {
    return {
      title: 'Area'
    }
  }

  state = {
    deleteModalVisible: false,
    editModalVisible: false,
github developmentseed / observe / app / services / offline-tiles.js View on Github external
import { Platform } from 'react-native'
import MapboxGL from '@react-native-mapbox-gl/maps'
import Config from 'react-native-config'

let styleURL = Config.MAPBOX_STYLE_URL || MapboxGL.StyleURL.Street

if (!styleURL.includes(':/') && Platform.OS === 'android') {
  styleURL = `asset:/${styleURL}`
}

export default {}
/*
* Wrapper functions to simplify working with the MapboxGL offline manager
*/

/**
* Create pack of offline tiles
*
* @param {object} options - options object
* @param {string} options.name - name for the pack
* @param {array} options.bounds - bounds for the pack in the form `[[neLng, neLat], [swLng, swLat]]`