I programmatically create several layers for my map and I want my layers to be on top of the layers from the original map.

Is there a way I can do that? I also want to be able to put "bring forward/backward" as a menu item in the TOC context menu.

Thanks and Regards


Did you try this?

mapControl.MoveLayerTo(startIndex, endIndex);

Your question is similar to this one:

Right click on layer in TOCControl get a context menu

  • Yes, thanks, i have seen that TOCControl link before, but i also implemented it, but i still couldn't figure out how to move layer up down, thanks. – Kev84 Mar 25 '11 at 17:30
  • @Kev84, your question has multiple parts, TOC context menus, and TOC context menu items, and move map layer up and down. What parts do you still need help with? – patrick Mar 25 '11 at 17:34

Is this for one of the web frameworks or desktop?

  • I suspect the downvote occurred because although this is a good question, it should have been entered as a comment below the original question, rather than a reply. @Artwork provides a good example you can follow. – whuber Mar 25 '11 at 16:18
  • 3
    However, it's hard to comment when you don't have that privilege. – Anthony -GISCOE- Mar 25 '11 at 16:46
  • @Anthony There's a reason for that restriction :-). I guess it's to encourage people to earn reputation first. – whuber Mar 25 '11 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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