Skip to content
Advertisement

Tag: leaflet

Prevent moveend event being fired in Leaflet after setView

I have a simple question that has me stumped: In a Leaflet application, I have an event listener for clicking elements on the map: However, the setView method also triggers a ‘map moved’ event, which I do not want to fire. Using either plain JavaScript or jQuery, can I prevent any other event from firing while inside the click event

leaflet map shows up grey

I’m starting leaflet.js with the quickstart but my map shows as grey… is there something I’m missing? script.js: style.css: index.html: Gives me: Answer You need to implement the next section of the Quick Start Guide: you’ve initialized the map, but haven’t added any tile layers to it, hence gray. So read on to the section beginning with Next we’ll add

Using panTo and panBy simultaneously

I would like to create a map with some pins on it (using leaflet). When the user clicks on one of them, the map should move until the pin is at the bottom of the map in the horizontal center. My map is 400 pixels hight, so I’m using this code: It’s working like a charm – only the IE

Advertisement