hyperion-hyn / mapbox_gl_failover

mapbox-gl js fail over

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Map3 for mapbox

This project shows how to use the map3 network through mapbox-js.

We developed a package to enable the Mapbox-GL sdk to achieve robust tile service of Map3.

  • first to find the Map3-Edge through API to the Map3 Router
  • then select a candidate and try getting the tile.
  • if the candidate fails, fail-over to the next one.

Check the mapbox_patch.js for more information.

how to build

npm install
npm run webpack
npm run start

open browser http://localhost:9000/

add to your project

<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.0.0/mapbox-gl.js'></script>
<script src='dist/bundle.js'></script>

...

var map = new mapboxgl.Map({
      container: 'map',
      style:'https://static.hyn.space/maptiles/see-it-all.json'	//this is map3 style.
    });

About

mapbox-gl js fail over


Languages

Language:JavaScript 86.7%Language:HTML 13.3%