Map legend - autosizing the legend within a panel


Author
Message
Kevin Harrison 1
Kevin Harrison 1
Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)
Group: Forum Members
Posts: 176, Visits: 1.9K

Hi

I use  mapLegend.Create((Panel)legendControl) to add my legend to the map. I notice that the help says that the panel is automatically resized to the height of the legend.  However, I want the legend to resize within the panel, so that its size is automatically adjusted as I resize the control hosting the map and the legend, rather than being partialy hidden.  How can I achieve this?

Thanks, Kevin


Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K

Hi,

You will have to manually create you legend. For example you may create a bitmap from the legend info and then put the bitmap in an image box. You should create your own legend class that inherits the NMapLegendValue or the NMapLegendRangle class. Then you will be able to use the protected GetColor and GetValue methods to create your image.



Best Regards,
Nevron Support Team


Kevin Harrison 1
Kevin Harrison 1
Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)
Group: Forum Members
Posts: 176, Visits: 1.9K
Can you provide an example please?
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
To receive a code example, you will have to submit a support ticket or contact Nevron Support.

Best Regards,
Nevron Support Team


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search