1. @mapbox/mapbox-gl-sync-move
Sync movement around two Mapbox GL JS maps
@mapbox/mapbox-gl-sync-move
Package: @mapbox/mapbox-gl-sync-move
Created by: mapbox
Last modified: Thu, 12 Jan 2023 12:43:08 GMT
Version: 0.3.1
License: ISC
Downloads: 30,285
Repository: https://github.com/mapbox/mapbox-gl-sync-move

Install

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

@mapbox/mapbox-gl-sync-move CircleCI

Sync movement between two or more Mapbox GL JS maps.

Install

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

Usage

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 syncMaps = require('mapbox-gl-sync-move');

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

syncMaps(mapA, mapB);

Developing

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.

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code