Giter VIP home page Giter VIP logo

leaflet-globeminimap's Introduction

Leaflet.GlobeMiniMap

Leaflet.GlobeMiniMap is a simple minimap control that places a 3d Globe in the corner of your map, centered on the same location as the main map.

cursor_and_3d_minimap_and_minimap_ bash 80x24_and_index_html _globe-minimap

Try the example out out now on github pages

Using the GlobeMiniMap control

Leaflet.GlobeMiniMap requires d3.js & topojson.js. You can load them from a CDN like this:

<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.19/topojson.min.js"></script>

The library is also looking for /data/world.json in order to load the world topojson file. You can use the option topojsonSrc to define another source.

Add the globe minimap with one line of code:

    var miniMap = new L.Control.GlobeMiniMap(options).addTo(map);

You can pass in an options object to define colors for the water, land and marker on the globe minimap:

{     
  land:'#FFFF00',
  water:'#3333FF',
  marker:'#000000',
  topojsonSrc: 'path/to/world.json'
}

The minimap is reactive, it only changes when the main map's center point changes. You can't interact with the mini map to move the main map.

Attribution

I saw this static 3d minimap and thought it would be a great plugin for leaflet. Static 3d Minimap

The globe is built with d3, and is based on World Tour an excellent block by Mike Bostock.

The code for the plugin was modified from Leaflet.MiniMap by Robert Nordon

The marker SVG on the minimap is from fontawesome via wikimedia.org

Issues

Please report issues on github. I am a noob at this plugin business, and am not sure if the /dist and build stuff is working properly, so advice and Pull Requests are welcome!

leaflet-globeminimap's People

Contributors

billiam avatar bryant1410 avatar haraldkj avatar jfirebaugh avatar kermit-the-frog avatar ktraff avatar kuuup avatar lokal-profil avatar lubberscorrado avatar moklick avatar robpvn avatar schepelin avatar stilist avatar ventralnet avatar webot avatar xguaita avatar yohanboniface avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leaflet-globeminimap's Issues

Add topojson to the main code

Right now the plugin does a d3.json ajax call to pull in world.json. Would it be simpler for those who want to use the plugin for it to just be written into the code like var world = JSON.parse({putthetopojsonrighthere})

I know it would be ugly, but would save a configuration step.

What's the best way to implement this so its out of the way?

d3 and topojson dependency

I didn't tested it yet, but I am sure it will not work with AMD or CommonJS, because you are not requiring d3 and topojson.

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.