New answers tagged


You can initialize your Borne geoJson layer without any data but with a styling function specified in the options: var Borne = new L.GeoJSON(false, { style: function (feature) { return {color:}; } }); This style will be applied to any data you add later with addData.


You can use the show() (the sublayer you have clicked on) or hide() (the rest of the sublayers) methods as explained in this tutorial.


Wanted to make a comment, but I don't have any reputation! Your JsFiddle is great Jürgen but I needed a little more fonctionality, and know I want to share. Added: Better pan (even if not zoomed) Icon changing on div click Marker open on div click and on Icon click Hope that helps somebody:


If you want to perform a simple action, you can just use the onclick attribute, like this: .bindPopup( "<button id='clickHere' onclick='alert(...)'> <strong> stuff </strong> </button>" )) An other, slightly more difficult way to do this would be to catch the popupopen event and bind an action to the onclick event inside it: ...

Top 50 recent answers are included