You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem
A common requirement for map display is to be able to specify the order in which features are drawn. For instance, when drawing cities you may want to put the biggest cities on top.
The proposed solution
Not decided yet.
Option: Provide custom sorting function
We just introduced a ZOrder. This is used in the MemoryLayer but not anywhere else. In order to make this consistent we need to start sorting on ZOrder everywhere else. This puts a burden on all layer implementations. Also use of the ZOrder may not always be the easiest solution. In some cases the user already has some object with a field indicating the order. Now the ZOrder has to be assigned in the user code. An alternative that I am thinking about is to provide a function to do the sorting. It has a default implementation, or perhaps no implementation, in which case the provider determines the order. The user can provide a function which takes the list of features as input on which to apply custom sorting logic. Any field (or fields) could be used. Advantages: We can remove ZOrder (one property less). We do not have to implement sorting on ZOrder for all layers (and perhaps providers?).
Note, Currently the IFeature has some fixed properties and has the option for 'custom properties' through the dictionary. This solution was introduced in SharpMap, long ago. Nowadays there are alternative options, like generics. This is a separate feature request but may be related.
The text was updated successfully, but these errors were encountered:
Perhaps we should remove a special sorting function for all existing layers (MemoryLayer included) and let the user decide, which is the right one to use. This would be possible with the given implementation in PR #2438.
The problem
A common requirement for map display is to be able to specify the order in which features are drawn. For instance, when drawing cities you may want to put the biggest cities on top.
The proposed solution
Not decided yet.
Option: Provide custom sorting function
We just introduced a ZOrder. This is used in the MemoryLayer but not anywhere else. In order to make this consistent we need to start sorting on ZOrder everywhere else. This puts a burden on all layer implementations. Also use of the ZOrder may not always be the easiest solution. In some cases the user already has some object with a field indicating the order. Now the ZOrder has to be assigned in the user code. An alternative that I am thinking about is to provide a function to do the sorting. It has a default implementation, or perhaps no implementation, in which case the provider determines the order. The user can provide a function which takes the list of features as input on which to apply custom sorting logic. Any field (or fields) could be used. Advantages: We can remove ZOrder (one property less). We do not have to implement sorting on ZOrder for all layers (and perhaps providers?).
Note, Currently the IFeature has some fixed properties and has the option for 'custom properties' through the dictionary. This solution was introduced in SharpMap, long ago. Nowadays there are alternative options, like generics. This is a separate feature request but may be related.
The text was updated successfully, but these errors were encountered: