forked from tcarobruce/django-gheat
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mobile template (testing iPhone performance)
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | ||
<title>"Tweetmap," a heatmap of tweet locations</title> | ||
<script src="http://maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> | ||
<script type="text/javascript"> | ||
var heatmap = new google.maps.ImageMapType({ | ||
getTileUrl: function(coord, zoom) { | ||
var tileRange = 1 << zoom; | ||
|
||
var y = coord.y; | ||
if (y < 0 || y >= tileRange) { | ||
return null; | ||
} | ||
var x = coord.x; | ||
if (x < 0 || x >= tileRange) { | ||
x = (x % tileRange + tileRange) % tileRange; | ||
} | ||
|
||
return "/tweetmap/tiles/firetrans/" + zoom + "/" + x + "," + y + ".png"; | ||
}, | ||
tileSize: new google.maps.Size(256, 256), | ||
isPng: true | ||
}); | ||
|
||
var map; | ||
function initialize() { | ||
map = new google.maps.Map(document.getElementById("map")); | ||
map.setCenter(new google.maps.LatLng(38.9517053, -92.3340724)); | ||
map.setZoom(4); | ||
map.setMapTypeId('terrain'); | ||
map.overlayMapTypes.insertAt(0, heatmap); | ||
} | ||
</script> | ||
<style type="text/css"> | ||
html, body, #map { | ||
margin: 0; | ||
padding: 0; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
<body onload="initialize()"> | ||
<div id="map"> </div> | ||
</body> | ||
</html> |
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