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?
Solved! Go to Solution.
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.
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.