Register  |  Login
ThinkGeo - GPS Tracking and Mapping Solutions  |  Visit the Wiki  |  Find us on: Twitter Facebook Google+ LinkedIn

Discussion Forums

The online community for users of Map Suite GIS components

Cant show Labels
Last Post 04-13-2012 02:28 PM by Ryan. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
ahmedUser is Offline
Level 1
Level 1
Posts:15
Avatar

--
04-12-2012 05:01 AM

Iam facing a problem with adding labels I have tried the sample provided with pocket PC and it is working but when I done the same it is not showing the labels and I have tried to simply replace  the shp file in the sample with my shp file and still not working so I dont know what I have done wrong.

RyanUser is Offline
ThinkGeo Support
MVP
MVP
Posts:837
Avatar

--
04-12-2012 11:05 AM

Hi Ahmed,

LabelRenderers are setup to work with a specific Shapefile/ColumnName so a LabelRenderer setup for one shapefile may not work work for another shapefile.

In the following example you can see that we have setup a LabelRenderer to poll data from the 'LANDNAME' column:


private void LoadPoly()
        {
            //Load the shape file.
            Layer layer = new Layer(STR_POLY,true);

            //Set and create the Threshold of the layer.
            layer.ThresholdUnit = ThresholdUnits.miles;
            Threshold threshold = new Threshold(15,0);

            //set the propertier of the polygon.
            Color color = Color.Silver;
            SolidBrush solidbrush = new SolidBrush(color);
            AreaSymbol areasymbol = new AreaSymbol(solidbrush);
            SymbolRenderer render = new SymbolRenderer(areasymbol);

            threshold.LabelRenderers.Add(GetLabelRenderer("LANDNAME",0));
            threshold.SymbolRenderers.Add(render);

            //add the threshold to the layer.
            layer.Thresholds.Add(threshold);

            map1.Layers.Add(layer);
        }

You will need to check your shapefile's DBF to see what columns you have available to create labels from.

 

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

ahmedUser is Offline
Level 1
Level 1
Posts:15
Avatar

--
04-13-2012 09:57 AM

 Thanks for your reply Ryan; I know what you stated but the problem was that the datum of the shp files should be set to WGS and that solved the problem 

RyanUser is Offline
ThinkGeo Support
MVP
MVP
Posts:837
Avatar

--
04-13-2012 02:28 PM
Hi ahmed,

Glad to hear this is working for you!

Need to know how to do something with Map Suite? Check our Wiki Code Samples Library and view the source code of any sample right in your web browser.

You are not authorized to post a reply.

Active Forums 4.2