0.1.2 • Published 5 years ago
check-coord v0.1.2
check-coord 🌏 
Easy to use, coordinate format checking tool.
npm install check-coord
import checkCoord from "check-coord";
// Coordinate point
checkCoord("116.3978146455078,39.9076393154042");
// Coordinate line
checkCoord("116.3978146455078,39.9076393154042; 116.39652718518064,39.93344333054544");
// Coordinate region
checkCoord("116.3978146455078,39.9076393154042; 116.39652718518064,39.93344333054544; 116.41712655041502,39.93370658670286");
// Coordinate point
{
isTrue: true, // The coordinate are correct.
type: 'spot', // The coordinate type is 'point'.
// Coordinate array.
spots: [
{
lng: '116.3978146455078', // longitude
lat: '39.9076393154042' // latitude
}
]
}
// Coordinate line
{
isTrue: true,
type: 'line',
spots: [
{
lng: '116.3978146455078',
lat: '39.9076393154042'
},
{
lng: '116.39652718518064',
lat: '39.93344333054544'
}
]
}
// Coordinate region
{
isTrue: true,
type: 'region',
spots: [
{
lng: '116.3978146455078',
lat: '39.9076393154042'
},
{
lng: '116.39652718518064',
lat: '39.93344333054544'
},
{
lng: '116.41712655041502',
lat: '39.93370658670286'
}
],
regionSpot: 3 // Number of area points.
}