{"id":13675272,"url":"https://github.com/maptalks/maptalks.animatemarker","last_synced_at":"2025-06-13T20:07:06.701Z","repository":{"id":71330257,"uuid":"79694259","full_name":"maptalks/maptalks.animatemarker","owner":"maptalks","description":"A plugin of maptalks.js to draw markers with animation.","archived":false,"fork":false,"pushed_at":"2022-06-09T06:28:22.000Z","size":789,"stargazers_count":11,"open_issues_count":2,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-12T03:20:29.088Z","etag":null,"topics":["map","mapping","maptalks","maptalks-layer","maptalks-plugins","marker"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maptalks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-01-22T04:46:50.000Z","updated_at":"2024-01-25T07:05:47.000Z","dependencies_parsed_at":"2023-03-13T20:20:36.797Z","dependency_job_id":null,"html_url":"https://github.com/maptalks/maptalks.animatemarker","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/maptalks/maptalks.animatemarker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.animatemarker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.animatemarker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.animatemarker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.animatemarker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maptalks","download_url":"https://codeload.github.com/maptalks/maptalks.animatemarker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maptalks%2Fmaptalks.animatemarker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259390482,"owners_count":22850241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["map","mapping","maptalks","maptalks-layer","maptalks-plugins","marker"],"created_at":"2024-08-02T12:00:37.165Z","updated_at":"2025-06-13T20:07:06.660Z","avatar_url":"https://github.com/maptalks.png","language":"JavaScript","readme":"# maptalks.animatemarker\n\n[![CircleCI](https://circleci.com/gh/maptalks/maptalks.animatemarker/tree/master.svg?style=shield)](https://circleci.com/gh/MapTalks/maptalks.animatemarker)\n[![NPM Version](https://img.shields.io/npm/v/maptalks.animatemarker.svg)](https://github.com/maptalks/maptalks.animatemarker)\n\nA plugin of [maptalks.js](https://github.com/maptalks/maptalks.js) to draw markers with animation.\n\n![screenshot](https://cloud.githubusercontent.com/assets/13678919/25314149/f47fdec6-2870-11e7-9d87-415d98efc4da.png)\n\n## Examples\n\n* [Locations of this week's earthquakes](https://maptalks.github.io/maptalks.animatemarker/demo/).\n\n## Install\n  \n* Install with npm: ```npm install maptalks.animatemarker```. \n* Download from [dist directory](https://github.com/maptalks/maptalks.animatemarker/tree/gh-pages/dist).\n* Use unpkg CDN: ```https://unpkg.com/maptalks.animatemarker/dist/maptalks.animatemarker.min.js```\n\n## Usage\n\nAs a plugin, ```maptalks.animatemarker``` must be loaded after ```maptalks.js``` in browsers.\n```html\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/maptalks/dist/maptalks.min.js\"\u003e\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"https://unpkg.com/maptalks.animatemarker/dist/maptalks.animatemarker.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nvar data = [marker1, marker2, marker3];\nvar animMarkerLayer = new maptalks.AnimateMarkerLayer('anim-markers', data).addTo(map);\n\u003c/script\u003e\n```\n\n## Supported Browsers\n\nIE 9-11, Chrome, Firefox, other modern and mobile browsers.\n\n## API Reference\n\n```AnimateMarkerLayer``` is a subclass of [maptalks.VectorLayer](https://maptalks.github.io/docs/api/VectorLayer.html) and inherits all the methods of its parent.\n\n### `Constructor`\n\n```javascript\nnew maptalks.AnimateMarkerLayer(id, data, options)\n```\n\n* id **String** layer id\n* data **Marker[]** layer data, an array of maptalks.Marker\n* options **Object** options\n    * animation **String** animation effects: 'scale', 'fade' or 'scale,fade' ('scale,fade' by default)\n    * animationDuration **Number** the animation duration (3000 by default)\n    * randomAnimation **Boolean** animation begins randomly (true by default)\n    * animationOnce **Boolean** whether animation only run once (false by default)\n    * fps **Number** fps of animation (24 by default)\n    * Other options defined in [maptalks.VectorLayer](https://maptalks.github.io/docs/api/VectorLayer.html)\n\n### `config(key, value)`\n\nconfig layer's options and redraw the layer if necessary\n\n```javascript\nanimMarkerLayer.config('animation', 'scale');\n```\n\n**Returns** `this`\n\n### `toJSON()`\n\nexport the layer's JSON.\n\n```javascript\nvar json = animMarkerLayer.toJSON();\nvar animLayer = maptalks.Layer.fromJSON(json);\n```\n**Returns** `Object`\n\n## Contributing\n\nWe welcome any kind of contributions including issue reportings, pull requests, documentation corrections, feature requests and any other helps.\n\n## Develop\n\nThe only source file is ```index.js```.\n\nIt is written in ES6, transpiled by [babel](https://babeljs.io/) and tested with [mocha](https://mochajs.org) and [expect.js](https://github.com/Automattic/expect.js).\n\n### Scripts\n\n* Install dependencies\n```shell\n$ npm install\n```\n\n* Watch source changes and generate runnable bundle repeatedly\n```shell\n$ gulp watch\n```\n\n* Tests\n```shell\n$ npm test\n```\n\n* Watch source changes and run tests repeatedly\n```shell\n$ gulp tdd\n```\n\n* Package and generate minified bundles to dist directory\n```shell\n$ gulp minify\n```\n\n* Lint\n```shell\n$ npm run lint\n```\n","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptalks%2Fmaptalks.animatemarker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaptalks%2Fmaptalks.animatemarker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaptalks%2Fmaptalks.animatemarker/lists"}