Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
560
how not to show the state names for few states in USA map
posted

I want to show the state names for only interested states, like Nevada, Texas etc. So other states like Georgia should not display the names.

So the user can click on the states, which are displaying the names. How I can do that? Pls help.

  • 30692
    Verified Answer
    Offline posted

    Modify the handler I defined in the sample here: http://forums.infragistics.com/forums/t/36139.aspx

    to read:

    private void MapLayer_Imported(object sender, Infragistics.Silverlight.Map.MapLayerImportEventArgs e)

            {

                foreach (MapElement ele in theMap.Layers[0].Elements)

                {

                    if (_allowedNames.ContainsKey(ele.Name))

                    {

                        ele.IsClickable = true;

                        ele.IsSelectable = true;

                    }

                    else

                    {

                        ele.Caption = "";

                        ele.IsClickable = false;

                        ele.IsSelectable = false;

                    }

                }

            }

    The new line is the ele.Caption = ""; this blanks out the caption for any state you do not wish to display the caption for.

    -Graham