Realtime Map with Multiple Markers

Mapbox powered tracking of multiple markers on a single map.

Embed

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);
  }
});

Publish

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);

Try PubNub Today

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