Hello there,
We have recently upgraded our MapSuite version 7 to version 9.
We had a couple of issues which were replicable in smaller samples and had answered by you guys so far which I highly appreciate.
But now we are facing another issue which is quite weird and I can't think of any reason that why is that happening?
We have a control which calls MapControl that inherited from WpfMap, in a nutshell, we have tried to create an MVVM friendly version of WpfMap. In our MapControl we have a private field which calls _selectionOverlay and it is a type of LayerOverlay:
private
LayerOverlay _selectionOverlay;
After our application loads a layer, let's say a shape file then it let the user select and highlight some features on the map. We do keep all selected features in a LayerOverlay which I mentioned before.
We have a class which we derived from List<feature> and Feature is </feature>Thinkgeo Feature.
public
class
FeatureCollection : List<feature>
{
public
Collection<featuresourcecolumn> Columns {
get
;
set
; }
}
The class is something like above class has some other properties as well as helper methods which we use for different purposes in the our application.
Now assume we got a MapControl as follow:
public
class
MapControl : WpfMap
{
public
void
RefreshSelection()
{
// SelectedFeatures is FeatureCollection class which I mentioned earlier
var selectionLayer =
new
InMemoryFeatureLayer(SelectedFeatures.Columns, SelectedFeatures)
{
DrawingQuality = DrawingQuality.HighSpeed,
ZoomLevelSet = GetSelectionLayerStyle()
};
Refresh(_selectionOverlay);
//here is the faulty code!
}
}
This is where we are causing a very strange problem after upgrading to MapSuite 9. As you see in the code we InMemortyFeatureLayer which has instantiated by getting Columns and Features from our FeatureCollection class. Assume the SelectedFeatures has one Feature and the Feature has 2 columns, for example, Id and Name.
As soon as we call Refresh a new column adds to columns of our FeatureCollection class and also Columns of every feature in the FeatureCollection class. The column name is always length and the value is always empty.
The reason that I am writing to you is I’ve check the codes with both MapSuite 7 and MapSuite 9 and this problem only exists with MapSuite 9. I just done a quick check to make sure if the Refresh function in WpfMap has changed from version 7 to 9? and the result of Visual Studio decompiler is as below:
Version 7:
///
/// Refreshes a specified overlay.
///
///
///
<param name="redrawOverlay" />An overlay which needs to be refreshed.public
void
Refresh(Overlay redrawOverlay)
{
this
.Refresh((IEnumerable<overlay>)
new
Collection<overlay>()
{
redrawOverlay
});
}
Version 9:
///
/// Refreshes a specified overlay.
///
///
///
<param name="redrawOverlay" />An overlay which needs to be refreshed.public
void
Refresh(Overlay redrawOverlay)
{
this
.Refresh((IEnumerable<overlay>)
new
Collection<overlay>()
{
redrawOverlay
},
new
TimeSpan(), RequestDrawingBufferTimeType.Default);
}
Apparently the API has slightly changed.
To make it more clear I have recorded my screen and demonstrated the problem.
This is the Video:
screencast.com/t/Kcq8fiLp2
Thanks,
Shahin