Giter VIP home page Giter VIP logo

geomock's Introduction

##README

Geomock.js

The Geomock project is a little plaything that allows you to mock your location in the browser. Activating Geomock pops up a window with a Google Map. The blue bouncing icon represents your current position. Clicking anywhere else on the map produces a pink icon, which represents your mocked location.

Geomock overrides your browser's native getCurrentPosition() and watchPosition() calls with its own faked versions, so your code doesn't have to change.

The returned mock position object has the basic properties that you would expect from a successful return from the original functions, ie. stuff like latitude and longitude are present.

#How to use:

  1. Include geomock.js

    <script src="js/geomock.js"></script>

  2. Call geomock.go()

    <input type="button" onclick="javascript:geomock.go()" value="Geomock Go">

  3. Click somewhere on the map to select the location you want to appear to be at

  4. Your code should report you being at that location instead

##Note Geomock.js only affects calls to getCurrentPosition()/watchPosition() after geomock.go() has been called.

##TODO

  • How do we make it take effect on calls to watchPosition() that are already in progress?

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.