console-log-geojson
Hijacks console.log()
and checks for valid geoJSON. If it exists, prints a simple summary and a link to inspect/edit the geojson in geojson.io.
MAJOR LIMITATION console-log-geojson builds its geojson links by urlencoding the stringified geojson and passing it to geojson.io as a url parameter. This will not work with large geojson. I'd love your suggestions on how to get around this (geojsonio-cli uses github gists, but I don't think that will work without auth)
Message me on twitter at @chris_whong if you have suggestions or want to contribute.
Installation
Clone this repo.
Include dist/console-log-geojson.js
in your project.
NOT WORKING YET - npm install console-log-geojson
For plain old script tags:
<script src="dist/console-log-geojson.min.js"></script>
To import into an ember app, add the following line to ember-cli-build.js
:
app.import('node_modules/console-log-geojson/dist/console-log-geojson.min.js');
Example
Build the code, and start the dev server
npm run build-dev
This should open http://localhost:10001/examples/index.html
in your browser. Open the javascript console and you'll see a few geoJSON objects logged, with accompanying summaries and geojson.io links.
Attribution
Based on console-hijack, which was a great example of both hijacking console
and using rollup
to do simple packaging of javascript files.