Created
November 1, 2011 21:08
-
-
Save albertsun/1331913 to your computer and use it in GitHub Desktop.
VectorTileMapType
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
VectorTileMapType implementing the Google Maps API V3 MapType Interface | |
http://code.google.com/apis/maps/documentation/javascript/maptypes.html#MapTypeInterface | |
Used for http://censusmapmaker.com/ | |
*/ | |
function VectorTileMapType() { | |
this.minZoom = 13; | |
this.maxZoom = 18; | |
} | |
VectorTileMapType.prototype = { | |
tileSize: new google.maps.Size(256, 256), | |
minZoom: 13, | |
maxZoom: 18, | |
getTile: function(coord, zoom, ownerDocument) { | |
//console.log([coord.x, coord.y, zoom]); | |
if ((zoom >= this.minZoom) && (zoom <= this.maxZoom)) { | |
//console.log("getting: "+[coord.x, coord.y, zoom]); | |
WSJNG.query.LoadCensusBlockTiles.LoadTile([coord.x, coord.y, zoom]); | |
} | |
return $("<div class='dummydiv'>"+[coord.x, coord.y, zoom].join("_")+"</div>")[0]; | |
}, | |
releaseTile: function(tileNode) { | |
//console.log("releasing: "+$(tileNode).text()); | |
WSJNG.query.LoadCensusBlockTiles.RemoveTile($(tileNode).text()); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment