react-native-geojson icon indicating copy to clipboard operation
react-native-geojson copied to clipboard

console.error: "Raw text cannot be used outside of the <Text> tag. Not rendering strings: '/*'"

Open maikenmadsen92 opened this issue 6 years ago • 0 comments

I'm getting this error when trying to use the react-native-geojson så i'm doing something wrong. Here is my code:

import MapView from 'react-native-maps';
import Polyline from '@mapbox/polyline';
import Geojson from 'react-native-geojson';
import {
Marker
} from 'react-native-maps';

import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
View,
Button
} from 'react-native';

const alcatraz = {
type: 'FeatureCollection',
features: [
{
  type: 'Feature',
  properties: {},
  geometry: {
    type: 'Point',
    coordinates: [-122.42305755615234, 37.82687023785448],
  }
 }
 ]
 };
 export default class consults extends Component {

 static navigationOptions = {
 title: 'Kort over stier'
 };

 render () {
 const { navigate } = this.props.navigation;
 const { region } = this.props;
 console.log(region);




 return (
   <View style ={styles.container}>
    <MapView
      style={styles.map}
      region={{
        latitude: 55.0598,
        longitude: 10.6068,
        latitudeDelta: 0.40,
        longitudeDelta: 0.40,
      }}
    >

    <Geojson geojson={alcatraz} />

    </MapView>
    </View>
    )
    }

  }

  const styles = StyleSheet.create({
  container: {
  position: 'absolute',
  top: 0,
  left: 0,
  right: 0,
  bottom: 0,
  justifyContent: 'flex-end',
  alignItems: 'center',
  },
  map: {
  position: 'absolute',
  top: 0,
  left: 0,
  right: 0,
  bottom: 0,
  },

  });

Any ideas of what i'm doing wrong?

maikenmadsen92 avatar Mar 15 '18 20:03 maikenmadsen92