O'Reilly logo

Leaflet.js Essentials by Paul Crickard III

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Animating markers with plugins

In the next two sections, you will learn how to animate markers using the Leaflet.BounceMarker and Leaflet.AnimatedMarker plugins. Animation adds a wow factor to your map, but if overdone, it can make your map appear amateurish.

Bouncing your markers

The Leaflet.BounceMarker plugin does not have a large number of options to customize the markers or their behavior, but it provides a simple animation that is useful when you add markers to the map or on the hover event. You can download and learn more about the plugin at https://github.com/maximeh/leaflet.bouncemarker.

The following steps will show you how to add a bounce marker to your map:

  1. Add a reference to the JavaScript file. There is no CSS file required for this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required