{"id":13701344,"url":"https://github.com/pubnub/eon-map","last_synced_at":"2025-12-12T05:00:40.839Z","repository":{"id":27461960,"uuid":"30940981","full_name":"pubnub/eon-map","owner":"pubnub","description":"Realtime maps with PubNub and MapBox.","archived":false,"fork":false,"pushed_at":"2022-12-06T09:15:51.000Z","size":11524,"stargazers_count":136,"open_issues_count":17,"forks_count":51,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-09-28T22:24:49.730Z","etag":null,"topics":["eon","eon-map","google-maps","latlng","mapbox","maps","pubnub","realtime","realtime-messaging"],"latest_commit_sha":null,"homepage":"https://www.pubnub.com/developers/eon/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pubnub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-17T22:21:24.000Z","updated_at":"2024-10-07T12:59:50.000Z","dependencies_parsed_at":"2022-08-24T11:00:40.310Z","dependency_job_id":null,"html_url":"https://github.com/pubnub/eon-map","commit_stats":null,"previous_names":["pubnub/pubnub-mapbox"],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/pubnub/eon-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pubnub%2Feon-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pubnub%2Feon-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pubnub%2Feon-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pubnub%2Feon-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pubnub","download_url":"https://codeload.github.com/pubnub/eon-map/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pubnub%2Feon-map/sbom","scorecard":{"id":749121,"data":{"date":"2024-05-20","repo":{"name":"github.com/pubnub/eon-map","commit":"72aeffa8c234406292d3cecb9fa54f3c10c947b8"},"scorecard":{"version":"v5.0.0-rc2-23-g98ec491a","commit":"98ec491a888a8a0db9d83a3c7d379ae1f46321de"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#cii-best-practices"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license.md:0","Info: FSF or OSI recognized license: MIT License: license.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 1.2.2 not signed: https://api.github.com/repos/pubnub/eon-map/releases/43087715","Warn: release artifact 1.2.2 does not have provenance: https://api.github.com/repos/pubnub/eon-map/releases/43087715"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#branch-protection"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/98ec491a888a8a0db9d83a3c7d379ae1f46321de/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T19:44:04.300Z","repository_id":27461960,"created_at":"2025-08-22T19:44:04.300Z","updated_at":"2025-08-22T19:44:04.300Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018785,"owners_count":26086453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eon","eon-map","google-maps","latlng","mapbox","maps","pubnub","realtime","realtime-messaging"],"created_at":"2024-08-02T20:01:31.153Z","updated_at":"2025-10-14T10:48:57.260Z","avatar_url":"https://github.com/pubnub.png","language":"JavaScript","readme":"## Please note that this project is no longer actively maintained or accepting Pull Requests.  The EON library remains available on npm, bower, or through hotlink.\n\n--------------------------------\n\n# EON Maps\n\nReal-time location tracking powered by [PubNub](http://pubnub.com) and [MapBox](http://mapbox.com) or [Google Maps](https://developers.google.com/maps/).\n\n![](http://i.imgur.com/25Zg5YB.gif)\n\n# Examples\n\n* [One Marker](http://pubnub.com/developers/eon/map/index/)\n* [Multiple Markers + Follow Marker](http://pubnub.com/developers/eon/map/extra/)\n* [Custom Marker Image + Rotation](http://pubnub.com/developers/eon/map/flight/)\n* [Bus Tracking](http://pubnub.com/developers/eon/map/bus/)\n\n## Installing\n\n### Hotlink\n\n```html\n\u003cscript type=\"text/javascript\" src=\"https://pubnub.github.io/eon/v/eon/1.0.0/eon.js\"\u003e\u003c/script\u003e\n\u003clink type=\"text/css\" rel=\"stylesheet\" href=\"https://pubnub.github.io/eon/v/eon/1.0.0/eon.css\"/\u003e\n```\n\n### Bower\n\n```sh\nbower install eon-map --save\n```\n\nCheck out our [bower example](https://github.com/pubnub/eon-map/examples/bower.html).\n\n### NPM\n\n```sh\nnpm install eon-map --save\n```\n\nCheck out our [webpack example](https://github.com/pubnub/eon-map-webpack).\n\n## Quickstart\n\nCall ```eon.map({})```. Check out the table of options below for more information.\n\n```html\n\u003cdiv id='map'\u003e\u003c/div\u003e\n\u003cscript type=\"text/javascript\"\u003e\n\nvar channel = 'pubnub-mapbox';\n\nvar pn = new PubNub({\n  publishKey:   'YOUR_PUB_KEY', // replace with your own pub-key\n  subscribeKey: 'YOUR_SUB_KEY'  // replace with your own sub-key\n});\n\nvar map = eon.map({\n  pubnub: pn,\n  id: 'map',\n  mbToken: 'pk.eyJ1IjoiaWFuamVubmluZ3MiLCJhIjoiZExwb0p5WSJ9.XLi48h-NOyJOCJuu1-h-Jg',\n  mbId: 'ianjennings.l896mh2e',\n  channels: [channel]\n});\n\n\u003c/script\u003e\n```\n\n![](http://i.imgur.com/QtJ7E3d.gif)\n\n\n### Init\n\nParameter | Value | Default\n| :------------ |:---------------| -----:|\n| id | The ID of the element where the map will be rendered. | ```undefined```\n| channels | An array of PubNub channels to subscribe to. Either ```channels``` or ```channelGroups``` must be supplied. | ```false```\n| channelGroups | An array of PubNub channel groups to subscribe to. Either ```channels``` or ```channelGroups``` must be supplied. | ```false```\n| transform | Method for changing the payload format of your stream. | ```function(m){}```\n| history | Use PubNub history call to retrieve last message. This will display points at their last known location. Requires [PubNub storage](http://www.pubnub.com/how-it-works/storage-and-playback/) to be enabled. | ```false```\n| pubnub | An instance of the PUBNUB javascript global. This is required when using your own keys. See the ```subscribeKey``` example. | ```false```\n| connect | A function to call when PubNub makes a connection. See [PubNub subscribe](http://www.pubnub.com/docs/javascript/api/reference.html#subscribe) | ```function(){}``` |\n| marker | A custom Mapbox marker object. Use this to change the marker icon, tooltip, etc. | L.marker |\n| rotate | Add bearing to markers in ```options.angle```. This won't have any effect unless you're using [a rotated marker type](https://www.mapbox.com/mapbox.js/example/v1.0.0/rotating-controlling-marker/). | ```false``` |\n| message | A function to call everytime a PubNub message is recieved. See [PubNub subscribe](http://www.pubnub.com/docs/javascript/api/reference.html#subscribe) | ```function(message, timetoken, channel){}``` |\n| transform | Method for changing the payload format of your stream. See [example](https://github.com/pubnub/eon-chart/blob/master/examples/transform.html)| ```function(m){return m}```\n| provider | Google or Mapbox | ```mapbox```\n| mbToken |Mapbox API Token (Mapbox Only). | ```undefined```\n| mbId | Mapbox Map ID (MapBox Only). | ```undefined```\n| options | An options object supplied to the [MapBox Maps constructor](https://www.mapbox.com/mapbox.js/api/v2.4.0/l-mapbox-map/) (MapBox Only). | ```{}``` |\n| googleKey | Google Maps API Key (Google Maps Only) | ```undefined```\n| googleMutant | Configure Google Maps Styles and Options as documented in [Google Mutant Plugin](https://gitlab.com/IvanSanchez/Leaflet.GridLayer.GoogleMutant#usage)  | ```{ type: 'roadmap'}```\n\n## Lat/Long Values\n\n```eon.map``` expects an array of objects to be published on the same channel it's subscribed to. More on publishing in the next section.\n\nFor example, below you can find a list of all the Torchy's Tacos in Austin, TX.\n\n```js\nvar torchys = [\n  { latlng: [30.370375, -97.756138] },\n  { latlng: [30.323118, -97.739144] },\n  { latlng: [30.302816, -97.699490] },\n  { latlng: [30.293479, -97.742405] },\n  { latlng: [30.250337, -97.754593] },\n  { latlng: [30.236689, -97.762730] }\n];\n```\n\n## Publishing Messages\n\nThe function below is called ```connect``` and fires when the ```pubnub_mapbox``` library is ready.\n\nThis function uses the included PubNub library to pubnub.publish()\npackets to the pubnub.subscribe() call waiting inside the\nMapbox framework.\n\nNotice how the ```subscribeKey``` and ```channel```/```channels```  matches.\n\n```js\n\nfunction connect() {\n\n  var point = {\n    latlng: [37.370375, -97.756138]\n  };\n\n  var pn = new PubNub({\n    publishKey:   'YOUR_PUB_KEY', // replace with your own pub-key\n    subscribeKey: 'YOUR_SUB_KEY'  // replace with your own sub-key\n  });\n\n  setInterval(function(){\n    var new_point = JSON.parse(JSON.stringify(point));\n\n    new_point.latlng = [\n      new_point.latlng[0] + (getNonZeroRandomNumber() * 0.1),\n      new_point.latlng[1] + (getNonZeroRandomNumber() * 0.2)\n    ];\n\n    pn.publish({\n      channel: channel,\n      message: [new_point] // even a single point should be an array\n    });\n\n  }, 500);\n\n};\n\nvar map = eon.map({\n  pubnub: pn,\n  id: 'map',\n  mbToken: 'pk.eyJ1IjoiaWFuamVubmluZ3MiLCJhIjoiZExwb0p5WSJ9.XLi48h-NOyJOCJuu1-h-Jg',\n  mbId: 'ianjennings.l896mh2e',\n  channels: [channel],\n  connect: connect\n});\n```\n\nYou probably want to publish data from the back-end instead.\nCheck out our docs for more info:\n\nhttp://www.pubnub.com/documentation/\n\n## Following a Point\n\nYou can tell the map to follow a point to it's new location whenever data is received by supplying a ```message``` callback.\n\n```js\nvar pn = new PubNub({\n  publishKey:   'YOUR_PUB_KEY', // replace with your own pub-key\n  subscribeKey: 'YOUR_SUB_KEY'  // replace with your own sub-key\n});\n\nvar map = eon.map({\n  pubnub: pn,\n  id: 'map',\n  mbId: 'ianjennings.l896mh2e',\n  //...\n  message: function (data) {\n    map.setView(data[3].latlng, 13);\n  }\n});\n```\n\n## Marker Customization\n\nYou can supply a custom Mapbox marker object with custom tooltips by extening the ```L.marker``` object provided by mapbox. Learn more about custom markers [here](https://www.mapbox.com/mapbox.js/example/v1.0.0/custom-marker/).\n\n```html\n\u003cdiv id='map'\u003e\u003c/div\u003e\n\u003cscript\u003e\n  L.RotatedMarker = L.Marker.extend({\n    options: { angle: 0 },\n    _setPos: function(pos) {\n      L.Marker.prototype._setPos.call(this, pos);\n      if (L.DomUtil.TRANSFORM) {\n        // use the CSS transform rule if available\n        this._icon.style[L.DomUtil.TRANSFORM] += ' rotate(' + this.options.angle + 'deg)';\n      } else if (L.Browser.ie) {\n        // fallback for IE6, IE7, IE8\n        var rad = this.options.angle * L.LatLng.DEG_TO_RAD,\n        costheta = Math.cos(rad),\n        sintheta = Math.sin(rad);\n        this._icon.style.filter += ' progid:DXImageTransform.Microsoft.Matrix(sizingMethod=\\'auto expand\\', M11=' +\n          costheta + ', M12=' + (-sintheta) + ', M21=' + sintheta + ', M22=' + costheta + ')';\n      }\n    }\n  });\n\n  var pn = new PubNub({\n    publishKey:   'YOUR_PUB_KEY', // replace with your own pub-key\n    subscribeKey: 'YOUR_SUB_KEY'  // replace with your own sub-key\n  });\n\n  var map = eon.map({\n    pubnub: pn,\n    id: 'map',\n    mbId: 'ianjennings.lec77m70',\n    mbToken: 'pk.eyJ1IjoiaWFuamVubmluZ3MiLCJhIjoiZExwb0p5WSJ9.XLi48h-NOyJOCJuu1-h-Jg',\n    channels: ['rutgers-bus-data'],\n    rotate: true,\n    history: true,\n    marker: function (latlng, data) {\n\n      var marker = new L.RotatedMarker(latlng, {\n        icon: L.icon({\n          iconUrl: 'http://i.imgur.com/2fmFQfN.png',\n          iconSize: [9, 32]\n        })\n      });\n\n      marker.bindPopup('Route ' + data.routeTag.toUpperCase());\n\n      return marker;\n\n    }\n  });\n\u003c/script\u003e\n```\n\n## Configure using your own PubNub API Keys\n#### Using your own API Key with Eon Maps\n\nYou can set the `pubnub` init parameter when using Eon Maps.  This allows you to configure PubNub client connections with extra security options such a `auth_key` and your `cipher_key`.  You should also set `secure: true` and `ssl: true` as well.\n\n```html\n\u003cdiv id=\"map\"\u003e\u003c/div\u003e\n\u003cscript\u003e\n  var pn  = PUBNUB({\n    subscribeKey : 'YOUR_SUB_KEY',\n    ssl : true\n  });\n  var channel = 'my-map';\n  var map = eon.map({\n    pubnub: pn,  // PubNub goes here\n    channels: channel,\n    id: 'map',\n    mbId 'mapbox.streets',\n    mbToken: 'pk.ey31IjoiaWRtc3giLCJhIjoiZZ1zMGI2ZjBlNTMxZjk5YTEwNjM5WNJlOWI4MmJiZGIifQ.U1jMQo2QVeuUtt85oD7hkQ'\n  });\n\u003c/script\u003e\n```\n## Kitchen Sink\n\nCheck out the ```bus.html``` and ```flight.html``` for full featured examples.\n\n## Customizing with Mapbox\n\nThe MapBox map object is returned by ```eon.mapbox``` and can be customized using the [Mapbox API](https://www.mapbox.com/mapbox.js/api/v3.1.5/). Also see the [Mapbox examples page](https://www.mapbox.com/mapbox.js/example/v1.0.0/).\n\nAlso note that you can customize your map using Mapbox map editor. You can change the map background style, add static markers, etc. Visit [Mapbox](https://www.mapbox.com/) for your own API key.\n\n## Distributed Systems\n\nThe EON library compiles all messages at designated intervals. This means you can publish from multiple sources into one map. For example, you can map the individual locations of 3 phones by supplying the same channel to your PubNub publish requests. The [flight example](http://pubnub.com/developers/eon/map/flight/) works like this; not every flight is updated on every subscribe call.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpubnub%2Feon-map","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpubnub%2Feon-map","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpubnub%2Feon-map/lists"}