Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

249
Visualizações
The prop 'coordinate.longitude' is marked as required in 'MapMarker', but it's value is undefined

While I'm working on my graduation project, I had some issues with expo/react native mapView, and it gives me this error, So please can anyone help me ASAP.

Here is my code if you want to check :

import React, { Component } from "react";
import { View, I18nManager, StyleSheet, } from 'react-native';
import MapView, { Marker } from 'react-native-maps';



I18nManager.allowRTL(false);
export default class MyMapView extends Component {

    //default state
    constructor(props) {
        super(props);

        
        
    }
    

    render() {
      
        return (
            <View style={styles.container}>
              <MapView
                    style={styles.map}
                    region={{
                        //we have muliple locations so we pass them here
                        latitude: this.props.latitude,longitude: this.props.longitude,
                        latitudeDelta:this.props.latitudeDelta ,
                        longitudeDelta: this.props.longitudeDelta, 
                    }} 
                >

                    <Marker coordinate={{   latitude: this.props.latitude,longitude: this.props.longitude}} />
                </MapView>
            </View>
        );


    }
}
const styles = StyleSheet.create({
    container: {
        ...StyleSheet.absoluteFillObject
    },
    map: {
        ...StyleSheet.absoluteFillObject
    }
});

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I think you should add a condition to be sure that your props is not empty. Try something like this:

export default class MyMapView extends Component {

...     

    render() {
      
        return (
           { this.props && <View style={styles.container}>
              <MapView
                    style={styles.map}
                    region={{
                        //we have muliple locations so we pass them here
                        latitude: this.props.latitude,longitude: this.props.longitude,
                        latitudeDelta:this.props.latitudeDelta ,
                        longitudeDelta: this.props.longitudeDelta, 
                    }} 
                >

                    <Marker coordinate={{   latitude: this.props.latitude,longitude: this.props.longitude}} />
                </MapView>
            </View>
  }
           );


    }
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda