marker-animate

WebJar for marker-animate

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

marker-animate
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

marker-animate
WebJar for marker-animate
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/viskin/marker-animate

Download marker-animate

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/marker-animate/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>marker-animate</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/marker-animate/
implementation 'org.webjars.npm:marker-animate:0.0.1'
// https://jarcasting.com/artifacts/org.webjars.npm/marker-animate/
implementation ("org.webjars.npm:marker-animate:0.0.1")
'org.webjars.npm:marker-animate:jar:0.0.1'
<dependency org="org.webjars.npm" name="marker-animate" rev="0.0.1">
  <artifact name="marker-animate" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='marker-animate', version='0.0.1')
)
libraryDependencies += "org.webjars.npm" % "marker-animate" % "0.0.1"
[org.webjars.npm/marker-animate "0.0.1"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : jquery jar [0,)
org.webjars.npm : jquery-easing jar [0.0.1,0.0.2)

Project Modules

There are no modules declared in this project.

Animated marker movement in Google Maps

A nice alternative to marker.setPosition(latLng). Include jQuery and jQuery Easing Plugin for more easing options.

Demo: http://robsite.net/static/markermove/markermove.html (click on the map)

Usage

Include markerAnimate.js after Google Maps and call animateTo on a google.maps.Marker:

// params:
// newPosition        - the new Position as google.maps.LatLng()
// options.duration   - animation duration in ms (default 1000)
// options.easing     - easing function from jQuery and/or the jQuery easing plugin (default 'linear')
// options.complete   - callback function. Gets called, after the animation has finished

marker.animateTo(newPosition [, {easing: 'easeOutBounce', duration: 1000, complete: function(){}}]);

Example

var marker = new google.maps.Marker({position: new google.maps.LatLng(0,0), map: myMap, title: 'Hello World!'});
var newPosition = new google.maps.LatLng(13,42);

// move marker in 1000ms and with linear animation.
marker.animateTo(newPosition); 

// or with callback and options for easing and duration in milliseconds. Needs jQuery Easing Plugin.
marker.animateTo(newPosition, {  easing: "easeOutBounce",
                                 duration: 1000,
                                 complete: function() {
                                   alert("animation complete");
                                 }
                              });

Versions

Version
0.0.1