Permalink
Browse files

improved tile loading

  • Loading branch information...
1 parent 72b5396 commit fb7336e56f4b70725d8698a154a72398aa0452f2 @jrasky jrasky committed May 3, 2012
Showing with 10 additions and 4 deletions.
  1. +1 −0 .#TODO.txt
  2. +9 −4 geocamLayer/static/geocamLayer/static_tiles.js
View
@@ -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);
@@ -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();
@@ -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();

0 comments on commit fb7336e

Please sign in to comment.