EditOverlay is rendered by the DrawingVisualGeoCanvas by default which draws faster in Wpf ; So it doesn’t accept bitmap object. I recommend to change the RenderMode property in EditOverlay to GdiPlus and try again. It will be better that to provide us a simple sample; and we can see how to integrate the default way in your application.
Thanks and let me know if you have any queries. Howard
I think this is not a problem with dragging an object to Map. I think edit overlay has some problems. I have attached a sample source code with this reply. Run the project and then click the button twice and you will get the exception.
The exception is because you are duplicate FeatureSourceColumn to the objectFeatureLayer, please clear the columns before you add the columns again. Here is the code.
Thanks for the reply. It solved my problem. One thing, the exception message was misleading. I used Think Geo for two month and found that most of the exception were misleading. I think it needs better exception management system.
I saw the new feature draggable marker in the new API. I will try to use that later.
And another thing, after applying your fix i clicked the button twice. But if you move any object from the map you will see there is another object behind that. As many time you click the button you will see that many objects. So if there is 5 objects in the map and you click 3 times there will be 15 objects. I think this is a bug int he API. Can you please check this.
Adding duplicate objects is caused by your logic because you added the features multiple times. Please set a break point at objectFeaturelayer.InternalFeatures.Add(objectFeature) in DrawObject method; then click the button and see what happens.
Thanks for your feedback and feel free to let me know if you have more queries.
Thanks Howard, i did not notice that. One question, i set the width and height of the map. But still the map is drawn in smaller size. How can i draw that map such way that it will fill the space (width and h eight) it is given.
Just simply remove the width and height for the map. Put it into a grid or some other panel witch allows its child applies to its properties. It will do as you needed. Please let me know if there is any misunderstanding.
Please check the attached source file. I remove the width and height for the map and also put it into a grid. But, still the map is drawn in smaller size. I may make some mistake. Need your suggestion regarding this.
When I see your code, I think I misunderstand your issue last time. Before I think you want to resize the map with its parent; but now I think what you really want to do is setting the initialize extent to fill the map; right? Actually, in your sample, the map is resizing with its parent, if it doesn't in your end, please let me know. For my second guess; you knowthe RasterLayer's bounding box, its width and height's ratio is not exactly equals to the map's extent. So here are two possibilities to calculate the extent. One is the setting extent will contains the entire map. So it must leave a big area of blank space; which is the same as your current situation. While another one is letting the setting extent to fit the map; so it will cut some are of layer at the first time. Please see the following figures. Also, there is another factor which will affect the extent; the zoom level scales. As you zoom in/out, the map always snapped to its levels; so most of the times, the bounding box you set cannot exactly touch the edge of the map in both of the following figures. So please try my second way and let me know if you have more queries.
[Figure 1, the map holds the entire extent.]
[Figure 2, the map fit the extent, but some are is out of the extent.]
Although the extent is fit to the bounding box of your data; but because the new extent's scale cannot exactly on one of the scale list in our Wpf control; so that we'll snap it to the nearest upper scale and the blank space shows.
I changed the method a little so that it always snaps to the next level of scale and your scenario. Hope it works for you.
I have added this feature and you can download 4.0.122 tomorrow to have a try. Please set Map1.RestrictExtent to the rectangle you want to restrict panning.