-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid protype conflicts with other libs
- Loading branch information
1 parent
1aea245
commit 447fd56
Showing
6 changed files
with
110 additions
and
19 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,81 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset=utf-8 /> | ||
<title>EON Maps</title> | ||
<meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' /> | ||
<style> | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
} | ||
#map { | ||
position:absolute; | ||
top:0; | ||
bottom:0; | ||
width:100%; | ||
} | ||
</style> | ||
|
||
<script type="text/javascript" src="../bower_components/pubnub/web/pubnub.min.js"></script> | ||
<script type="text/javascript" src="../bower_components/subsub/subsub.js"></script> | ||
<script type="text/javascript" src="../lib/pubnub-mapbox.js"></script> | ||
<script type="text/javascript" src="../pubnub-mapbox.js"></script> | ||
|
||
<link type="text/css" rel="stylesheet" href="http://pubnub.github.io/eon/v/eon/0.0.10/eon.css"/> | ||
|
||
</head> | ||
<body> | ||
<div id='map'></div> | ||
<script> | ||
function getNonZeroRandomNumber(){ | ||
var random = Math.floor(Math.random()*199) - 99; | ||
if(random==0) return getNonZeroRandomNumber(); | ||
return random; | ||
} | ||
</script> | ||
<script> | ||
var channel = 'pubnub-mapbox' + getNonZeroRandomNumber(); | ||
|
||
eon.map({ | ||
id: 'map', | ||
mb_token: 'pk.eyJ1IjoiaWFuamVubmluZ3MiLCJhIjoiZExwb0p5WSJ9.XLi48h-NOyJOCJuu1-h-Jg', | ||
mb_id: 'ianjennings.l896mh2e', | ||
channel: channel, | ||
connect: connect, | ||
options: { | ||
zoomAnimation: false, | ||
}, | ||
}); | ||
|
||
function connect() { | ||
|
||
var point = { | ||
latlng: [37.370375, -97.756138] | ||
}; | ||
|
||
var pn = PUBNUB.init({ | ||
publish_key: 'demo' | ||
}); | ||
|
||
setInterval(function(){ | ||
|
||
var new_point = JSON.parse(JSON.stringify(point)); | ||
|
||
new_point.latlng = [ | ||
new_point.latlng[0] + (getNonZeroRandomNumber() * 0.1), | ||
new_point.latlng[1] + (getNonZeroRandomNumber() * 0.2) | ||
]; | ||
|
||
pn.publish({ | ||
channel: channel, | ||
message: [new_point] | ||
}); | ||
|
||
}, 1000); | ||
|
||
}; | ||
|
||
</script> | ||
</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
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