0

Just finished building my first mobile map in ArcGIS mobile project center and opened it in ArcGIS for windows mobile but quickly realized there is no way to turn on a legend to show what the symbology represents?

Is there a way to display a legend?

2
  • Does MapPage not have a "Layer visibility..." item in the menu? resources.arcgis.com/en/help/windows-mobile-sdk/concepts/…
    – Thomas
    Oct 19, 2015 at 16:54
  • Layer visibility allows you to turn on and off layers - it doesn't show what symbols represent which layers. I'm looking for something like the following: Legend Road ====== River ~~~~~~~~ Commercial Land ///// Oct 19, 2015 at 17:26

1 Answer 1

1

If you're looking for a properly symbolized legend in ArcGIS for Windows Mobile, you will unfortunately have to write your own implementation using the LegendItem class to render the swatches.

As a start, you would do something similar to this...

size = new Size(25, 25);  
IList<LegendItem> legendList = layer.Renderer.GetLegendSwatches(YOUR_PANEL.BackColor, size.Width, size.Height);  
if (legendList != null)  
{  
  foreach (LegendItem legendSwatch in legendList)  
  { 
    PictureBox picture = new PictureBox();  
    picture.Size =  size;   
    picture.Image = legendSwatch.Image;  
    picture.Location = // .......
    YOUR_PANEL.Controls.Add(picture);  
  }  
}
1
  • I trust Thomas' answer but will never have the time to implement. Unfortunate that the off the shelf app doesn't have a legend. Oct 20, 2015 at 19:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.