layer properties and label drawing

dzsbp
dzsbp Global Mapper User
edited November 2009 in SDK
Hi,

I have two short questions;

first, I'd like to draw labels on a layer. What is the best method to do it?
I did it with setting the text in Point.mFeatureInfo.mName. It works fine, I just don't know whether this is the proper one? And is there a way to wrap a long text in order to appear in two lines?

Secondly, I'd like to change the width of the lines on a (loaded) layer. And maybe the colour. How can I do this?

Thanks in advance,
Zsolt

Comments

  • global_mapper
    global_mapper Administrator
    edited November 2009
    Zsolt,

    Adding a point feature is the proper way to place text. Just use "No Symbol" as the symbol name to just place text with no symbol.

    If you add a new-line character in your text name ('\n') this should cause multi-line text to be displayed.

    You can change the drawing style of a loaded line feature using the GM_SetLineFeatureDrawStyle function.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • dzsbp
    dzsbp Global Mapper User
    edited November 2009
    Hello Mike,

    thanks for the reply!

    Maybe my question wasn't unambiguous, but I've liked to know how can I set all the layers' attributes on a layer..:) I was able to modify only 1 layer's attributes at a time with this function.

    I tried to look around for the proper finction, but unfortunately I haven't found it.

    Could you help me and maybe provide me a little sample code or decription?

    Thanks in advance,
    Zsolt
  • global_mapper
    global_mapper Administrator
    edited November 2009
    Zsolt,

    If all of your features have the same type you can change the default drawing style for a type using the GM_SetLineFeatureClassDrawStyle function. Otherwise there is not a function to change the drawing style for all features in a layer with one call, you'll just need to loop through all of the features in the layer and edit the style. You can call GM_GetLayerInfo to get the number of area, line, and point features in a layer for setting up your loop.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com