Permalink
Browse files

Browser now registers with the server with its jabber id. New graphics.

  • Loading branch information...
1 parent 64dcba4 commit facf4c5d315b369e577c3737df784844c7e5ff53 @aaronpk committed Mar 6, 2011
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -47,7 +47,7 @@ $(function(){
create: function(phono, config, callback) {callback({}); return {};}
});
var myOptions = {
- zoom: 16,
+ zoom: 17,
center: new google.maps.LatLng(45.524164, -122.67881),
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false
@@ -65,13 +65,16 @@ $(function(){
$.ajax({
url: "/setup.json",
- dataType: 'jsonp',
+ dataType: 'json',
success: showPellets
});
updateScoreBoard();
setInterval(updateScoreBoard, 5000);
+ updateLocations();
+ setInterval(updateLocations, 5000);
+
function updateScoreBoard() {
$.ajax({
url: "/scores.json",
@@ -86,14 +89,27 @@ $(function(){
});
}
+ function updateLocations() {
+ // aaronpk o54E612
+ // caseorganic rivQX0e
+ var tokens = ["o54E612", "rivQX0e"];
+ $.ajax({
+ url: "https://api.geoloqi.com/1/share/last?geoloqi_token=" + tokens.join(","),
+ dataType: "jsonp",
+ success: function(data) {
+
+ }
+ });
+ }
+
function showPellets(data) {
$(data).each(function(i, pellet) {
pellets.push({
id: pellet.place_id,
marker: new google.maps.Marker({
position: new google.maps.LatLng(pellet.latitude, pellet.longitude),
map: map,
- icon: "http://i.imgur.com/4wEfc.gif"
+ icon: "http://loqi.me/pdx-pacmap/dot-sprite.png",
})
});
});
@@ -110,7 +126,10 @@ $(function(){
var phono = $.phono({
apiKey: "http://phono.com/",
onReady:function() {
- $('#xmpp_id').html(this.sessionId);
+ // $('#xmpp_id').html(this.sessionId);
+ $.post("/register.json", {
+ jabber_id: this.sessionId
+ });
},
messaging:{
onMessage: function(event){
@@ -119,6 +138,8 @@ $(function(){
var type = serverMessage.type;
//console.log(type);
+ // ({"type": "pellet", "id": "rrr"})
+
if(type == "player") {
var id = serverMessage.id;
var latitude = serverMessage.latitude;
@@ -166,11 +187,11 @@ $(function(){
<table width="900">
<tr>
<td width="600">
- <div id="map" style="width: 100%; height: 300px;"></div>
+ <div id="map" style="width: 100%; height: 500px;"></div>
</td>
<td valign="top">
- Leaderboard
+ <div style="margin-bottom: 5px;"><img src="/img/leaderboard-text.png" /></div>
<div id="scoreboard">

0 comments on commit facf4c5

Please sign in to comment.