项目作者: Azure-Samples

项目描述 :
An Azure Maps Web SDK module that synchronizes the cameras of two or more maps.
高级语言: JavaScript
项目地址: git://github.com/Azure-Samples/azure-maps-sync-maps.git
创建时间: 2020-08-25T07:15:06Z
项目社区:https://github.com/Azure-Samples/azure-maps-sync-maps

开源协议:MIT License

下载



page_type: sample
description: An Azure Maps Web SDK module that synchronizes the cameras of two or more maps.
languages:

  • javascript
  • typescript
    products:
  • azure
  • azure-maps

Azure Maps Sync Maps module

An Azure Maps Web SDK module that synchronizes the cameras of two or more maps.

Try the demo

Azure Maps Sync Maps module

Getting started

Download the project and copy the azure-maps-sync-maps JavaScript file from the dist folder into your project.

Usage

This module exports a static function on the atlas namespace called syncMaps. Pass two or more maps into the atlas.syncMaps function to synchronize them.

  1. var map1 = new atlas.Map('map1', { });
  2. var map2 = new atlas.Map('map2', { });
  3. atlas.syncMaps(map1, map2);
  4. //Alternatively, an array of maps can also be passed in.
  5. atlas.syncMaps([map1, map2]);

API Reference

Name Return type Description
syncMaps(maps: azmaps.Map[]) MapSynchronizer Disposes a setInterval instance.

MapSynchronizer interface

A class that synchronizes the cameras of two or more maps.

Methods

Name Return type Description
disable() Disables the synchronization of the maps.
dispose() Disposes the map synchronizer.
enable() Enables the synchronization of the maps.
isEnabled() boolean Get sthe enabled state.

Additional Resources

Contributing

We welcome contributions. Feel free to submit code samples, file issues and pull requests on the repo and we’ll address them as we can.
Learn more about how you can help on our Contribution Rules & Guidelines.

You can reach out to us anytime with questions and suggestions using our communities below:

This project has adopted the Microsoft Open Source Code of Conduct.
For more information, see the Code of Conduct FAQ or
contact opencode@microsoft.com with any additional questions or comments.

License

MIT

See License for full license text.