forked from assaf/zombie
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added element offset properties. Google Maps demand these.
- Loading branch information
Showing
8 changed files
with
175 additions
and
2 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
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
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
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,41 @@ | ||
{ Vows, assert, brains, Browser } = require("./helpers") | ||
|
||
|
||
Vows.describe("Google map").addBatch | ||
|
||
"display": | ||
topic: -> | ||
brains.get "/browser/map", (req, res)-> | ||
res.send """ | ||
<html> | ||
<head> | ||
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?v=3&sensor=false&callback=initialize"></script> | ||
<script type="text/javascript"> | ||
window.initialize = function() { | ||
window.map = new google.maps.Map(document.getElementById("map"), { | ||
center: new google.maps.LatLng(-34.397, 150.644), | ||
zoom: 8, | ||
mapTypeId: google.maps.MapTypeId.ROADMAP | ||
}); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<div id="map"></div> | ||
</body> | ||
</html> | ||
""" | ||
|
||
brains.ready => | ||
browser = new Browser | ||
browser.visit "http://localhost:3003/browser/map" | ||
browser.wait @callback | ||
"should load map": (browser)-> | ||
assert.ok browser.window.map | ||
"should set bounds": (browser)-> | ||
bounds = browser.window.map.getBounds() | ||
assert.ok bounds, "No map bounds yet" | ||
assert.equal bounds.toString(), "((-34.62332513513795, 150.369341796875), (-34.17006113241608, 150.918658203125))" | ||
|
||
|
||
.export(module) |
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
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,40 @@ | ||
GET /maps/api/js?v=3&sensor=false&callback=initialize | ||
user-agent: Mozilla/5.0 Chrome/10.0.613.0 Safari/534.15 Zombie.js/0.12.11 | ||
host: maps.googleapis.com | ||
|
||
200 HTTP/1.1 | ||
content-type: text/javascript; charset=UTF-8 | ||
date: Tue, 17 Jan 2012 06:20:31 GMT | ||
expires: Tue, 17 Jan 2012 06:50:31 GMT | ||
cache-control: public, max-age=1800 | ||
vary: Accept-Language | ||
server: mafe | ||
x-xss-protection: 1; mode=block | ||
x-frame-options: SAMEORIGIN | ||
transfer-encoding: chunked | ||
|
||
|
||
|
||
window.google = window.google || {}; | ||
google.maps = google.maps || {}; | ||
(function() { | ||
|
||
function getScript(src) { | ||
var s = document.createElement('script'); | ||
|
||
s.src = src; | ||
document.body.appendChild(s); | ||
} | ||
|
||
var modules = google.maps.modules = {}; | ||
google.maps.__gjsload__ = function(name, text) { | ||
modules[name] = text; | ||
}; | ||
|
||
google.maps.Load = function(apiLoad) { | ||
delete google.maps.Load; | ||
apiLoad([null,[[["http://mt0.googleapis.com/vt?lyrs=m@169000000\u0026src=api\u0026hl=en-US\u0026","http://mt1.googleapis.com/vt?lyrs=m@169000000\u0026src=api\u0026hl=en-US\u0026"],null,null,null,null,"m@169000000"],[["http://khm0.googleapis.com/kh?v=102\u0026hl=en-US\u0026","http://khm1.googleapis.com/kh?v=102\u0026hl=en-US\u0026"],null,null,null,1,"102"],[["http://mt0.googleapis.com/vt?lyrs=h@169000000\u0026src=api\u0026hl=en-US\u0026","http://mt1.googleapis.com/vt?lyrs=h@169000000\u0026src=api\u0026hl=en-US\u0026"],null,null,"imgtp=png32\u0026",null,"h@169000000"],[["http://mt0.googleapis.com/vt?lyrs=t@128,r@169000000\u0026src=api\u0026hl=en-US\u0026","http://mt1.googleapis.com/vt?lyrs=t@128,r@169000000\u0026src=api\u0026hl=en-US\u0026"],null,null,null,null,"t@128,r@169000000"],null,[[null,0,7,7,[[[330000000,1246050000],[386200000,1293600000]],[[366500000,1297000000],[386200000,1320034790]]],["http://mt0.gmaptiles.co.kr/mt?v=kr1.15\u0026hl=en-US\u0026","http://mt1.gmaptiles.co.kr/mt?v=kr1.15\u0026hl=en-US\u0026"]],[null,0,8,8,[[[330000000,1246050000],[386200000,1279600000]],[[345000000,1279600000],[386200000,1286700000]],[[354690000,1286700000],[386200000,1320035000]]],["http://mt0.gmaptiles.co.kr/mt?v=kr1.15\u0026hl=en-US\u0026","http://mt1.gmaptiles.co.kr/mt?v=kr1.15\u0026hl=en-US\u0026"]],[null,0,9,9,[[[330000000,1246050000],[386200000,1279600000]],[[340000000,1279600000],[386200000,1286700000]],[[348900000,1286700000],[386200000,1302000000]],[[368300000,1302000000],[386200000,1320035000]]],["http://mt0.gmaptiles.co.kr/mt?v=kr1.15\u0026hl=en-US\u0026","http://mt1.gmaptiles.co.kr/mt?v=kr1.15\u0026hl=en-US\u0026"]],[null,0,10,19,[[[329890840,1246055600],[386930130,1284960940]],[[344646740,1284960940],[386930130,1288476560]],[[350277470,1288476560],[386930130,1310531620]],[[370277730,1310531620],[386930130,1320034790]]],["http://mt0.gmaptiles.co.kr/mt?v=kr1.15\u0026hl=en-US\u0026","http://mt1.gmaptiles.co.kr/mt?v=kr1.15\u0026hl=en-US\u0026"]],[null,3,7,7,[[[330000000,1246050000],[386200000,1293600000]],[[366500000,1297000000],[386200000,1320034790]]],["http://mt0.gmaptiles.co.kr/mt?v=kr1p.12\u0026hl=en-US\u0026","http://mt1.gmaptiles.co.kr/mt?v=kr1p.12\u0026hl=en-US\u0026"]],[null,3,8,8,[[[330000000,1246050000],[386200000,1279600000]],[[345000000,1279600000],[386200000,1286700000]],[[354690000,1286700000],[386200000,1320035000]]],["http://mt0.gmaptiles.co.kr/mt?v=kr1p.12\u0026hl=en-US\u0026","http://mt1.gmaptiles.co.kr/mt?v=kr1p.12\u0026hl=en-US\u0026"]],[null,3,9,9,[[[330000000,1246050000],[386200000,1279600000]],[[340000000,1279600000],[386200000,1286700000]],[[348900000,1286700000],[386200000,1302000000]],[[368300000,1302000000],[386200000,1320035000]]],["http://mt0.gmaptiles.co.kr/mt?v=kr1p.12\u0026hl=en-US\u0026","http://mt1.gmaptiles.co.kr/mt?v=kr1p.12\u0026hl=en-US\u0026"]],[null,3,10,null,[[[329890840,1246055600],[386930130,1284960940]],[[344646740,1284960940],[386930130,1288476560]],[[350277470,1288476560],[386930130,1310531620]],[[370277730,1310531620],[386930130,1320034790]]],["http://mt0.gmaptiles.co.kr/mt?v=kr1p.12\u0026hl=en-US\u0026","http://mt1.gmaptiles.co.kr/mt?v=kr1p.12\u0026hl=en-US\u0026"]]],[["http://cbk0.googleapis.com/cbk?","http://cbk1.googleapis.com/cbk?"]],[["http://khmdb0.googleapis.com/kh?v=49\u0026hl=en-US\u0026","http://khmdb1.googleapis.com/kh?v=49\u0026hl=en-US\u0026"],null,null,null,null,"49"],[["http://mt0.googleapis.com/mapslt?hl=en-US\u0026","http://mt1.googleapis.com/mapslt?hl=en-US\u0026"]],[["http://mt0.googleapis.com/mapslt/ft?hl=en-US\u0026","http://mt1.googleapis.com/mapslt/ft?hl=en-US\u0026"]],[["http://mt0.googleapis.com/vt?hl=en-US\u0026","http://mt1.googleapis.com/vt?hl=en-US\u0026"]]],["en-US","US",null,0,null,null,"http://maps.gstatic.com/mapfiles/","http://csi.gstatic.com","https://maps.googleapis.com","http://maps.googleapis.com"],["http://maps.gstatic.com/intl/en_us/mapfiles/api-3/7/7","3.7.7"],[2795959736],1.0,null,null,null,null,0,"initialize",null,null,0,"http://khm.googleapis.com/mz?v=102\u0026"], loadScriptTime); | ||
}; | ||
var loadScriptTime = (new Date).getTime(); | ||
getScript("http://maps.gstatic.com/intl/en_us/mapfiles/api-3/7/7/main.js"); | ||
})(); |
Oops, something went wrong.