Global Mapper v25.0

Can not add elevation to Point in vector layer

ehsan
ehsan Global Mapper User
edited October 2011 in SDK
Hi,
I added a vector layer by GM_AddCustomVectorLayer then use GM_setLayerElevationAttribute and config for "Z" value for attribute of elevation.
But when added a point to my layer and show 3D view i can NOT show elevation point like Global mapper application.

Please help me..
tank you for your supports...

Comments

  • global_mapper
    global_mapper Administrator
    edited October 2011
    Can you show me how you added the point so that I can see if you are setting up the elevation attribute correctly?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • ehsan
    ehsan Global Mapper User
    edited October 2011
    Hi,
    this is a method that I use for add point to layer....
    Please guide me to create 3D view for my points...
    thanks...


    public unsafe bool AddPoint(string layerName, double latitude, double longitude, string symbolName, string caption,
    int rotation, out int index)
    {
    bool ret;
    string attName = "ELEVATION";
    string attVal = "5000 m";
    fixed (char* theAttrNamePtr = attName, theAttrValPtr = attVal)
    {
    var theAttrValList = new GM_AttrValue_t[1];
    theAttrValList[0].mName = theAttrNamePtr;
    theAttrValList[0].mVal = theAttrValPtr;

    fixed (GM_AttrValue_t* theAttrValListPtr = &theAttrValList[0])
    {
    var pointFeatureT = new GM_PointFeature_t();
    pointFeatureT.mPointStyle = new GM_PointStyle_t();
    pointFeatureT.mPointStyle.mSymbolName = symbolName;
    pointFeatureT.mPointStyle.mDrawLabelAlways = 1;
    pointFeatureT.mPointStyle.mDrawLabel = 1;
    pointFeatureT.mPointStyle.mRotation = (ushort) rotation;
    pointFeatureT.mPointStyle.mScale = 0;
    pointFeatureT.mPos.mX = longitude;
    pointFeatureT.mPos.mY = latitude;
    pointFeatureT.mFeatureInfo.mClass = (ushort)PointFeatureClass_t16.PFC_UNKNOWN;
    pointFeatureT.mFeatureInfo.mName = caption;
    pointFeatureT.mFeatureInfo.mAttrList = (IntPtr)theAttrValListPtr;
    pointFeatureT.mFeatureInfo.mNumAttrs = 1;
    LastError = GlobalMapperDLL.GM_AddPointToVectorLayer(_allLayersHandle[layerName], ref pointFeatureT, 0);
    ret = LastError == GlobalMapperDLL.GM_Error_t32.GM_Error_None;
    }
    }

    index = (int) GetLayerInfo(_allLayersHandle[layerName]).mNumPoints - 1;
    DrawLayersToBitmap();
    return ret;
    }
  • global_mapper
    global_mapper Administrator
    edited October 2011
    What are you using for 'symbolName'? Does the feature show up in the 2D view? Your code looks correct to me. If you check the Options dialog in the 3D view is the option checked to display vector features in 3D?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com