There's information and examples in the API Help documentation. It looks
like you have your functionality coded correctly, but your question was to
how to execute it only when the map loads. In that case, use the
onMapLoaded event just like you are using onViewChanged. Keep in mind that
as the user moves around the map and the legend refreshes, the legened tries
to re-expand so you will probably have to use onViewChanged in addition.
Andy
wrote in message news:5625819@discussion.autodesk.com...
Thanks,
Have you got an example or a web site where I can find it?