GithubHelp home page GithubHelp logo

Comments (5)

simonw avatar simonw commented on June 26, 2024

I can replicate locally by downloading this DB: https://git-history-demos.datasette.io/ca-fires.db

from datasette-cluster-map.

simonw avatar simonw commented on June 26, 2024

After messing around with console.log() a bit I'm suspicious that this line isn't working correctly in this case:

map.fitBounds(markerClusterGroup.getBounds());

Bounds in question for that first page load are:

{
    "_southWest": {
        "lat": 32.578481,
        "lng": -1191414610
    },
    "_northEast": {
        "lat": 41.927772,
        "lng": -115.917099
    }
}

from datasette-cluster-map.

simonw avatar simonw commented on June 26, 2024

It's definitely a bounds issue. Here are bounds that DO work, copied from a page that displays correctly:

theMap.fitBounds([
  [41.86889,-116.9075],
  [32.75277778,-123.88658]
])

Running that on the empty map page that is meant to be showing 250 items zooms into California and makes the items visible.

from datasette-cluster-map.

simonw avatar simonw commented on June 26, 2024

Looking closer at the bad bounds example shows what's happening:

    "_southWest": {
        "lat": 32.578481,
        "lng": -1191414610
    },

That Longitude is missing its decimal point! So there's a corrupt record in this database which causes the map to fail to load.

from datasette-cluster-map.

simonw avatar simonw commented on June 26, 2024

One easy fix would be to not attempt to include a marker for any locations where the latitude or longitude are outside of normal -90 < latitude < 90 and -180 < longitude < 180 limits

from datasette-cluster-map.

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.