PictureMarkerSymbol problem in Windows Phone app

3834
1
Jump to solution
03-27-2015 03:47 AM
ÅsaWegelius
New Contributor III

Im trying to add pushpins on a map. I tried:

var pushPinSymbol = new PictureMarkerSymbol() { Width = 30, Height = 30, XOffset = 0, YOffset = 25 };
pushPinSymbol.SetSourceAsync(new Uri("pack://application:,,,/RouteDisplayer;component/Assets/MapPinIcon-30.png"));

and gets an invalid port specified error.

Is there another way I'm supposed to add an image to the symbol?

0 Kudos
1 Solution

Accepted Solutions
ÅsaWegelius
New Contributor III

I found that you shall use new Uri("ms-appx:///Assets/MapPinIcon-30.png") on Windows Phone instead of  new Uri(pack://application:,,,/RouteDisplayer;component/Assets/MapPinIcon-30.png).

It would be nice if the example https://developers.arcgis.com/net/sample-code/MarkerSymbols/http:// was updated with what changes you need to do for Windows Phone instead of just say: Available for Desktop, Store, Phone

It might save some time for others in the future.

View solution in original post

0 Kudos
1 Reply
ÅsaWegelius
New Contributor III

I found that you shall use new Uri("ms-appx:///Assets/MapPinIcon-30.png") on Windows Phone instead of  new Uri(pack://application:,,,/RouteDisplayer;component/Assets/MapPinIcon-30.png).

It would be nice if the example https://developers.arcgis.com/net/sample-code/MarkerSymbols/http:// was updated with what changes you need to do for Windows Phone instead of just say: Available for Desktop, Store, Phone

It might save some time for others in the future.

0 Kudos