- .on("mouseover", ".query-results li.query-result", function () {
- var geometry = $(this).data("geometry");
- if (geometry) map.addLayer(geometry);
- $(this).addClass("selected");
- })
- .on("mouseout", ".query-results li.query-result", function () {
- var geometry = $(this).data("geometry");
- if (geometry) map.removeLayer(geometry);
- $(this).removeClass("selected");
- })
- .on("mousedown", ".query-results li.query-result", function () {
- var moved = false;
- $(this).one("click", function (e) {
- if (!moved) {
- var geometry = $(this).data("geometry");
- if (geometry) map.removeLayer(geometry);
-
- if (!$(e.target).is("a")) {
- $(this).find("a").simulate("click", e);
- }
- }
- }).one("mousemove", function () {
- moved = true;
- });
- });
+ .on("mouseover", ".query-results a", showResultGeometry)
+ .on("mouseout", ".query-results a", hideResultGeometry);