Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.

dagjomar/Leaflet.ParallaxMarker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ARCHIVED!

This repository is not maintained, and is not updated to work with Leaflet v2.0 either. If you like it, perhaps fork it, or reproduce it and credit the original project somehow :)

BTW - I have many other interesting repositories, so check them out at https://github.com/dagjomar

Leaflet.ParallaxMarker

Markers that move with a parallax effect in relation to the base map.

Demos / Examples

See demos/examples at https://dagjomar.github.io/Leaflet.ParallaxMarker/.

Screencapture GIF

Screencapture GIF

How to use

The option property parallaxZoffset determines how much of a parallax effect you want. A higher number, means more effect. 0 means it will be stationary on the map, as in no effect at all

Example

The following example will stack a bunch of markers on top of each other in the z-axis Notice that the offset doubles by a factor of 2 for a nice realistic effect

Screencapture GIF

    var center = {lat: 63.417103647850126, lng: 10.403537750244142};

    L.Marker.parallax(center,{ parallaxZoffset: 0}).addTo(map);
    L.Marker.parallax(center,{ parallaxZoffset: 2}).addTo(map);
    L.Marker.parallax(center,{ parallaxZoffset: 4}).addTo(map);
    L.Marker.parallax(center,{ parallaxZoffset: 8}).addTo(map);
    L.Marker.parallax(center,{ parallaxZoffset: 16}).addTo(map);
    L.Marker.parallax(center,{ parallaxZoffset: 32}).addTo(map);

TODO

  • Make things work smoother on zoom animation

About

No description, website, or topics provided.

Resources

License

Stars

46 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors