Map not rendering

I have followed your c# example in a UWP app.  My source code is below.  When I run the app, I don't see the map - just a grey box on the page.  I noticed an obscure error in the output Exception thrown: 'System.IO.FileNotFoundException' in System.Private.CoreLib.ni.dll which might suggest it cant find the shp file even though it's where it needs to be.

Any assistance appreciated.

best


 this.InitializeComponent();
            SfMap syncMap = new SfMap();
            syncMap.EnablePan = true;
            ShapeFileLayer layer = new ShapeFileLayer();
            layer.Uri= "ms-appx:///Mapping/world.shp";
            layer.ShapeSettings.ShapeFill= new SolidColorBrush(Windows.UI.Colors.Blue);
            syncMap.Layers.Add(layer);
            this.MainGrid.Children.Add(syncMap);

1 Reply

AK Ashwin Kumaravel Syncfusion Team October 17, 2017 06:41 AM UTC

Hi Fmgstocks,

Thanks for using Syncfusion products,

We have validated your code snippet and we have found that the Uri for the shapefile is not valid path, so this is the reason why Map is not getting rendered at your end.

Can you please refer the below code snippet to get a better understanding of how to give a valid path?

layer.Uri = "Maps.world1.shp";

Where, Maps is the Namespace name and World1.shp is the shapefile name and also ensure whether you have set Build Action as Embedded Resource for the shapefiles which you are using.

We have also created a Map sample based on your code snippet and can you please download from the below link?

Sample Link- http://www.syncfusion.com/downloads/support/forum/133228/ze/MapsUWP1083147280  

Screenshot-

 

Note-Since the shapefile Uri path is not valid in the help document, we will modify our existing help document and we will let you know once it is published with the changes.


Regards,
Ashwin
 


Loader.
Up arrow icon