I'm new to web development. I am writing a javascript webapp and am unclear on the syntax to access GeoFirestore's calculateDistance utility function and get the error ReferenceError: calculateDistance is not defined. This function is located in the utils.ts TypeScript file, but somehow I'm not picking it up.
I've tried various syntaxes to call the "calculateDistance" function as well as trying various paths.
I thought pulling the full geofirestore.js library would be sufficient to pull in the utils functions.
Utils.ts documentation is here.
My index.html file snippet:
<script src="https://unpkg.com/geofirestore/dist/geofirestore.js"></script>
My Javascript module snippet:
let geopoint1 = new firebase.firestore.GeoPoint(40.123, -120.456)
let geopoint2 = new firebase.firestore.GeoPoint(-20.456, 100.123)
console.log("Distance: " + calculateDistance(geopoint1,geopoint2).toString() + " km")
I get the following error. "ReferenceError: calculateDistance is not defined"