Skip to content
Browse files

made changes to how zoom level is calculated

  • Loading branch information...
1 parent a27c0b3 commit 72b53962cc312e084ced75aaaa3c3d3ec9c02f69 @jrasky jrasky committed Apr 25, 2012
Showing with 10 additions and 6 deletions.
  1. +2 −2 TODO.txt
  2. +8 −4 geocamLayer/static/geocamLayer/static_tiles.js
View
4 TODO.txt
@@ -24,9 +24,9 @@ Done list
Bug List
-- We still have issues with tiling
+- tile loading is still tempremental
- Largest zoom level has problems
-- We need to handle cases in the javascript where the zoom level is past what exists (i.e. zoom 11)
+- points are not showing up consistently for some reason
- Maybe we need to load the next biggest zoom level
- Not loading correct tile on zoom change
- Clusters are still being weird
View
12 geocamLayer/static/geocamLayer/static_tiles.js
@@ -8,7 +8,7 @@ function initialize() {
window.currentZoom = null;
window.currentX = new Array();
window.currentY = new Array();
- //window.updating = false;
+ window.updating = false;
//window.concurent = false;
// Try W3C Geolocation (Preferred)
@@ -56,7 +56,8 @@ function initialize() {
//clearPoints();
}
-function boundsChanged() {
+function boundsChanged(start) {
+ if (typeof(map.getBounds()) == 'undefined') {return;}
bounds = map.getBounds();
south = bounds.getSouthWest().lat();
west = bounds.getSouthWest().lng();
@@ -65,7 +66,10 @@ function boundsChanged() {
size = Math.max(south-north, east-west);
zoom = Math.ceil(Math.log(360/size)/Math.log(2));
- if (isNaN(zoom)) zoom = 1;
+ if (isNaN(zoom)) zoom = 0;
+ zoom -= 1;
+ if (zoom < 0) zoom = 1
+ if (zoom > 9) zoom = 9;
tile_size = 360/Math.pow(2,zoom);
center = map.getCenter();
@@ -90,7 +94,7 @@ function boundsChanged() {
function loadTile(zoom,x,y) {
conn = new XMLHttpRequest();
- console.log("getting /staci/tiles/"+zoom+"/"+x+"/"+y+".json", true);
+ console.log("getting /static/tiles/"+zoom+"/"+x+"/"+y+".json", true);
conn.open("GET", "/static/tiles/"+zoom+"/"+x+"/"+y+".json", true);
conn.onreadystatechange = processTile;
conn.send(null);

0 comments on commit 72b5396

Please sign in to comment.
Something went wrong with that request. Please try again.