├── .github
├── CODE_OF_CONDUCT.md
├── ISSUE_TEMPLATE.md
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ ├── node.js.yml
│ └── npm-publish.yml
├── .gitignore
├── CHANGELOG.md
├── CONTRIBUTING.md
├── LICENSE.md
├── README.md
├── SECURITY.md
├── azure-pipelines.yml
├── build
└── build.js
├── dist
├── azure-maps-animations.js
└── azure-maps-animations.min.js
├── docs
├── API Reference.md
└── README.md
├── examples
├── Animate a GPS trace.html
├── Animate a choropleth map.html
├── Animate a snakeline.html
├── Animate along a path.html
├── Animate along a route path.html
├── Animate marker along path.html
├── Animate multiple points.html
├── Animate point along path.html
├── Animate to new position of marker.html
├── Animate to new position of point.html
├── Animated tile layer.html
├── Animated traffic flow.html
├── Animation easings.html
├── Bouncing marker animation.html
├── Drop markers on interval.html
├── Drop multiple markers animation.html
├── Drop multiple symbols animation.html
├── Drop symbol animation.html
├── Drop symbols on interval.html
├── Fade shapes in sequentially.html
├── Morph shape animation.html
└── Moving dashed line.html
├── package-lock.json
├── package.json
├── src
├── animations
│ ├── FrameBasedAnimationTimer.ts
│ ├── GroupAnimation.ts
│ ├── PlayableAnimation.ts
│ ├── index.ts
│ ├── interfaces
│ │ ├── IPlayableAnimation.ts
│ │ ├── PointPairValueInterpolation.ts
│ │ └── TimeSpan.ts
│ ├── internal
│ │ ├── AnimationManager.ts
│ │ ├── DropAnimation.ts
│ │ ├── Easings.ts
│ │ ├── MapPathPlayableAnimation.ts
│ │ ├── OpacityAnimation.ts
│ │ ├── PathAnimation.ts
│ │ ├── PointTranslateAnimation.ts
│ │ ├── RoutePathAnimation.ts
│ │ ├── SimpleIntervalAnimation.ts
│ │ └── morph
│ │ │ ├── GeometryInterpolator.ts
│ │ │ ├── MorphShapeAnimation.ts
│ │ │ ├── RingInterpolator.ts
│ │ │ └── SimpleGeometryInterpolator.ts
│ ├── options
│ │ ├── GroupAnimationOptions.ts
│ │ ├── MapPathAnimationOptions.ts
│ │ ├── MovingDashLineOptions.ts
│ │ ├── PathAnimationOptions.ts
│ │ ├── PlayableAnimationOptions.ts
│ │ └── RoutePathAnimationOptions.ts
│ └── static.ts
├── extensions
│ └── EventManager.ts
├── helpers
│ ├── Namespace.ts
│ └── Utils.ts
├── index.ts
└── layer
│ ├── AnimatedTileLayer.ts
│ ├── AnimatedTileLayerOptions.ts
│ └── index.ts
├── tsconfig.json
├── types
└── flubber
│ └── index.d.ts
└── typings
└── index.d.ts
/.github/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Microsoft Open Source Code of Conduct
2 |
3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4 |
5 | Resources:
6 |
7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
10 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 |
4 | > Please provide us with the following information:
5 | > ---------------------------------------------------------------
6 |
7 | ### This issue is for a: (mark with an `x`)
8 | ```
9 | - [ ] bug report -> please search issues before submitting
10 | - [ ] feature request
11 | - [ ] documentation issue or request
12 | - [ ] regression (a behavior that used to work and stopped in a new release)
13 | ```
14 |
15 | ### Minimal steps to reproduce
16 | >
17 |
18 | ### Any log messages given by the failure
19 | >
20 |
21 | ### Expected/desired behavior
22 | >
23 |
24 | ### OS and Version?
25 | > Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)
26 |
27 | ### Versions
28 | >
29 |
30 | ### Mention any other details that might be useful
31 |
32 | > ---------------------------------------------------------------
33 | > Thanks! We'll be in touch soon.
34 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Purpose
2 |
3 | * ...
4 |
5 | ## Does this introduce a breaking change?
6 |
7 | ```
8 | [ ] Yes
9 | [ ] No
10 | ```
11 |
12 | ## Pull Request Type
13 | What kind of change does this Pull Request introduce?
14 |
15 |
16 | ```
17 | [ ] Bugfix
18 | [ ] Feature
19 | [ ] Code style update (formatting, local variables)
20 | [ ] Refactoring (no functional changes, no api changes)
21 | [ ] Documentation content changes
22 | [ ] Other... Please describe:
23 | ```
24 |
25 | ## How to Test
26 | * Get the code
27 |
28 | ```
29 | git clone [repo-address]
30 | cd [repo-name]
31 | git checkout [branch-name]
32 | npm install
33 | ```
34 |
35 | * Test the code
36 |
37 | ```
38 | ```
39 |
40 | ## What to Check
41 | Verify that the following are valid
42 | * ...
43 |
44 | ## Other Information
45 |
--------------------------------------------------------------------------------
/.github/workflows/node.js.yml:
--------------------------------------------------------------------------------
1 | # This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2 | # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3 |
4 | name: Node.js CI
5 |
6 | on:
7 | push:
8 | branches:
9 | - '**'
10 | pull_request:
11 | branches:
12 | - '**'
13 |
14 | jobs:
15 | build:
16 |
17 | runs-on: ubuntu-latest
18 |
19 | strategy:
20 | matrix:
21 | node-version: [16.x, 18.x, 20.x, 22.x]
22 | # See supported Node.js release schedule at https://nodejs.org/en/about/releases/
23 |
24 | steps:
25 | - uses: actions/checkout@v4
26 | - name: Use Node.js ${{ matrix.node-version }}
27 | uses: actions/setup-node@v4
28 | with:
29 | node-version: ${{ matrix.node-version }}
30 | cache: 'npm'
31 | - run: npm ci --force
32 | - run: npm run build --if-present -- --isNpmBuild
33 | - run: npm run build --if-present
34 | - run: python -m pip install linkcheckmd
35 | - run: python -m linkcheckmd README.md
36 |
--------------------------------------------------------------------------------
/.github/workflows/npm-publish.yml:
--------------------------------------------------------------------------------
1 | # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2 | # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3 |
4 | name: Publish Node.js Package
5 |
6 | on:
7 | release:
8 | types: [published]
9 | workflow_dispatch:
10 |
11 | jobs:
12 | build:
13 | runs-on: ubuntu-latest
14 | steps:
15 | - uses: actions/checkout@v4
16 | - uses: actions/setup-node@v4
17 | with:
18 | node-version: 20
19 | - run: npm ci --force
20 | - run: npm run build --if-present
21 |
22 | publish-npm:
23 | needs: build
24 | runs-on: ubuntu-latest
25 | steps:
26 | - uses: actions/checkout@v4
27 | - uses: actions/setup-node@v4
28 | with:
29 | node-version: 20
30 | registry-url: https://registry.npmjs.org/
31 | - run: npm ci --force
32 | - run: npm run build --if-present -- --isNpmBuild
33 | - run: npm publish --access=public
34 | env:
35 | NODE_AUTH_TOKEN: ${{secrets.npm_token}}
36 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Directories to ignore
2 | js/
3 | node_modules/
4 | test/lib/
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## azure-maps-animations Changelog
2 |
3 |
4 | # 0.0.2 (Unreleased)
5 |
6 | - Update dependencies versions.
7 | - Update readme links.
8 |
9 |
10 | # 0.0.1 (2020-08-21)
11 |
12 | **Animations**
13 |
14 | - Frame based animation timer.
15 | - Drop animations for Point data and markers.
16 | - Animate data along a path.
17 | - Animate the map camera along a path.
18 | - Create a snakeline animation effect.
19 | - Animate the changing of coordinates in a shape or marker.
20 | - Morph a shapes from one geometry to another.
21 | - Group animations and play them together, sequentially, or incrementally.
22 | - Create a flowing stroke dash array in a line layer.
23 |
24 | **Tools**
25 |
26 | - Improved setTimeout and setInterval functions that leverage requestAnimationFrame.
27 | - Leverage over 30 different built in easing functions.
28 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to azure-maps-animations
2 |
3 | This project welcomes contributions and suggestions. Most contributions require you to agree to a
4 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
5 | the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
6 |
7 | When you submit a pull request, a CLA bot will automatically determine whether you need to provide
8 | a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
9 | provided by the bot. You will only need to do this once across all repos using our CLA.
10 |
11 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
12 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
13 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
14 |
15 | - [Code of Conduct](#coc)
16 | - [Issues and Bugs](#issue)
17 | - [Feature Requests](#feature)
18 | - [Submission Guidelines](#submit)
19 |
20 | ## Code of Conduct
21 | Help us keep this project open and inclusive. Please read and follow our [Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
22 |
23 | ## Found an Issue?
24 | If you find a bug in the source code or a mistake in the documentation, you can help us by
25 | [submitting an issue](#submit-issue) to the GitHub Repository. Even better, you can
26 | [submit a Pull Request](#submit-pr) with a fix.
27 |
28 | ## Want a Feature?
29 | You can *request* a new feature by [submitting an issue](#submit-issue) to the GitHub
30 | Repository. If you would like to *implement* a new feature, please submit an issue with
31 | a proposal for your work first, to be sure that we can use it.
32 |
33 | * **Small Features** can be crafted and directly [submitted as a Pull Request](#submit-pr).
34 |
35 | ## Submission Guidelines
36 |
37 | ### Submitting an Issue
38 | Before you submit an issue, search the archive, maybe your question was already answered.
39 |
40 | If your issue appears to be a bug, and hasn't been reported, open a new issue.
41 | Help us to maximize the effort we can spend fixing issues and adding new
42 | features, by not reporting duplicate issues. Providing the following information will increase the
43 | chances of your issue being dealt with quickly:
44 |
45 | * **Overview of the Issue** - if an error is being thrown a non-minified stack trace helps
46 | * **Version** - what version is affected (e.g. 0.1.2)
47 | * **Motivation for or Use Case** - explain what are you trying to do and why the current behavior is a bug for you
48 | * **Browsers and Operating System** - is this a problem with all browsers?
49 | * **Reproduce the Error** - provide a live example or a unambiguous set of steps
50 | * **Related Issues** - has a similar issue been reported before?
51 | * **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be
52 | causing the problem (line of code or commit)
53 |
54 | You can file new issues by providing the above information at the corresponding repository's issues link: https://github.com/Azure-Samples/azure-maps-animations/issues/new].
55 |
56 | ### Submitting a Pull Request (PR)
57 | Before you submit your Pull Request (PR) consider the following guidelines:
58 |
59 | * Search the repository (https://github.com/Azure-Samples/azure-maps-animations/pulls) for an open or closed PR
60 | that relates to your submission. You don't want to duplicate effort.
61 |
62 | * Make your changes in a new git fork:
63 |
64 | * Commit your changes using a descriptive commit message
65 | * Push your fork to GitHub:
66 | * In GitHub, create a pull request
67 | * If we suggest changes then:
68 | * Make the required updates.
69 | * Rebase your fork and force push to your GitHub repository (this will update your Pull Request):
70 |
71 | ```shell
72 | git rebase master -i
73 | git push -f
74 | ```
75 |
76 | That's it! Thank you for your contribution!
77 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) Microsoft Corporation.
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Azure Maps Animation module
2 |
3 | A rich library of animations for use with the Azure Maps Web SDK.
4 |
5 | ## Features
6 |
7 | ### Animations
8 |
9 | - Frame based animation timer.
10 | - Drop animations for Point data and markers.
11 | - Animate data along a path.
12 | - Animate the map camera along a path.
13 | - Create a snakeline animation effect.
14 | - Animate the changing of coordinates in a shape or marker.
15 | - Morph a shapes from one geometry to another.
16 | - Group animations and play them together, sequentially, or incrementally.
17 | - Create a flowing stroke dash array in a line layer.
18 |
19 | ### Tools
20 |
21 | - Improved setTimeout and setInterval functions that leverage requestAnimationFrame.
22 | - Leverage over 30 different built in easing functions.
23 |
24 | ## Getting started
25 |
26 | Download the project and copy the `azure-maps-animations` JavaScript file from the `dist` folder into your project.
27 |
28 | 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.
29 |
30 | ## Samples
31 |
32 | [Animate a choropleth map](https://samples.azuremaps.com/?sample=animate-a-choropleth-map)
33 | [](https://samples.azuremaps.com/?sample=animate-a-choropleth-map)
34 |
35 | [Animate a GPS trace](https://samples.azuremaps.com/?sample=animate-a-GPS-trace)
36 | [](https://samples.azuremaps.com/?sample=animate-a-GPS-trace)
37 |
38 | [Animate a snakeline](https://samples.azuremaps.com/?sample=animate-a-snakeline)
39 | [](https://samples.azuremaps.com/?sample=animate-a-snakeline)
40 |
41 | [Animate along a path](https://samples.azuremaps.com/?sample=animate-along-a-path)
42 | [](https://samples.azuremaps.com/?sample=animate-along-a-path)
43 |
44 | [Animate along a route path](https://samples.azuremaps.com/?sample=animate-along-a-route-path)
45 | [](https://samples.azuremaps.com/?sample=animate-along-a-route-path)
46 |
47 | [Animate marker along path](https://samples.azuremaps.com/?sample=animate-marker-along-path)
48 | [](https://samples.azuremaps.com/?sample=animate-marker-along-path)
49 |
50 | [Animate multiple points](https://samples.azuremaps.com/?sample=animate-multiple-points)
51 | [](https://samples.azuremaps.com/?sample=animate-multiple-points)
52 |
53 | [Animate point along path](https://samples.azuremaps.com/?sample=animate-point-along-path)
54 | [](https://samples.azuremaps.com/?sample=animate-point-along-path)
55 |
56 | [Animate to new position of marker](https://samples.azuremaps.com/?sample=animate-to-new-position-of-marker)
57 | [](https://samples.azuremaps.com/?sample=animate-to-new-position-of-marker)
58 |
59 | [Animate to new position of point](https://samples.azuremaps.com/?sample=animate-to-new-position-of-point)
60 | [](https://samples.azuremaps.com/?sample=animate-to-new-position-of-point)
61 |
62 | [Animated tile layer](https://samples.azuremaps.com/?sample=animated-tile-layer)
63 | [](https://samples.azuremaps.com/?sample=animated-tile-layer)
64 |
65 | [Animated traffic flow](https://samples.azuremaps.com/?sample=animated-traffic-flow)
66 | [](https://samples.azuremaps.com/?sample=animated-traffic-flow)
67 |
68 | [Animation easings](https://samples.azuremaps.com/?sample=animation-easings)
69 | [](https://samples.azuremaps.com/?sample=animation-easings)
70 |
71 | [Bouncing marker animation](https://samples.azuremaps.com/?sample=bouncing-marker-animation)
72 | [](https://samples.azuremaps.com/?sample=bouncing-marker-animation)
73 |
74 | [Drop markers on interval](https://samples.azuremaps.com/?sample=drop-markers-on-interval)
75 | [](https://samples.azuremaps.com/?sample=drop-markers-on-interval)
76 |
77 | [Drop multiple markers animation](https://samples.azuremaps.com/?sample=drop-multiple-markers-animation)
78 | [](https://samples.azuremaps.com/?sample=drop-multiple-markers-animation)
79 |
80 | [Drop multiple symbols animation](https://samples.azuremaps.com/?sample=drop-multiple-symbols-on-interval)
81 | [](https://samples.azuremaps.com/?sample=drop-multiple-symbols-on-interval)
82 |
83 | [Drop symbol animation](https://samples.azuremaps.com/?sample=drop-symbol-animation)
84 | [](https://samples.azuremaps.com/?sample=drop-symbol-animation)
85 |
86 | [Drop symbols on interval](https://samples.azuremaps.com/?sample=drop-symbols-on-interval)
87 | [](https://samples.azuremaps.com/?sample=drop-symbols-on-interval)
88 |
89 | [Morph shape animation](https://samples.azuremaps.com/?sample=morph-shape-animation)
90 | [](https://samples.azuremaps.com/?sample=morph-shape-animation)
91 |
92 | [Moving dashed line](https://samples.azuremaps.com/?sample=moving-dashed-line)
93 | [](https://samples.azuremaps.com/?sample=moving-dashed-line)
94 |
95 | ## Roadmap
96 |
97 | The following are some ideas to take this project further.
98 |
99 | - New examples
100 | - Cluster explode
101 | - Traffic flow lines
102 | - New animations
103 | - Line path with trail
104 | - Playable camera animations (rotate around, fly, jump)
105 | - UI controls
106 | - Animation control UI
107 | - Time series animation control UI
108 | - Investigate
109 | - Add option to reduce noise of `heading` values in route path animation.
110 | - JSON schema for saving and replaying animations.
111 |
112 | ## Related Projects
113 |
114 | * [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.
115 | * [Azure Maps Web SDK Samples](https://github.com/Azure-Samples/AzureMapsCodeSamples)
116 | * [Azure Maps & Azure Active Directory Samples](https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples)
117 | * [List of open-source Azure Maps projects](https://github.com/microsoft/Maps/blob/master/AzureMaps.md)
118 |
119 | ## Additional Resources
120 |
121 | * [Azure Maps (main site)](https://azure.microsoft.com/en-us/products/azure-maps/)
122 | * [Azure Maps Documentation](https://docs.microsoft.com/azure/azure-maps/index)
123 | * [Azure Maps Blog](https://azure.microsoft.com/en-us/blog/product/azure-maps/)
124 | * [Microsoft Q&A](https://docs.microsoft.com/answers/topics/azure-maps.html)
125 | * [Azure Maps feedback](https://feedback.azure.com/forums/909172-azure-maps)
126 |
127 | ## Contributing
128 |
129 | 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.
130 | Learn more about how you can help on our [Contribution Rules & Guidelines](https://github.com/Azure-Samples/azure-maps-animations/blob/main/CONTRIBUTING.md).
131 |
132 | You can reach out to us anytime with questions and suggestions using our communities below:
133 | * [Microsoft Q&A](https://docs.microsoft.com/answers/topics/azure-maps.html)
134 | * [Azure Maps feedback](https://feedback.azure.com/forums/909172-azure-maps)
135 |
136 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
137 | For more information, see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
138 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
139 |
140 | ## License
141 |
142 | MIT
143 |
144 | See [License](https://github.com/Azure-Samples/azure-maps-animations/blob/main/LICENSE.md) for full license text.
145 |
--------------------------------------------------------------------------------
/SECURITY.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | ## Security
4 |
5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
6 |
7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below.
8 |
9 | ## Reporting Security Issues
10 |
11 | **Please do not report security vulnerabilities through public GitHub issues.**
12 |
13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report).
14 |
15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc).
16 |
17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18 |
19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20 |
21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22 | * Full paths of source file(s) related to the manifestation of the issue
23 | * The location of the affected source code (tag/branch/commit or direct URL)
24 | * Any special configuration required to reproduce the issue
25 | * Step-by-step instructions to reproduce the issue
26 | * Proof-of-concept or exploit code (if possible)
27 | * Impact of the issue, including how an attacker might exploit the issue
28 |
29 | This information will help us triage your report more quickly.
30 |
31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs.
32 |
33 | ## Preferred Languages
34 |
35 | We prefer all communications to be in English.
36 |
37 | ## Policy
38 |
39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd).
40 |
41 |
42 |
--------------------------------------------------------------------------------
/azure-pipelines.yml:
--------------------------------------------------------------------------------
1 | # HTML
2 | # Archive your static HTML project and save it with the build record.
3 | # Add steps that build, run tests, deploy, and more:
4 | # https://aka.ms/yaml
5 |
6 | trigger:
7 | - master
8 |
9 | pool:
10 | vmImage: 'ubuntu-latest'
11 |
12 | steps:
13 | - task: ArchiveFiles@2
14 | inputs:
15 | rootFolderOrFile: '$(build.sourcesDirectory)'
16 | includeRootFolder: false
17 | - task: PublishBuildArtifacts@1
18 |
--------------------------------------------------------------------------------
/build/build.js:
--------------------------------------------------------------------------------
1 | const pkg = require("../package.json");
2 | const fs = require("fs-extra");
3 | const path = require("path");
4 | const { rollup } = require("rollup");
5 | const commonjs = require("rollup-plugin-commonjs");
6 | const nodeResolve = require("rollup-plugin-node-resolve");
7 | const { uglify } = require("rollup-plugin-uglify");
8 | const ts = require("typescript");
9 |
10 | // Configure any functions/properties used by the drawing tools and
11 | // exported by a dependency that rollup can't automatically detect.
12 | const namedExports = {
13 | };
14 |
15 | // Parse the command line.
16 | const args = require("yargs").options({
17 | "isNpmBuild": {
18 | describe: "Whether the build is for NPM.",
19 | type: "boolean"
20 | }
21 | }).help().argv;
22 |
23 | // Host for formating typescript diagnostics.
24 | const formatDiagnosticHost = {
25 | getCanonicalFileName: path.normalize,
26 | getCurrentDirectory: ts.sys.getCurrentDirectory,
27 | getNewLine: () => ts.sys.newLine
28 | };
29 |
30 | // Host for parsing the config file host.
31 | const parseConfigFileHost = {
32 | useCaseSensitiveFileNames: false,
33 | fileExists: ts.sys.fileExists,
34 | getCurrentDirectory: ts.sys.getCurrentDirectory,
35 | readDirectory: ts.sys.readDirectory,
36 | readFile: ts.sys.readFile,
37 | onUnRecoverableConfigFileDiagnostic: (diag) =>
38 | console.error(ts.formatDiagnostic(diag, formatDiagnosticHost))
39 | };
40 |
41 | // Define and immediately execute the main build function.
42 | let rollupError = false;
43 | (async function build() {
44 | // Cleanup the dist folder where the js packages will be output
45 | const distDirPath = "./dist";
46 | fs.emptyDirSync(distDirPath);
47 |
48 | // Get the major and minor version for the output folder name
49 | //const [majorVersion, minorVersion] = pkg.version.split(".");
50 |
51 | // File name and path for non-minified browser js
52 | const outFilePath = `${distDirPath}/azure-maps-animations.js`;
53 | const outMinFilePath = `${distDirPath}/azure-maps-animations.min.js`;
54 |
55 | const inputPath = "./js/index.js";
56 |
57 | // Ensure that all necessary output folders are created.
58 | await fs.ensureDir(path.dirname(outFilePath));
59 | await fs.ensureDir(path.dirname(outMinFilePath));
60 |
61 | // Parse the typescript config file.
62 | console.log("Parsing tsconfig.json");
63 | const tsConfig = ts.getParsedCommandLineOfConfigFile("./tsconfig.json", {}, parseConfigFileHost);
64 | if (tsConfig.errors.length > 0) {
65 | for (const error of tsConfig.errors) {
66 | console.error(ts.formatDiagnostic(error, formatDiagnosticHost));
67 | }
68 |
69 | process.exit(-1);
70 | }
71 |
72 | // Empty the directory for storing the compiled typescript.
73 | console.log("Clearing the typescript output folder");
74 | await fs.emptyDir(tsConfig.options.outDir);
75 |
76 | // Compile the typescript source.
77 | console.log("Compiling typescript to javascript");
78 | const tsProgram = ts.createProgram(tsConfig.fileNames, tsConfig.options);
79 | const tsResult = tsProgram.emit();
80 | const tsDiag = ts.getPreEmitDiagnostics(tsProgram).concat(tsResult.diagnostics);
81 | if (tsDiag.length > 0) {
82 | for (const error of tsDiag) {
83 | console.error(ts.formatDiagnostic(error, formatDiagnosticHost));
84 | }
85 |
86 | process.exit(-1);
87 | }
88 |
89 | // Read license.txt to define the banner for the packages.
90 | let banner = "/*\n";
91 | banner += (await fs.readFile("./LICENSE.md", "utf8")).trim();
92 | banner += "\n*/\n";
93 |
94 | let rollupInputOps, rollupOutputOps;
95 | if (!args.isNpmBuild) {
96 | // Set rollup options for browser builds.
97 | console.log("Building IIFE version");
98 | rollupInputOps = {
99 | external: ["azure-maps-control"],
100 | onwarn: rollupWarn,
101 | input: inputPath,
102 | plugins: [
103 | nodeResolve({
104 | browser: true,
105 | preferBuiltins: false
106 | }),
107 | commonjs({
108 | namedExports: namedExports
109 | })
110 | ]
111 | };
112 |
113 | rollupOutputOps = {
114 | exports: "named",
115 | file: outFilePath,
116 | format: "iife",
117 | name: "atlas",
118 | extend: true,
119 | globals: {
120 | "azure-maps-control": "atlas"
121 | }
122 | };
123 | } else {
124 | console.log("Building CommonJS version");
125 | rollupInputOps = {
126 | external: ["azure-maps-control"],
127 | onwarn: rollupWarn,
128 | input: inputPath,
129 | plugins: [
130 | nodeResolve({
131 | browser: true,
132 | }),
133 | commonjs({
134 | namedExports: namedExports
135 | })
136 | ]
137 | };
138 |
139 | rollupOutputOps = {
140 | file: outFilePath,
141 | format: "cjs"
142 | };
143 | }
144 |
145 | // Rollup non-minified version.
146 | console.log("Bundling non-minified javascript package");
147 | await bundle(rollupInputOps, rollupOutputOps, banner);
148 |
149 | // Add uglify to the rollup input plugins.
150 | // Update the output file path for the minified version.
151 | rollupOutputOps.file = outMinFilePath;
152 | rollupInputOps.plugins.push(uglify());
153 |
154 | // Rollup minified version.
155 | console.log("Bundling minified javascript package");
156 |
157 | const minifiedLicense = "/* MIT License - Copyright (c) Microsoft Corporation. */\n\n"
158 |
159 | await bundle(rollupInputOps, rollupOutputOps, minifiedLicense);
160 |
161 | //Remove js folder.
162 | await fs.remove("./js");
163 |
164 | // Build is done!
165 | console.log(rollupError ? "Build failed" : "Build completed successfully!");
166 | process.exit(rollupError ? -1 : 0);
167 | })()
168 |
169 | async function bundle(inputOptions, outputOptions) {
170 | const bundle = await rollup(inputOptions);
171 | await bundle.write(outputOptions);
172 | }
173 |
174 | function rollupWarn(warning) {
175 | // Print the warning to the console.
176 | console.warn(warning.toString());
177 |
178 | // If the warning is about missing export provide more info.
179 | if (warning.code === "MISSING_EXPORT") {
180 | console.warn(
181 | ` if '${warning.missing}' is exported by '${warning.exporter}' then try adding\n` +
182 | ` "${warning.exporter}": [${warning.missing}] to namedExports in ${__filename}`
183 | );
184 | }
185 | }
186 |
187 | async function bundle(rollupInputOps, rollupOutputOps, banner) {
188 | try {
189 | const bundle = await rollup(rollupInputOps);
190 | const { output } = await bundle.generate(rollupOutputOps);
191 |
192 | const chunk = output.find((chunk) =>
193 | chunk.fileName === path.basename(rollupOutputOps.file)
194 | );
195 |
196 | await fs.writeFile(rollupOutputOps.file, banner + "\n" + chunk.code, "utf8");
197 | } catch (error) {
198 | throw new Error(`Failed to bundle the javascript package:\n${error.message}\n` +
199 | JSON.stringify(error, null, 2));
200 | }
201 | }
202 |
203 | function rollupWarn(warning) {
204 | // If the warning is about missing export provide more info.
205 | if (warning.code === "MISSING_EXPORT") {
206 | rollupError = true;
207 | console.error("ERROR: " + warning.toString() + "\n" +
208 | ` if '${warning.missing}' is exported by '${warning.exporter}' then try adding\n` +
209 | ` "${warning.exporter}": [${warning.missing}] to namedExports in ${__filename}`
210 | );
211 | } else {
212 | // Print the warning to the console.
213 | console.warn("WARNING: " + warning.toString());
214 | }
215 | }
--------------------------------------------------------------------------------
/docs/README.md:
--------------------------------------------------------------------------------
1 | # Animation Module
2 |
3 | A rich library of animations for use with the Azure Maps Web SDK.
4 |
5 | Most animations are based on the `IPlayableAnimation` interface and accept `PlayableAnimationOptions` which makes it easy customize how these animations function.
6 |
7 | Check out the [API Reference](API%20Reference.md) for indepth details.
8 |
9 | ## Easings
10 |
11 | The following easing names can be used with the animation library. Check out the [Animation easings](https://azuremapscodesamples.azurewebsites.net/index.html?sample=Animation%20easings) example to see these in action.
12 |
13 | | Name | Description |
14 | |------|-------------|
15 | | `linear` | linear easing function. |
16 | | `easeInSine` | Slight acceleration from zero to full speed. |
17 | | `easeOutSine` | Slight deceleration at the end. |
18 | | `easeInOutSine` | Slight acceleration at beginning and slight deceleration at end. |
19 | | `easeInQuad` | Accelerating from zero velocity. |
20 | | `easeOutQuad` | Decelerating to zero velocity. |
21 | | `easeInOutQuad` | Acceleration until halfway, then deceleration. |
22 | | `easeInCubic` | Accelerating from zero velocity. |
23 | | `easeOutCubic` | Decelerating to zero velocity. |
24 | | `easeInOutCubic` | Acceleration until halfway, then deceleration. |
25 | | `easeInQuart` | Accelerating from zero velocity. |
26 | | `easeOutQuart` | Decelerating to zero velocity. |
27 | | `easeInOutQuart` | Acceleration until halfway, then deceleration. |
28 | | `easeInQuint` | Accelerating from zero velocity. |
29 | | `easeOutQuint` | Decelerating to zero velocity. |
30 | | `easeInOutQuint` | Acceleration until halfway, then deceleration. |
31 | | `easeInExpo` | Accelerate exponentially until finish. |
32 | | `easeOutExpo` | Initial exponential acceleration slowing to stop. |
33 | | `easeInOutExpo` | Exponential acceleration and deceleration. |
34 | | `easeInCirc` | Increasing velocity until stop. |
35 | | `easeOutCirc` | Start fast, decreasing velocity until stop. |
36 | | `easeInOutCirc` | Fast increase in velocity, fast decrease in velocity. |
37 | | `easeInBack` | Slow movement backwards then fast snap to finish. |
38 | | `easeOutBack` | Fast snap to backwards point then slow resolve to finish. |
39 | | `easeInOutBack` | Slow movement backwards, fast snap to past finish, slow resolve to finish. |
40 | | `easeInElastic` | Bounces slowly then quickly to finish. |
41 | | `easeOutElastic` | Fast acceleration, bounces to zero. |
42 | | `easeInOutElastic` | Slow start and end, two bounces sandwich a fast motion. |
43 | | `easeOutBounce` | Bounce to completion. |
44 | | `easeInBounce` | Bounce increasing in velocity until completion. |
45 | | `easeInOutBounce` | Bounce in and bounce out. |
46 |
--------------------------------------------------------------------------------
/examples/Animate a snakeline.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |