Skip to content

Commit

Permalink
Merge pull request #210 from Zverik/master
Browse files Browse the repository at this point in the history
Hide tooltip without position
  • Loading branch information
jacobtoye committed Nov 3, 2013
2 parents a25788a + 01843c3 commit 5bfa9c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ L.Tooltip = L.Class.extend({
this._map = map;
this._popupPane = map._panes.popupPane;

this._container = map.options.drawControlTooltips ? L.DomUtil.create('div', 'leaflet-draw-tooltip', this._popupPane) : null;
if (map.options.drawControlTooltips) {
this._container = L.DomUtil.create('div', 'leaflet-draw-tooltip', this._popupPane);
this._container.style.visibility = 'hidden';
}
this._singleLineLabel = false;
},

Expand Down Expand Up @@ -41,6 +44,7 @@ L.Tooltip = L.Class.extend({
var pos = this._map.latLngToLayerPoint(latlng);

if (this._container) {
this._container.style.visibility = 'inherit';
L.DomUtil.setPosition(this._container, pos);
}

Expand All @@ -60,4 +64,4 @@ L.Tooltip = L.Class.extend({
}
return this;
}
});
});

0 comments on commit 5bfa9c3

Please sign in to comment.