Hi all. I have got my own view that lists features currently displayed on the map for a particular layer. I have got it so that when I select a feature in the list a Filter is set on the layer with the id of the selected feature. When that happens it displays a little orange square/circle on the feature.

Here is the code:

   public void highlightEventOnMap(String id) {
       IMap map = ApplicationGIS.getActiveMap();
       LayerImpl eventLayer = (LayerImpl) getLayerByName(LAYER_ROADEVENT, map);
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();
       }
   }


By calling ILayer.setFilter(filter) there is a small orange mark put on the map on top of the feature graphic. Note that this happens by default and I just discovered it by accident one day.

What I want to know is how do I change the style of that mark? Is there a way of modifying it? I believe that there is a selection layer or something that is probably doing this. Do I need to retrieve that layer and apply a style to it or something similar? And if so, how do I get hold of that layer?

Thanks in advance,
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:[EMAIL PROTECTED]
tel;home:+6442322774
tel;cell:+6421549540
version:2.1
end:vcard

_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel

Reply via email to