makinacorpus/leaflet.bouncemarker

Name: leaflet.bouncemarker

Owner: Makina Corpus

Description: A plugin for Leaflet to have a bounce animation when adding a Marker to a map

Created: 2013-04-15 08:39:59.0

Updated: 2017-12-03 16:26:35.0

Pushed: 2013-04-18 12:40:26.0

Homepage: null

Size: 105

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Bouncemarker plugin for Leaflet

This little plugin for Leaflet let you animate a marker when you add it on a map.

Watch the demo.

Usage

Usage is very simple. Let's consider we have a Leaflet map:

map = L.map('map');
leLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
tribution: 'Map data &copy; <a href="http://www.osm.org">OpenStreetMap</a>'
ddTo(map);

To benefit from the bouncing effect, you have nothing to do, just use your Marker as usual :

rker([48.85, 2.35]).addTo(map);

You may use the autoBounce option if you do not want your marker to bounce when added to the map (which is the default behavior):

rker([48.85, 2.35], {autoBounce: false}).addTo(map);

You can also use the bounce() function to make a marker bounce, when you want it to :

rker([48.85, 2.35], {autoBounce: false})
dTo(map)
('click', function () {
this.bounce(500, 100);  // Bounce during 500ms from 100px height.
;

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.