locked
How to copy map layer RRS feed

  • Question

  • Hi everyone, I have two Bing maps, one in the main window, the other is in scatterviewitem. Now I want to copy the maplayer of the Bing map in the scatterviewitem to the Bing map in the main window. Do you have any idea on how to do this? Thanks in advance.
    Monday, September 30, 2013 4:15 PM

Answers

  • You have to loop through each item in the existing layer and recreate it. If you try and simply add the existing items to the other layer it will through an error as a WPF item can only have one instance.

    http://rbrundritt.wordpress.com

    Tuesday, October 1, 2013 7:08 AM
  • Thanks for your help. I have another way to solve this: copy all map layers to a list, remove those map layers and copy that list to main map.
    • Marked as answer by Faro Luce Tuesday, October 1, 2013 6:03 PM
    Tuesday, October 1, 2013 6:03 PM

All replies

  • You have to loop through each item in the existing layer and recreate it. If you try and simply add the existing items to the other layer it will through an error as a WPF item can only have one instance.

    http://rbrundritt.wordpress.com

    Tuesday, October 1, 2013 7:08 AM
  • Thanks for your help. I have another way to solve this: copy all map layers to a list, remove those map layers and copy that list to main map.
    • Marked as answer by Faro Luce Tuesday, October 1, 2013 6:03 PM
    Tuesday, October 1, 2013 6:03 PM