mapbox / owlviewer

A changeset browser for https://github.com/ppawel/openstreetmap-watch-list
9 stars 10 forks source link

Duplicate requests are made for every tile #16

Closed ppawel closed 11 years ago

ppawel commented 11 years ago

It can clearly be seen on the summary tiles because they are semi-transparent and you can see that they are loaded twice.

I suggest we switch back to @glenrobertson's leaflet-tilelayer-geojson as it has more features planned (aborting requests, merging together the same features from different tiles).

I added logging to the _loadTile methods and below is what I got - there are two calls to _loadTile for each tile.

loading geojson tile Point(15466, 29445)
loading geojson tile Point(15466, 29444)
loading geojson tile Point(15465, 29445)
loading geojson tile Point(15467, 29445)
loading geojson tile Point(15466, 29446)
loading geojson tile Point(15465, 29444)
loading geojson tile Point(15467, 29444)
loading geojson tile Point(15465, 29446)
loading geojson tile Point(15467, 29446)
loading geojson tile Point(15464, 29445)
loading geojson tile Point(15468, 29445)
loading geojson tile Point(15464, 29444)
loading geojson tile Point(15468, 29444)
loading geojson tile Point(15464, 29446)
loading geojson tile Point(15468, 29446)
loading geojson tile Point(15463, 29445)
loading geojson tile Point(15469, 29445)
loading geojson tile Point(15463, 29444)
loading geojson tile Point(15469, 29444)
loading geojson tile Point(15463, 29446)
loading geojson tile Point(15469, 29446)
loading geojson tile Point(15466, 29445)
loading geojson tile Point(15466, 29444)
loading geojson tile Point(15465, 29445)
loading geojson tile Point(15467, 29445)
loading geojson tile Point(15466, 29446)
loading geojson tile Point(15465, 29444)
loading geojson tile Point(15467, 29444)
loading geojson tile Point(15465, 29446)
loading geojson tile Point(15467, 29446)
loading geojson tile Point(15464, 29445)
loading geojson tile Point(15468, 29445)
loading geojson tile Point(15464, 29444)
loading geojson tile Point(15468, 29444)
loading geojson tile Point(15464, 29446)
loading geojson tile Point(15468, 29446)
loading geojson tile Point(15463, 29445)
loading geojson tile Point(15469, 29445)
loading geojson tile Point(15463, 29444)
loading geojson tile Point(15469, 29444)
loading geojson tile Point(15463, 29446)
loading geojson tile Point(15469, 29446)```
lxbarth commented 11 years ago

I noticed this as well this weekend and I've got a fix that needs to be committed. I still need to run my version by @glenrobertson and see what his plans are. @glenrobertson's version has a bug with latest Leaflet stable that crashes the script, I don't just want to switch to it right now.

ppawel commented 11 years ago

That's OK, no rush but I really think we should join forces with @glenrobertson and develop one GeoJSON tile layer instead of working on our own in owlviewer. Also it would be good to have a generic "AJAX tile layer" with all the nice features like aborting requests, handling not visible tiles etc. because all this would be reusable for summary tiles.

lxbarth commented 11 years ago

I really think we should join forces with @glenrobertson

Absolutely agreed. It's on my hit list for today to get an issue up on https://github.com/glenrobertson/leaflet-tilelayer-geojson