All versions of this documentation
X

US Airlines


Open in a new window.
          <!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <script src="../build/ogma.min.js"></script>
  <style>
    html, body { margin: 0; }
    #graph-container { top: 0; bottom: 0; left: 0; right: 0; position: absolute; margin: 0; overflow: hidden; }

    .attribution {
      font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif;
      font-size: 11px;
      padding: 1px 5px;
      background: rgba(255, 255, 255, 0.7);
    }
  </style>
</head>
<body>
<div id="graph-container"></div>

<script>
'use strict';

var ogma = new Ogma({
  container: 'graph-container',
  settings: {}
});

ogma.parse.gexfFromUrl('files/airlines.gexf')
  .then(function(g) { return ogma.setGraph(g); })
  .then(function() { return ogma.getEdges().setAttributes({ width: 0.25 }); })
  .then(function() {
    ogma.geo.enable({
      // detectRetina: true,
      latitudePath: 'latitude',
      longitudePath: 'longitude',
      // indicates from which server the tiles must be retrieved
      tileUrlTemplate: 'https://maps.wikimedia.org/osm-intl/{z}/{x}/{y}.png',
      transitionDuration: 0,
      sizeRatio: 1.5,
      attribution: '<div class="attribution">Map data &copy; <a target="_blank" href="http://osm.org/copyright">OpenStreetMap contributors</a></div>'
    });
  });
</script>
</body>
</html>