UNPKG

azure-maps-animations

Version:

A module for the Azure Maps Web SDK that provides tools for animating data on the map.

157 lines (110 loc) 12.1 kB
--- page_type: sample description: A rich library of animations for use with the Azure Maps Web SDK. languages: - javascript - typescript products: - azure - azure-maps --- # Azure Maps Animation module A rich library of animations for use with the Azure Maps Web SDK. ## Features ### Animations - Frame based animation timer. - Drop animations for Point data and markers. - Animate data along a path. - Animate the map camera along a path. - Create a snakeline animation effect. - Animate the changing of coordinates in a shape or marker. - Morph a shapes from one geometry to another. - Group animations and play them together, sequentially, or incrementally. - Create a flowing stroke dash array in a line layer. ### Tools - Improved setTimeout and setInterval functions that leverage requestAnimationFrame. - Leverage over 30 different built in easing functions. ## Getting started Download the project and copy the `azure-maps-animations` JavaScript file from the `dist` folder into your project. See the [documentation](https://github.com/Azure-Samples/azure-maps-animations/tree/main/docs) for more details on a specific feature or take a look at one of the samples below. ## Samples [Animate a choropleth map](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20a%20choropleth%20map) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animate-a-choropleth-map.jpg" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20a%20choropleth%20map) [Animate a GPS trace](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20a%20GPS%20trace) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animate-a-GPS-trace.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20a%20GPS%20trace) [Animate a snakeline](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20a%20snakeline) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animate-a-snakeline.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20a%20snakeline) [Animate along a path](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20along%20a%20path) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animate-along-a-path.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20along%20a%20path) [Animate along a route path](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20along%20a%20route%20path) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animate-along-a-route-path.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20along%20a%20route%20path) [Animate marker along path](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20marker%20along%20path) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animate-marker-along-path.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20marker%20along%20path) [Animate multiple points](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20multiple%20points) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animate-multiple-points.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20multiple%20points) [Animate point along path](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20point%20along%20path) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animate-point-along-path.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20point%20along%20path) [Animate to new position of marker](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20to%20new%20position%20of%20marker) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animate-to-new-position-of-marker.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20to%20new%20position%20of%20marker) [Animate to new position of point](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20to%20new%20position%20of%20point) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animate-to-new-position-of-point.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animate%20to%20new%20position%20of%20point) [Animated tile layer](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animated%20tile%20layer) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animated-tile-layer.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animated%20tile%20layer) [Animated traffic flow](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animated%20traffic%20flow) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animated-traffic-flow.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animated%20traffic%20flow) [Animation easings](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animation%20easings) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Animation-easings.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animation%20easings) [Bouncing marker animation](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Bouncing%20marker%20animation) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Bouncing-marker-animation.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Bouncing%20marker%20animation) [Drop markers on interval](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Drop%20markers%20on%20interval) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Drop-markers-on-interval.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Drop%20markers%20on%20interval) [Drop multiple markers animation](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Drop%20multiple%20markers%20animation) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Drop-multiple-markers-animation.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Drop%20multiple%20markers%20animation) [Drop multiple symbols animation](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Drop%20multiple%20symbols%20animation) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Drop-multiple-symbols-animation.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Drop%20multiple%20symbols%20animation) [Drop symbol animation](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Drop%20symbol%20animation) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Drop-symbol-animation.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Drop%20symbol%20animation) [Drop symbols on interval](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Drop%20symbols%20on%20interval) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Drop-symbols-on-interval.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Drop%20symbols%20on%20interval) [Morph shape animation](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Morph%20shape%20animation) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Morph-shape-animation.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Morph%20shape%20animation) [Moving dashed line](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Moving%20dashed%20line) <br/>[<img src="https://github.com/Azure-Samples/AzureMapsCodeSamples/raw/master/AzureMapsCodeSamples/SiteResources/screenshots/Moving-dashed-line.gif" height="200px">](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Moving%20dashed%20line) ## Roadmap The following are some ideas to take this project further. - New examples - Cluster explode - Traffic flow lines - New animations - Line path with trail - Playable camera animations (rotate around, fly, jump) - UI controls - Animation control UI - Time series animation control UI - Investigate - Add option to reduce noise of `heading` values in route path animation. - JSON schema for saving and replaying animations. ## Related Projects * [Azure Maps Web SDK Open modules](https://github.com/microsoft/Maps/blob/master/AzureMaps.md#open-web-sdk-modules) - A collection of open source modules that extend the Azure Maps Web SDK. * [Azure Maps Web SDK Samples](https://github.com/Azure-Samples/AzureMapsCodeSamples) * [Azure Maps Gov Cloud Web SDK Samples](https://github.com/Azure-Samples/AzureMapsGovCloudCodeSamples) * [Azure Maps & Azure Active Directory Samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples) * [List of open-source Azure Maps projects](https://github.com/microsoft/Maps/blob/master/AzureMaps.md) ## Additional Resources * [Azure Maps (main site)](https://azure.com/maps) * [Azure Maps Documentation](https://docs.microsoft.com/azure/azure-maps/index) * [Azure Maps Blog](https://azure.microsoft.com/blog/topics/azure-maps/) * [Microsoft Q&A](https://docs.microsoft.com/answers/topics/azure-maps.html) * [Azure Maps feedback](https://feedback.azure.com/forums/909172-azure-maps) ## 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](https://github.com/Azure-Samples/azure-maps-animations/blob/main/CONTRIBUTING.md). You can reach out to us anytime with questions and suggestions using our communities below: * [Microsoft Q&A](https://docs.microsoft.com/answers/topics/azure-maps.html) * [Azure Maps feedback](https://feedback.azure.com/forums/909172-azure-maps) This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ## License MIT See [License](https://github.com/Azure-Samples/azure-maps-animations/blob/main/LICENSE.md) for full license text.