Skip to main content
added 32 characters in body
Source Link
Oto Kaláb
  • 6.9k
  • 3
  • 31
  • 53

var stateFeature = map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) { // If layer is undefined, that means it's a feature from a FeatureOverlay if (layer) { return feature; } }, null, function (layer) { return layer === statesLayer; });

var stateFeature = map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) {
  // If layer is undefined, that means it's a feature from a FeatureOverlay
  if (layer) {
    return feature;
  }
}, null, function (layer) {
  return layer === statesLayer;
});

The feature is undefined.

var stateFeature = map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) { // If layer is undefined, that means it's a feature from a FeatureOverlay if (layer) { return feature; } }, null, function (layer) { return layer === statesLayer; });

The feature is undefined.

var stateFeature = map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) {
  // If layer is undefined, that means it's a feature from a FeatureOverlay
  if (layer) {
    return feature;
  }
}, null, function (layer) {
  return layer === statesLayer;
});

The feature is undefined.

Source Link

var stateFeature = map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) { // If layer is undefined, that means it's a feature from a FeatureOverlay if (layer) { return feature; } }, null, function (layer) { return layer === statesLayer; });

The feature is undefined.