Mapbox powered tracking of multiple markers on a single map.
var pubnub = new PubNub({
publishKey: 'demo',
subscribeKey: 'demo'
});
var map = eon.map({
id: 'map',
mbId: 'YOUR_MAPBOX_ID',
mbToken: 'YOUR_MAPBOX_TOKEN',
channels: ['eon-map-multiple'],
pubnub: pubnub,
message: function (data) {
map.setView(data[3].latlng, 13);
}
});
var pubnub = new PubNub({
publishKey: 'demo',
subscribeKey: 'demo'
});
setInterval(function(){
pubnub.publish({
channel: 'eon-map-multiple',
message:
[
{"latlng":[31,-99]},
{"latlng":[32,-100]},
{"latlng":[33,-101]},
{"latlng":[35,-102]}
]
});
}, 1000);