Script and makefile adjustments for updating extlib
[larjonas-mediagoblin.git] / extlib / leaflet / src / layer / vector / Path.Popup.js
blobb82a4920f15372d88103e681702e881ab7d06234
1 /*
2 * Popup extension to L.Path (polylines, polygons, circles), adding bindPopup method.
3 */
5 L.Path.include({
6 bindPopup: function(content, options) {
7 if (!this._popup || this._popup.options !== options) {
8 this._popup = new L.Popup(options);
10 this._popup.setContent(content);
12 if (!this._openPopupAdded) {
13 this.on('click', this._openPopup, this);
14 this._openPopupAdded = true;
17 return this;
20 _openPopup: function(e) {
21 this._popup.setLatLng(e.latlng);
22 this._map.openPopup(this._popup);
24 });