This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
geobound-object with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
This package provides a constructor to create bound objects, specific for geographic usage. The style is similar to Leaflet's LatLngBound object, with much less functionality (and with arrays instead of LatLng elements returned). It can be used if you need to define unique bounds with variable input. This package is used as output format of osmtile2bound and as input format for bound2osmtile.
Use standard npm installation
npm install --save geobound-object
This package provides a constructor only. This constructor has to be called with the new statement. If invalid properties are passed, the constructor throws an error.
There are many different types of allowed inputs
// [north, east, south, west] new Bound([48.1354432, 11.6037082, 48.123412, 11.621389]); // output: Bound object
// [[north east], [south west]] new Bound([[48.1354432, 11.6037082], [48.123412, 11.621389]]); // output: Bound object
// [LatLng, LatLng] new Bound([L.latLng([48.1354432, 11.6037082]), L.latLng([48.123412, 11.621389])]); // output: Bound object
new Bound(new Bound([48.1354432, 11.6037082, 48.123412, 11.621389])); // output: Bound object
The returned bound object has several getter methods.
Feel free to add issues or pull requests. I'm glad for every kind of feedback!