Code Monkey home page Code Monkey logo

console-log-geojson's Introduction

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.

labsapplicantmaps

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.

console-log-geojson's People

Contributors

chriswhong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.