popupContent demo
HTML
<link rel="stylesheet" href="https://api.tiles.mapbox.com/mapbox.js/v1.6.3/mapbox.css">
<script src="https://api.tiles.mapbox.com/mapbox.js/v1.6.3/mapbox.js"></script>
<div id="map" style="width: 550px; height: 600px"></div>
JavaScript
/*** little hack starts here ***/
L.Map = L.Map.extend({
openPopup: function (popup) {
// this.closePopup(); // just comment this
this._popup = popup;
return this.addLayer(popup).fire('popupopen', {
popup: this._popup
});
}
}); /*** end of hack ***/
var layerOne = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"name": "Utrecht",
"popupContent": "Pudebit te, inquam, illius tabulae",
"marker-size": "large",
"marker-color": "#de0c14"
},
"geometry": {
"type": "Point",
"coordinates": [
5.11962890625,
52.11325243469631]
}
}, {
"type": "Feature",
"properties": {
"name": "Rotterdam",
"popupContent": "Quarum ambarum rerum cum medicinam pollicetur",
"marker-size": "large",
"marker-color": "#de0c14"
},
"geometry": {
"type": "Point",
"coordinates": [
4.4879150390625,
51.91716758909015]
}
}]
};
var layerTwo = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"name": "Eindhoven",
"popupContent": "Quae fere omnia appellantur ",
"marker-size": "small",
"marker-symbol": "circle",
"marker-color": "#de0c14"
},
"geometry": {
"type": "Point",
"coordinates": [
5.47119140625,
51.45400691005982]
}
}]
};
var layerThree = {
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"name": "Arnhem",
"popupContent": "luxuriae licentiam pollicetur"
},
...