Blush... Currently it (the selection style) is hardcoded. How is this for a way of handling this:

There can be an object on each map's blackboard that is the selection style. You can get that style and modify however you desire. Another idea is to have each layer have its own selection style but we have to becareful there because it could go a little crazy after a while.

Jesse



Mark Presling wrote:
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

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

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

Reply via email to