MapViewer Redline Color and Fill

I just created a .NET wrapper project to manage all functions of MapViewer ActiveX control.

Now I try to figure out how to manage redline colors and fills correctly. And I'm in trouble.

I would like to set color, fill color, and is filled properties. Since there is no such methods I tried to combine available functions:

  • I create a new element via StartCommand(number
  • I set new element line (ARGB!) )color by set:
  • ActiveElementColor to the RGB components of the color in BGR order
  • ActiveElementTransparency to the (opposite) alpha (A) compontent of the color. (opposite means: 255-color.A since this means T in TBGR)

I also wrote a method to get this values in .NET System.Drawing.Color format. It all works fine, I successfully get and set this color/transparency values.

Now I would like to create 2 more method:

  1. Get/Set redline element's fill color
  2. Get/Set if rendline elemets are filled

Its not so easy, since there is no properties such as ZoomAreaFillColor and ZoomAreaFilled

I found a property ActiveElementFillColor but there is no any documentation for that. So I don't know if it accepts TBGR or just BGR value? 

On the other side when I create new element by calling StartCommand method I couldn't set if new element is filled. And there is no any global settings for that. I found in API there is a functions to create elements programmatically. These functions accept isfilled argument like CreatePolygonElement (points, isFilled) but when I start element creation by start a command I don't know how should I set IsFilled?

ps.: Is there a GWP SDK  for v08.11.09.028? I currently use MapViewerApiReference for v08.11.07.430 but I use GWP v08.11.09.028.

  •  See the following property and method description.  The Geo Web Publisher SDK should be available soon on SELECT download.

    ActiveElementFillColor Property   

    Description

    A read/write integer that specifies the fill color to be assigned to subsequently created editable overlay (redline) shapes. Changing the active fill color has no effect on previously created elements.

    The value encodes alpha, color's red, green, and blue components in TBGR order. For example, 0x7D0000FF specifies semi-translucent red, while 0x0FF00000
    specifies opaque blue.

    Remarks

    For legacy reasons, ActiveElementColor sets both outline and fill color. Although, the first call to ActiveElementFillColor will prevent any next ActiveElementColor calls to modify the fill color.

    SetCommandIntOption Method   

    SetCommandIntOption (commandID, option, value)

    Description

    Sets a command option.

    Parameters

    commandID
    An integer that specifies a command ID on which set information.
    option
    Command option to be set. This can be one of the flags below.
    value
    An integer that contains the option setting.
    OptionDescription
    1 Shape rendering mode: 0 = Outline, 1 = Fill, 2 =
    FillOutline

  • Thank you for your answer! The SetCommandIntOption was exactly what I needed.

    But after a quick test I found a bug in this method. Just call it 2 times with same parameters. It throws an exception. I tested:

    SetCommandIntOption(317,1,2);  //SUCCESS

    SetCommandIntOption(317,1,2);  //EXCEPTION: The value out of the expected range.

    ps.: Error message may different because I translated it from hungarian.