Skip to main content
edited tags
Link
nmtoken
  • 13.6k
  • 5
  • 38
  • 89

How works Openlayersdoes OpenLayers GetFeature Filterfilter strategy work?

added 98 characters in body
Source Link
barteloma
  • 1.7k
  • 5
  • 24
  • 47

I want to select on map that "res_id = 182" but that is selecting all objects on the map.

var filter = new OpenLayers.Filter.Comparison({
    type: OpenLayers.Filter.Comparison.EQUAL_TO,
    property: "res_id",
    value: "182"
});

var  filterStrategy = new OpenLayers.Strategy.Filter({filter: filter});

var control = new OpenLayers.Control.GetFeature({
    protocol: OpenLayers.Protocol.WFS.fromWMSLayer(mylayer),
    strategies: [new OpenLayers.Strategy.Fixed(),filterStrategy],
    box: true,
    multipleKey: "shiftKey",
    toggleKey: "ctrlKey"
});

I actually want to select an area on map and filter selected items by attribute from combobox.

I want to select on map that "res_id = 182" but that is selecting all objects on the map.

var filter = new OpenLayers.Filter.Comparison({
    type: OpenLayers.Filter.Comparison.EQUAL_TO,
    property: "res_id",
    value: "182"
});

var  filterStrategy = new OpenLayers.Strategy.Filter({filter: filter});

var control = new OpenLayers.Control.GetFeature({
    protocol: OpenLayers.Protocol.WFS.fromWMSLayer(mylayer),
    strategies: [new OpenLayers.Strategy.Fixed(),filterStrategy],
    box: true,
    multipleKey: "shiftKey",
    toggleKey: "ctrlKey"
});

I want to select on map that "res_id = 182" but that is selecting all objects on the map.

var filter = new OpenLayers.Filter.Comparison({
    type: OpenLayers.Filter.Comparison.EQUAL_TO,
    property: "res_id",
    value: "182"
});

var  filterStrategy = new OpenLayers.Strategy.Filter({filter: filter});

var control = new OpenLayers.Control.GetFeature({
    protocol: OpenLayers.Protocol.WFS.fromWMSLayer(mylayer),
    strategies: [new OpenLayers.Strategy.Fixed(),filterStrategy],
    box: true,
    multipleKey: "shiftKey",
    toggleKey: "ctrlKey"
});

I actually want to select an area on map and filter selected items by attribute from combobox.

Source Link
barteloma
  • 1.7k
  • 5
  • 24
  • 47

How works Openlayers GetFeature Filter strategy

I want to select on map that "res_id = 182" but that is selecting all objects on the map.

var filter = new OpenLayers.Filter.Comparison({
    type: OpenLayers.Filter.Comparison.EQUAL_TO,
    property: "res_id",
    value: "182"
});

var  filterStrategy = new OpenLayers.Strategy.Filter({filter: filter});

var control = new OpenLayers.Control.GetFeature({
    protocol: OpenLayers.Protocol.WFS.fromWMSLayer(mylayer),
    strategies: [new OpenLayers.Strategy.Fixed(),filterStrategy],
    box: true,
    multipleKey: "shiftKey",
    toggleKey: "ctrlKey"
});