Realtime Map

Example of tracking a single marker on a map with PubNub and Mapbox.

Embed

var pubnub = new PubNub({
  publishKey: 'demo',
  subscribeKey: 'demo'
});
eon.map({
  pubnub: pubnub,
  id: 'map',
  mbToken: 'YOUR_MAPBOX_TOKEN',
  mbId: 'YOUR_MAPBOX_ID',
  channels: ['eon-map']
});

Publish

var pubnub = new PubNub({
  publishKey: 'demo',
  subscribeKey: 'demo'
});
setInterval(function(){

  pubnub.publish({
    channel:  'eon-map',
    message:  
      [
        {"latlng":[31,-99]},
        {"latlng":[32,-100]},
        {"latlng":[33,-101]},
        {"latlng":[35,-102]}
      ]
  });

}, 1000);

Try PubNub Today

Try Our APIs
  • 1M Transactions
  • 1GB Data Persistence
  • All major Features