geoposition-to-geojson
v1.0.1
Published
Turn an HTML5 Geoposition object into a GeoJSON Point
Downloads
15
Maintainers
Readme
geoposition-to-geojson
Turn an HTML5 Geoposition object into a GeoJSON Point.
Pairs well with geolocation-stream and mapbox.js.
See also geoposition-to-object.
Installation
npm install geoposition-to-geojson --save
Usage
var geojsonify = require('geoposition-to-geojson')
navigator.geolocation.getCurrentPosition(function(position) {
console.log(geojsonify(position))
})
{
type: "Feature",
geometry: {
type: "Point",
coordinates: [-104.8483681, 38.792024999999995]
},
properties: {
timestamp: "123",
accuracy: 26,
altitude: null,
altitudeAccuracy: null,
heading: null,
speed: null
}
}
Tests
npm install
npm test
Dependencies
None
Dev Dependencies
- tap-spec: Formatted TAP output like Mocha's spec reporter
- tape: tap-producing test harness for node and browsers
License
MIT
Generated by package-json-to-readme