FeatureLayer cannot share DefaultFeatureCollection

Description

Have an interesting one here:

1) following the example of the map style tutorial
2) Two layers each created from the same "data"
3) one was used as a basemap
4) the second had a filter dynamically applied to show selection

The feature collection was created by hand:

SimpleFeatureCollection collection = FeatureCollections.newCollection();

And populated from a CSV file.

And then two layers were created:

baseLayer = FeatureLayer(collection, style);
map.addLayer(facesLayer);

.map.addLayer(facesLayer);

FeatureLayer(collection, selectStyle);
map.addLayer(facesLayer);

And the selectLayer was never rendered; not sure why.

The solution was to read in a second FeatureCollection and allow each layer to operate independently.

Environment

None

Activity

Show:
codehaus
April 10, 2015, 3:06 PM

CodeHaus Comment From: aaime - Time: Sun, 20 Nov 2011 09:10:27 -0600
---------------------
It is a coding mistake as far as I understand it: the feature source is declaring features as being detached (thus one should be able to alter them at will) but it seems they are not?

Either that or there is a bug in the renderer.

codehaus
April 10, 2015, 3:06 PM

CodeHaus Comment From: jgarnett - Time: Sat, 19 Nov 2011 17:19:14 -0600
---------------------
Fair enough; I am going to view this as a coding mistake rather then a problem with documenting a limitation.

codehaus
April 10, 2015, 3:06 PM

CodeHaus Comment From: mbedward - Time: Wed, 16 Nov 2011 01:00:54 -0600
---------------------
Because you made it so ?

This one is on my list of issues to talk to you about. I've been waiting until you returned from planet ResourceId.

codehaus
April 10, 2015, 3:06 PM

CodeHaus Comment From: jgarnett - Time: Tue, 15 Nov 2011 23:40:59 -0600
---------------------
Why is this marked as a documentation bug?

codehaus
April 10, 2015, 3:06 PM

CodeHaus Comment From: aaime - Time: Mon, 11 Jul 2011 16:00:56 -0500
---------------------
Depending on the flags reported by the feature source the streaming renderer gets the geometry will be modified in place, or cloned. In your case they should be cloned, but what about checking anyways?

If they are modified without cloning they will be rendered once only, selection or not.

If it's not the in place modification of geometries maybe the default feature collection is stateful... or maybe we are building sub-collections that are?

Assignee

Unassigned

Reporter

codehaus

Triage

None

Components

Priority

Medium