Skip to content

Instantly share code, notes, and snippets.

@deedubs
Created March 14, 2013 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deedubs/42ff5db8f5953f238b77 to your computer and use it in GitHub Desktop.
Save deedubs/42ff5db8f5953f238b77 to your computer and use it in GitHub Desktop.
var popup = new L.popup({offset: new L.Point(0, -30)}, marker)
.setContent(o.tooltipContents());
marker.on('mouseover', function () {
marker.setZIndexOffset(1000);
clearTimeout(this.hideTimeout);
this.showTimeout = setTimeout(function () {
popup.setLatLng(marker.getLatLng())
Map.$map.addLayer(popup);
}, 200);
});
marker.on('mouseout', function () {
marker.setZIndexOffset(-1000);
clearTimeout(this.showTimeout);
this.hideTimeout = setTimeout(function () {
Map.$map.removeLayer(popup);
}, 500);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment