Sync movement around two Mapbox GL JS maps


3250.3.02 years ago5 years agoMinified + gzip package size for @mapbox/mapbox-gl-sync-move in KB


@mapbox/mapbox-gl-sync-move CircleCI

Sync movement between two or more Mapbox GL JS maps.


npm install @mapbox/mapbox-gl-sync-move


This module exports a function that receives as arguments two or more Mapbox GL JS maps whose movements you'd like to sync.

var mapboxgl = require('mapbox-gl');
var syncMove = require('mapbox-gl-sync-move');

var mapA = new mapboxgl.Map(..);
var mapB = new mapboxgl.Map(..);

syncMove(mapA, mapB);


There are unit tests with mocked maps, and there's a page for manual testing.

Run the unit tests with npm test.

To manually test, ensure you have a MapboxAccessToken environment variable set. Then start the server with npm run start.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.