[OpenLayers-Users] Filtering by Feature Id

Wendy Cameron Wendy.Cameron at justice.govt.nz
Wed Aug 25 01:55:30 EDT 2010


Hi All
 
Sorry for the repost:
 
I am trying to load features by their feature id
I have the following code:
 
var options = {'MV_BLOCK_SUMMARY.3635': 'MV_BLOCK_SUMMARY.3636'};
    var blockFilter = new OpenLayers.Filter.FeatureId(options);
     
    var wfslayer = new OpenLayers.Layer.Vector("Wendy Testing", {
     //styleMap: styles,
     strategies: [new OpenLayers.Strategy.BBOX()],
     reportError: true,
     visibility: true,
     filter: blockFilter,
     protocol: new OpenLayers.Protocol.WFS({
      url:  "http://localhost:8080/geoserver/wfs",
      featureType: "MV_BLOCK_SUMMARY",
      propertyNames: ["BLOCK_NAME", "TITLE_ORDER", "TITLE_ORDER_DATE", "BLOCK_AREA", "MINUTE_BK_REF", "TOTAL_SHARES", "TOTAL_OWNERS", "BLOCK_LOCATION"],
      featureNS: "http://justice.govt.nz/gis",
      featurePrefix: "gistest",
      version: "1.1.0" ,
      srsName: "EPSG:900913",
      geometryName: "BLOCK_LOCATION"
      })
    });
    map.addLayer(wfslayer);
 
But the javascript:exception I get when using the FeatureId filter is as follows:
uncaught exception: Filter writing not supported for rule type: undefined
 
I cant use 

    var blk1Filter = new OpenLayers.Filter.Comparison({
     type: OpenLayers.Filter.Comparison.EQUAL_TO,
     property: "BLOCK_NAME",
     value: "Huruhi Urupa"
    });
 
As the i want to search by the feature id which is not a property.
Any advice would be greatly appreciated.
 
Regards Wendy

====================================================================================

This e-mail message and attachments do not necessarily reflect the views of 
the New Zealand Ministry of Justice and may contain 
information that is confidential and may be subject to legal privilege. If you 
are not the intended recipient, you are hereby notified that you must not use, 
disseminate, distribute or copy this e-mail message or its attachments. If you 
received this message in error, please notify the Ministry of Justice 
by telephone (call collect: 00-64-4-918-8800) or return the 
original message to us by e-mail, and destroy any copies.
Thank you.

====================================================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100825/7988cadd/attachment.html


More information about the Users mailing list