From 5acc673c6894ed74ce5d10a1e9d65fb9d4b9b7d6 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Mon, 2 Dec 2013 16:46:24 +0100 Subject: [PATCH] Add layer to forEachFeatureAtPixel callbacks in examples --- examples/icon.js | 9 +++++---- examples/synthetic-points.js | 2 +- examples/vector-layer.js | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/examples/icon.js b/examples/icon.js index 82e1d5ae53..4297145edf 100644 --- a/examples/icon.js +++ b/examples/icon.js @@ -68,9 +68,10 @@ map.addOverlay(popup); // display popup on click map.on('singleclick', function(evt) { - var feature = map.forEachFeatureAtPixel(evt.getPixel(), function(feature) { - return feature; - }); + var feature = map.forEachFeatureAtPixel(evt.getPixel(), + function(feature, layer) { + return feature; + }); if (feature) { var geometry = feature.getGeometry(); var coord = geometry.getCoordinates(); @@ -89,7 +90,7 @@ map.on('singleclick', function(evt) { // change mouse cursor when over marker $(map.getViewport()).on('mousemove', function(e) { var pixel = map.getEventPixel(e.originalEvent); - var hit = map.forEachFeatureAtPixel(pixel, function(feature) { + var hit = map.forEachFeatureAtPixel(pixel, function(feature, layer) { return true; }); if (hit) { diff --git a/examples/synthetic-points.js b/examples/synthetic-points.js index c740881fcd..ac139f50d5 100644 --- a/examples/synthetic-points.js +++ b/examples/synthetic-points.js @@ -64,7 +64,7 @@ var map = new ol.Map({ $(map.getViewport()).on('mousemove', function(e) { var pixel = map.getEventPixel(e.originalEvent); - var hit = map.forEachFeatureAtPixel(pixel, function(feature) { + var hit = map.forEachFeatureAtPixel(pixel, function(feature, layer) { return true; }); diff --git a/examples/vector-layer.js b/examples/vector-layer.js index 53e52763d5..3962958771 100644 --- a/examples/vector-layer.js +++ b/examples/vector-layer.js @@ -59,7 +59,7 @@ var highlight; var displayFeatureInfo = function(pixel) { var oldHighlight = highlight; - var feature = map.forEachFeatureAtPixel(pixel, function(feature) { + var feature = map.forEachFeatureAtPixel(pixel, function(feature, layer) { return feature; });