Skip to content

Commit

Permalink
improved tile loading
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasky committed May 3, 2012
1 parent 72b5396 commit fb7336e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .#TODO.txt
13 changes: 9 additions & 4 deletions geocamLayer/static/geocamLayer/static_tiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ function initialize() {
map.setCenter(initialLocation);
}

boundsChanged();

// load a tile to test stuff out
//loadTile(0,0,0);
//loadTile(0,0,1);
Expand All @@ -73,8 +75,11 @@ function boundsChanged(start) {
tile_size = 360/Math.pow(2,zoom);

center = map.getCenter();
x = Math.floor((center.lng()-(-180))/tile_size)*2;
y = Math.floor((center.lat()-(-90))/tile_size)*2;
x = Math.floor((center.lng()-(-180))/(tile_size/2));
y = Math.floor((center.lat()-(-90))/(tile_size/2));

document.title="Static Tile HTML Test - Current Tile: "+zoom+"/"+x+"/"+y
console.log("Current Tile: "+zoom+"/"+x+"/"+y);

if (currentZoom != zoom) {
clearPoints();
Expand Down Expand Up @@ -102,8 +107,8 @@ function loadTile(zoom,x,y) {

function clearPoints() {
console.log("clearing points");
for (x=0;x<points.length;x++) {
points[x].setVisible(false);
for (p=0;p<points.length;p++) {
points[p].setVisible(false);
}
points = new Array();
bboxes = new Object();
Expand Down

0 comments on commit fb7336e

Please sign in to comment.