Git Product home page Git Product logo

leaflet.simplegraticule's People

Contributors

ablakey avatar der-stefan avatar jieter avatar jrfolk avatar timjennings avatar utahemre 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

Watchers

 avatar  avatar  avatar  avatar

leaflet.simplegraticule's Issues

Grid drawn outside of specified bounds.

Hi,

I've used your great plugin for a game map.

I've specifically set my bounds to 0,0 1000,1000 however the grid is drawn outside this.

Printing this._bounds to console shows that the bounds for the grid aren't being drawn from the original map

Labels poorly formatted on decimal intervals

First, congratulations for your first open source project. Your comment encouraged me to offer my feedback and help.
I use SimpleGraticule with these intervals:
zoomIntervals:[
{start:0,end:3,interval:20},
{start:4,end:5,interval:10},
{start:6,end:7,interval:5},
{start:8,end:10,interval:1},
{start:11,end:12,interval:0.5},
{start:13,end:18,interval:0.2},
]
When the interval goes below 1, the labels will, sometimes, appear like -4.00000000001 or -3.9999999998.
I've added this to the getMins funcion:
this.dec=0;
if (Math.floor(s)<s){
var sd=s;
while(Math.floor(sd)<sd){
this.dec++;
sd=s*Math.pow(10, this.dec);
}
}
And changed the way x and y values are calculated on the constructLines function to:
var x = Math.round((mins.x + i * this.options.interval) * Math.pow(10, this.dec)) / Math.pow(10, this.dec);

Maybe this is not the optimal way to do it, but it solved the problem. Hope this helps to improve your plugin.

Best,

Marcelo Gallacci

Possible bug with onRemove

I experienced strange buggy behavior when calling removeLayer on a SimpleGraticule layer, then inspected it and found something odd. I believe this.map was typed instead of this._map.

onRemove: function(map) {
  map.off('viewreset '+ this.options.redraw, this.map);
  this.eachLayer(this.removeLayer, this);
},

Notice that it's calling map.off, with the input this.map. I don't believe this.map exists, just this._map.

Would something like this make more sense?

onRemove: function(map) {
  var graticule = this;
  this._map.off('viewreset ' + this.options.redraw, graticule.redraw, graticule);
  this.eachLayer(this.removeLayer, this);
},

Add LICENSE

Hi there, I'd like to use your SimpleGraticule plugin, but I can't unless you attach a license to your project by putting a LICENSE file in your root directory.

If you don't have a strong opinion about what license to choose, you might consider using the one that Leaflet itself uses, the BSD 2-Clause (similar to MIT in that it's very simple and permissive):

https://github.com/Leaflet/Leaflet/blob/master/LICENSE

You'd just need to change the Copyright statements in the beginning to the appropriate name(s) and years.

Thank you for your consideration!

Cdn not working

While using on my recent project, I used the cdn

<script type="text/javascript" src="L.SimpleGraticule.js"></script>

given in the example.html file in this repository. But it is giving a 404 error

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.