[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[udig-devel] Selection filter changed
|
Hi all,
Something else has changed since my last source update to revision 19235
(20/04/06). I used to use LayerImpl.setFilter() to highlight a feature
on the map using a FID filter. Now this doesn't seem to work correctly.
It just doesn't do anything at all and I can't seem to track down why.
Has anyone changed something to do with the selection stuff? Should I be
doing this a new way?
FYI, here is the code I am using to do this:
IMap map = ApplicationGIS.getActiveMap();
LayerImpl eventLayer = (LayerImpl) getLayerByName(LAYER_ROADEVENT, map); //My own method
FilterFactory filterFactory = new FilterFactoryImpl();
CompareFilter filter = null;
try {
FeatureSource featureSource = (FeatureSource) eventLayer.getResource(
FeatureSource.class, null);
filter = filterFactory.createCompareFilter(CompareFilter.COMPARE_EQUALS);
FeatureType featureType = featureSource.getFeatures().getSchema();
filter.addLeftValue(filterFactory.createAttributeExpression(featureType, "roadeventid"));
filter.addRightValue(filterFactory.createLiteralExpression(id));
eventLayer.setFilter(filter);
} catch (Exception e) {
e.printStackTrace();
}
Thanks,
Mark
--
This message has been scanned for viruses and dangerous
content by MailScanner, and is believed to be clean.
begin:vcard
fn:Mark Presling
n:Presling;Mark
email;internet:mark@xxxxxxxxxxxx
tel;home:+6442322774
tel;cell:+6421549540
version:2.1
end:vcard