AnsweredAssumed Answered

[Universal Windows Platform] PictureMarkerSymbol and Local Folder

Question asked by steelis2013 on Dec 27, 2015
Latest reply on Dec 28, 2015 by steelis2013

Hi Everyone,

 

I am currently developing an app on the Universal Windows Platform with Esri Runtime for Dotnet10.2.6.

 

I have a dynamic list of Images that needs to be applied different Color before being inserted into the Esri Map via PictureMarkerSymbol. I am currently facing problem trying to load an image from my App’s Local folder into the PictureMarkerSymbol although I have no problem loading an image that is already included In the project.

 

This is the code that is able to load the Image properly into a Image control:

var folder = Windows.Storage.ApplicationData.Current.LocalFolder;

var file = await folder.GetFileAsync("test.png");

Uri path = new Uri(file.Path, UriKind.Absolute);

image_Button.Source = new BitmapImage(path);

 

This is the code that is not loading the same image correctly for the PictureMarkerSymbol:

var folder = Windows.Storage.ApplicationData.Current.LocalFolder;

var file = await folder.GetFileAsync("test.png");

Uri path = new Uri(file.Path, UriKind.Absolute);

await myPicMarkerSymbol.SetSourceAsync(path);

 

However, if I were to load an image of an image already included in the project, I will be able to load the image correctly within the PictureMarkerSymbol.

Uri path = new Uri(@"ms-appx:/// Assets/MapSymbolsDefault/test.png");

await unitPicMarkerSymbol.SetSourceAsync(path);

 

 

As the online resources that I have found thus far are currently using some online image as the PictureMarkerSymbol, is the PictureMarkerSymbol able to load images from the Local folder(or Temporary, Cached etc)? If so, may I know if there are sample codes on how to do it? If not, what are the proper ways to do dynamic image generation for usage with PictureMarkerSymbol?

 

Thanks in advance for any help.

Outcomes