0.1.10 • Published 8 years ago
@twiz/geo v0.1.10
Twiz Geo
Point Class
Takes point with several possible formats:
- Object
latandlngpropertieslatandlongpropertieslatitudeandlongitudeproperties
- Array
- Normally ordered,
latitude, longitude - Inverted,
longitude, latitude
- Normally ordered,
- Browser Geolocation Object (with a
Positionconstructor) - An instance of the
Pointclass
(Note: If instantiated with an inverted array, it should be accompanied by the inverted: true property in the options object, or the boolean true)
It includes several useful getters:
coordinates: Outputs an object with coordinates in the{ latitude: ..., longitude: ... }format.array: An array of coordinates in the format[ [latitude], [longitude] ].arrayInverted: An array of coordinates in the format[ [longitude], [latitude] ].`
Path Class
Takes an array of at least two points. Any valid format to instantiate a Point is valid to instantiate a Path object.