Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to programmatically apply MapXtreme Themes
    primarykey
    data
    text
    <p>I maintain a Desktop application using MapXtreme 7.0 and I have trouble finding much documentation or useful examples (I do have the pdfs, samples etc that come on the install discs)</p> <p>Currently I am trying to programmaticly apply an IndividualValueTheme to a FeatureLayer. I can apply a standard default theme, I can also show a ModifyIndValueThemeDlg and let the user change the theme. However what I want to do is apply my own theme to the layer without user intervention.</p> <p>The following code attempts to do this but results in the Layer showing with the default IndividualValueTheme (ie not with my styles)</p> <p>Any help would be greatly appreciated</p> <pre><code>void ApplyTheme(FeatureLayer lyr) { if (lyr.Modifiers.Contains(HarvOpsTheme) || lyr.Modifiers.Contains(HarvOpsRangedTheme)) return; HarvOpsTheme = new IndividualValueTheme(lyr, "iOperationType","HarvOpsTheme"); lyr.Modifiers.Append(HarvOpsTheme); HarvOpsTheme.Bins[0].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(255, 255, 0))); HarvOpsTheme.Bins[1].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(0, 255, 0))); HarvOpsTheme.Bins[2].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(128, 128, 0))); HarvOpsTheme.Bins[3].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(192, 128, 0))); HarvOpsTheme.Bins[4].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(0, 128, 0))); HarvOpsTheme.Bins[5].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(0, 205, 128))); HarvOpsTheme.Bins[6].Style.ApplyStyle(GetHollowAreaStyle(Color.FromArgb(255, 0, 0))); HarvOpsTheme.Apply(HarvOpsTheme); HarvOpsTheme.RecomputeStyles(); lyr.Invalidate(); } AreaStyle GetHollowAreaStyle(Color color) { return new AreaStyle { Interior = StockStyles.HollowFillStyle(), Border = new SimpleLineStyle(new LineWidth(1,LineWidthUnit.Pixel), 1, color) }; } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload