Code Monkey home page Code Monkey logo

Comments (6)

webdobe avatar webdobe commented on August 12, 2024

I fixed by doing:

if (!data || Object.keys(data).length === 0) {
return { latlng: e.latlng, data: null };
}

Is this a good fix? Should I submit a patch?

from leaflet.utfgrid.

danzel avatar danzel commented on August 12, 2024

Sounds like it could be on the right track, would it be possible to upload an example?
I'm interested in seeing how you have this set up so you get an empty data object.

from leaflet.utfgrid.

dev-ndn-zz avatar dev-ndn-zz commented on August 12, 2024

I am just playing around with the plugin and had a problem at the same line. I have created my maps and exported .mbtiles-files with TileMill, and there I made the bounds small than a whole map. So this is why I got errors afterwards in the browser. The suggested code has stopped those errors for me.

from leaflet.utfgrid.

gamecubate avatar gamecubate commented on August 12, 2024

Ditto. Indeed, webdobe's code fixes all. Thanks webdobe.

from leaflet.utfgrid.

danzel avatar danzel commented on August 12, 2024

Can anyone please upload an example that causes the error so I can confirm and add the fix? thanks!

from leaflet.utfgrid.

danzel avatar danzel commented on August 12, 2024

Awesome, thanks.
Have pushed a new version with a fix, please test it out! :)

from leaflet.utfgrid.

Related Issues (20)

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.