Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mapbox/mapbox-gl-sync-move
Sync movement between two Mapbox GL maps
https://github.com/mapbox/mapbox-gl-sync-move
Last synced: about 18 hours ago
JSON representation
Sync movement between two Mapbox GL maps
- Host: GitHub
- URL: https://github.com/mapbox/mapbox-gl-sync-move
- Owner: mapbox
- License: isc
- Created: 2016-06-09T22:29:35.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2022-08-26T17:43:26.000Z (over 2 years ago)
- Last Synced: 2024-09-19T03:38:50.596Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 118 KB
- Stars: 47
- Watchers: 74
- Forks: 17
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
- awesome-maplibre - mapbox-gl-sync-move - Syncs movement between multiple maps. (Utility Libraries / JavaScript)
README
# @mapbox/mapbox-gl-sync-move [![CircleCI](https://circleci.com/gh/mapbox/mapbox-gl-sync-move.svg?style=svg)](https://circleci.com/gh/mapbox/mapbox-gl-sync-move)
Sync movement between two or more [Mapbox GL JS](https://www.mapbox.com/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](https://www.mapbox.com/mapbox-gl-js) maps whose movements you'd like to sync.
```js
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`.