sfMaps exception in WPF

Hello I am developing an app that shows the path of a bike route. I am using sfMap in WPF. Everything is ok, but as soon as I put the mouse over the map, I get an exception in ShapeFileLayer.UpdateTooltip, as you can see from the screenshot below. Here is the xaml code:

<m:SfMap x:Name="Map">
     <m:SfMap.Layers>
          <m:ImageryLayer x:Name="BingLayer" LayerType="OSM" DistanceType="KiloMeter" Markers="{Binding Markers}" >
               <m:ImageryLayer.SubShapeFileLayers>
                    <m:SubShapeFileLayer x:Name="MapLine" ShapeType="Polyline">
                         <m:ShapeFileLayer.ShapeSettings>
                              <m:ShapeSetting ShapeFill="Blue" ShapeStroke="Black" ShapeStrokeThickness="3" />
                         </m:ShapeFileLayer.ShapeSettings>
                    </m:SubShapeFileLayer>
               </m:ImageryLayer.SubShapeFileLayers>
          </m:ImageryLayer>
     </m:SfMap.Layers>
</m:SfMap>

In the code, I add the points in this way:
foreach(VMPoint point in _vmActivityFile.SelectedLap.MapPoints)
MapLine.Points.Add(new Point(point.Latitude.GetValueOrDefault(),point.Longitude.GetValueOrDefault()));

I tried first with Bing maps (that's why the name BingLayer), but it is even worse, as the line sometimes doesn't appear at all.

Hope somebody can help

Thanks;
Andrea




9 Replies 1 reply marked as answer

SS Sridevi Sivakumar Syncfusion Team November 18, 2020 12:33 PM UTC

Hi Andrea,

Greetings from Syncfusion.


We have checked the reported issue by preparing the simple sample along with your code snippet and ensured that it has been worked fine at our end.  Please find the sample link for reference in below

Sample link: https://www.syncfusion.com/downloads/support/forum/159767/ze/MapSample-1920741512

Could you please ensure that whether you have enabled the tooltip for marker or whether did you try to use the ShapeFileLayer instead of ImageryLayer.

Please check that sample if that is not similar with your requirement, please modify and let share us with issue reproducing sample to check it our end further and provide a possible solution.

Regards,
Sridevi S.
 
 



AD Andrea Di Ferdinando November 20, 2020 07:58 AM UTC

Hello Sridevi, and thank you for answering.

Actually your sample worked, so I tried to understand why my code didn't. After some trial, I understood the reason.
The problem was that I created the polyline in the window construtor AND I set the center of the ImageryLayer in the constructor either.

So, to reproduce the error, simply replace the code in your MainWindow.xaml.cs with this code:

 public MainWindow()
{
     InitializeComponent();
     this.DataContext = new ViewModel();
     MapLine.Points = (this.DataContext as ViewModel).MapPoint;
     BingLayer.Center=MapLine.Points[0];
}

private void Button_Click(object sender, RoutedEventArgs e)
{
}

Best,
Andrea



AD Andrea Di Ferdinando November 20, 2020 02:56 PM UTC

Hello again,

actually the situation is more complex.
I tried to solve the problem by setting the center of ImagerLayer in the Loaded event of the polyline.
It works, but not always. As an example, using Bing doesn't work (but it works in your sample code, for some reason I still don't understand).

Also, creating the polyline by code, and not in the xaml, produces the same exception, even without setting the ImagerLayer center.
I am attaching a zip file containing the xaml and cs files of MainWindow. You can replace in your sample code to reproduce the error. Notice that the same exception is raised also without settings any property of SubShapeFileLayer mapLine, i.e. by simply writing:

SubShapeFileLayer mapLine=new SubShapeFileLayer();
BingLayer.SubShapeFileLayers.Add(mapLine);

Andrea


Attachment: MainWindow.xaml_c4b39264.zip


RS Ramya Soundar Rajan Syncfusion Team November 23, 2020 11:54 AM UTC

Hi Andrea, 
 
We have considered the reported problem as an issue. We have logged the feedback link to track the status of the reported issue and the fix will be included in our weekly NuGet which is expected to be rolled out on December 8, 2020. We appreciate your patience until then.   
 
You can now track the status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.    
   
     
Note: The provided feedback link is private, and you need to login to view this feedback.    
 
Regards, 
Ramya S 



AD Andrea Di Ferdinando November 25, 2020 07:05 AM UTC

Thanks.

However I can't access the provided link (Access denied).


SS Sridevi Sivakumar Syncfusion Team November 26, 2020 12:32 PM UTC

Hi Andrea,

Sorry for your inconvenience.

We have resolved the faced problem, please re-check the below feedback link and track it for getting further updates.

https://www.syncfusion.com/feedback/19959

As promised earlier, this fix will be included in our December 8, 2020, weekly NuGet release.

Regards,
Sridevi S.
 



RS Ramya Soundar Rajan Syncfusion Team December 1, 2020 12:06 PM UTC

Hi Andrea, 
 
We are glad to announce that our weekly NuGet was rolled out and fix for the reported issue was included in the weekly NuGet. 
 
NuGet Version: 18.3.0.52
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Ramya S 


Marked as answer

AD Andrea Di Ferdinando December 2, 2020 06:51 AM UTC

Thank you very much!


RS Ramya Soundar Rajan Syncfusion Team December 3, 2020 05:31 AM UTC

Hi Andrea, 
 
Thanks for your update. 
 
Please get in touch with us if you would require any further assistance. 
 
Regards, 
Ramya S 


Loader.
Up arrow icon