Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
58 lines (58 sloc) 1.88 KB
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="local.js"></script>
<script src="api_key.js"></script>
<!-- custom script won't work live, for now -->
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script id="config" type="text/javascript">
var $parameters = {
urlname: "mashable",
_width: 520,
_height: 300,
_name: "Everywhere Map",
_description: "Shows Everywhere meetups on a simple Google map."
};
var $queries = {
events: function() {
return api_call("/ew/events", {status: "upcoming", urlname: $parameters.urlname});
}
};
</script>
<script>
with_jquery(function($) {
$(function() {
var map = new google.maps.Map(document.getElementById("map_canvas"), {
zoom: 2,
center: new google.maps.LatLng(0,0),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
$.getJSON($queries.events(), function(data) {
if (data.status && data.status.match(/^200/) == null) {
alert(data.status + ": " + data.details);
} else {
$.each(data.results, function(i, ev) {
var marker = new google.maps.Marker({
position: new google.maps.LatLng(ev.lat, ev.lon),
map: map,
});
google.maps.event.addListener(marker, 'click', function() {
var link = '<h3><a href="' + ev.meetup_url + '">' + ('title' in ev ? ev.title : ev.container.name) + '</a></h3>';
var city = '<p>' + ev.city + '</p>';
var win = new google.maps.InfoWindow({
content: link + city
});
win.open(map, marker);
});
});
}
});
});
});
</script>
</head>
<body>
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>