This project has moved and is read-only. For the latest updates, please go here.

Custom Theming issue, point always visible

Topics: General Topics, SharpMap v0.9 / v1.x, WinForms Controls
May 31, 2010 at 9:16 AM


For reference what I am trying to do is have a picture list of amenities on locations on the map.  These amenities differ per location (true/false row by row in database).  I don't want them to be visible at various zoom levels and I wish to customize which labels are visible (bathroom,food,bed,etc).

So far my attempts at custom theming have been relatively successful.  My issue comes from making things visible or not.

This is what my delegate theme call looks like:

Private Function GetMiniSiteTheme(ByVal row As SharpMap.Data.FeatureDataRow) As Styles.IStyle
        Dim ret As Styles.VectorStyle = New Styles.VectorStyle
        ret.SymbolOffset = New PointF(0, 0)
        ret.SymbolScale = 0.5 <---this works and affects the sites
        ret.Enabled = False <---this does nothing that I can tell, tried true and false.  Always visible
        ret.EnableOutline = False <---again no difference true or false
        ret.MinVisible = 0 <----doesn't seem to do anything based off values
        ret.MaxVisible = 1 <----doesn't seem to do anything based off values
        Return ret
    End Function

I tried cheating the .enabled (which i thought if false would simply not display) by setting minvisible zoom to 1 and maxzoom to 0.  Nothing changed.  I'm wondering if I'm using values that don't make sense, but theoretically if you reverse those it should become non visible regardless what the actual value is, yet nothing happens.

If I change the symbol scale is does change the size of the object and my current fix is to make the scale 0.  But that's kinda dirty.  Any ideas what I'm doing wrong?  I assume I am misunderstanding something simple here.



May 31, 2010 at 9:49 AM

Hi atrius,

I think at the moment you are in the delegate, things like Min/MaxVisible and Enabled have already been evaluated.

Try setting the Symbol property to null and/or use invisible brushes/pens

Hth FObermaier