I think that each layer should probably have it's own selection style so
that you can highlight different feature types in different ways
depending on the type and the way they are rendered.
For example, on my layer I am using external graphics for each point
feature. Putting a blob on top of the icon isn't really what I need...
I'd like to be able to highlight the edge of the icon in some way (which
I still have to play with). Whereas another layer might have a circle
for points, or another a square which you could simply render another
circle/square of a different color over top of the original.
In the meantime, where can I find that hardcoded style that you are
referring to so that I can attack it and modify it for my needs in the
meantime?
Thanks,
Mark
Jesse Eichar wrote:
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
--
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