Global Mapper v26.0

How to render area features?

JerryLia
JerryLia Global Mapper User
edited September 2008 in SDK
Mike,

When i want to render area features in the custom vector layer, i find that my code can work well with few area features and do not work with plent of area features,why?

My code such as :

Int32 lp_LayerHandle = (Int32) mn_CustomLayerHandle;
IntPtr layerInfoPtr = GlobalMapperDLL.GM_GetLayerInfo(lp_LayerHandle);
GM_LayerInfo_t layerInfo_t = (GM_LayerInfo_t) Marshal.PtrToStructure (layerInfoPtr, typeof (GM_LayerInfo_t));
for (UInt32 k = 0; k < layerInfo_t.mNumAreas; k++)
{

IntPtr ptr = GlobalMapperDLL.GM_GetAreaFeature(lp_LayerHandle, k);
if (ptr.ToInt32() == 0) break;
GM_AreaFeature_t areaInfo = (GM_AreaFeature_t) Marshal.PtrToStructure(ptr, typeof (GM_AreaFeature_t));

GM_AreaStyle_t lt_AreaStyle = areaInfo.mAreaStyle;
lt_AreaStyle.mBrushStyle = GM_BrushStyle_t16.GM_BRUSH_SOLID;
lt_AreaStyle.mBrushColor = (uint) Color.FromArgb(255, 0, 80).ToArgb();

//here is no error code is returned.
GlobalMapperDLL.GM_Error_t32 LastGMError=GlobalMapperDLL.GM_SetAreaFeatureDrawStyle(lp_LayerHandle, k, ref lt_AreaStyle);
GlobalMapperDLL.GM_FreeAreaFeature(ptr);

}

Comments

  • global_mapper
    global_mapper Administrator
    edited September 2008
    Everything looks ok to me. What kidn of problems are you seeing when you have lots of areas?

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • JerryLia
    JerryLia Global Mapper User
    edited September 2008
    None of 24289 area features is rendered.
  • global_mapper
    global_mapper Administrator
    edited September 2008
    Do the areas render if you don't run your loop to edit the drawing style of the areas?
  • JerryLia
    JerryLia Global Mapper User
    edited September 2008
    Mike,
    In fact,there are six area features are rendered and when the k>6,no area feature can be accessed.Zero is returned when the line followed is excuted:

    IntPtr ptr = GlobalMapperDLL.GM_GetAreaFeature(lp_LayerHandle, k);
  • global_mapper
    global_mapper Administrator
    edited September 2008
    It sounds like do not have a license file for the SDK. Without a license file the GM_GetAreaFeature function only returns valid information up to an area index of GM_MAX_NON_REGISTERED_VECTOR_IDX, which has a value of 5. Once you have a valid license file then you can get all of the features.

    Let me know if I can be of further assistance.

    Thanks,

    Mike
    Global Mapper Support
    support@globalmapper.com
  • JerryLia
    JerryLia Global Mapper User
    edited September 2008
    I see,thanks a lot.
    Could you send to me a temp license so that i can study it deeply?I like it very much and soon or later i belive we will pay for it.

    JerryLia@gmail.com