manuelbieh / geolib

Zero dependency library to provide some basic geo functions
MIT License
4.21k stars 341 forks source link

getDistance Undefined #275

Closed ginxx009 closed 3 years ago

ginxx009 commented 3 years ago
import {getDistance} from 'geolib';

const computedDistance = () => {
        console.log(computeDistance());
    }
const computeDistance = () => {
        getDistance(
            { latitude: 51.5103, longitude: 7.49347 },
            { latitude: "51° 31' N", longitude: "7° 28' E" }
        );
    }
 <TouchableOpacity onPress={() => computedDistance()} style={styles.AddDeliveryButton}>
         <Text>Add delivery details</Text>
</TouchableOpacity>

This gives me an undefined value . Why?

Cmoen11 commented 3 years ago

Same issue, did you solve this?

ginxx009 commented 3 years ago

I moved on and find a way using MapViewDirection . hahahaha