Giter VIP home page Giter VIP logo

Comments (11)

msgoloborodov avatar msgoloborodov commented on May 6, 2024

to fix it replace _createTileProto in heatmap-leaflet.js with:

_createTile: function () {
    var tile = L.DomUtil.create('div', 'leaflet-tile');

    var tileSize = this.options.tileSize;
    tile.style.width = tileSize+"px";
    tile.style.height = tileSize+"px";
    tile.width = tileSize;
    tile.height = tileSize;

    tile.onselectstart = tile.onmousemove = L.Util.falseFn;
    return tile;
},

from heatmap.js.

gamecubate avatar gamecubate commented on May 6, 2024

This works very nicely. Thanks! Sadly the seaming issue (#79) remains.

from heatmap.js.

nikolajpedersen avatar nikolajpedersen commented on May 6, 2024

Jup.. this works for me. Thanks.

But get some small "bug" when I reproduce the example from the heatmap js page.
Using leaflet 0.7.2

When zooming in/out then the previous heatmap images linger for a while before being removed.
They are on top of each other.. for a second or so.
Is it possible to flush it somehow? Force a cleanup?

It's not happening on the example page that is using older leaflet.

from heatmap.js.

dwa012 avatar dwa012 commented on May 6, 2024

@msgoloborodov trick made the heatmap finally render after a day of trying to figure out how to make it work.

I do have a problem with tiles not merging correctly. Any thoughts?
screen shot 2014-01-29 at 7 19 31 pm

from heatmap.js.

bozdoz avatar bozdoz commented on May 6, 2024

@dwa012 You probably don't have padding on the tiles. Each tile is rendering the points within it, but not the edges of the ones just outside it. That's a guess though. Looks like something I came across once or twice. Good luck.

from heatmap.js.

gamecubate avatar gamecubate commented on May 6, 2024

Seaming problem here too. All the time. I suspect this plugin renders itself too early, i.e., while map tiles are still being fetched.

from heatmap.js.

dwa012 avatar dwa012 commented on May 6, 2024

@bozdoz I am playing with the tile padding using the fix from @msgoloborodov

tile.style.padding = 10+"px";

I played with quite a few numbers. Not really fixing the seeming issue. Am I on the right track?

from heatmap.js.

bozdoz avatar bozdoz commented on May 6, 2024

Pretty sure it needs the same padding as the size of the points.

from heatmap.js.

dwa012 avatar dwa012 commented on May 6, 2024

That is the size of the blob being drawn? I am not a GIS guy and trying to get this to work for a project for a client.

Should this be in the _createTile function or in the _draw function?

from heatmap.js.

bozdoz avatar bozdoz commented on May 6, 2024

Padding should already exist on line 199. Do you have options.radius.absolute set to true, or false? That could help too.

from heatmap.js.

dwa012 avatar dwa012 commented on May 6, 2024

I have

var heatmapLayer = L.TileLayer.heatMap({
            // radius could be absolute or relative
            // absolute: radius in meters, relative: radius in pixels
            radius: { value: 1500   , absolute: true },
            //radius: { value: 20, absolute: false },
            visible: true,
            opacity: 0.8,
            gradient: {
                0.45: "rgb(0,0,255)",
                0.55: "rgb(0,255,255)",
                0.65: "rgb(0,255,0)",
                0.95: "yellow",
                1.0: "rgb(255,0,0)"
            }
        });

I was looking at that line, but was unsure of how to modify it in a way that makes sense.

from heatmap.js.

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.