Thursday, May 31, 2012

PictureMarkerSymbol Issue in ArcGIS Silverlight API

Recently I was working with ArcGIS Silverlight  API version 3.0 and Silverlight version 5.0.

I was migrating a previous Silverlight API code to version 3.0. All were working fine, but the PictureMarkerSymbol was not showing up correctly. It was showing blank.

After several debugging minutes, I found out the source element value should be modified slightly as shown below.

<esriSymbols:PictureMarkerSymbol x:Name="MapDefaultIdentifySymbol" OffsetX="36" OffsetY="36" Source="/SolutionName;component/Images/i_about.png" />

Before it was used like shown below.
<esriSymbols:PictureMarkerSymbol x:Name="DefaultIdentifySymbol" OffsetX="35" OffsetY="35" Source="Images/i_about.png" />
Note down the "Solution Name" and the word 'component' in the source value.

All the path and other attributes were same.

I am not sure whether Silverlight 5 or ESRI ArcGIS Silverlight API version 3.0 requires this change.

But with this new combination and the above syntax it works as expected.

Happy coding.

Cheers
Anand

No comments:

Post a Comment

All Blogs so far ...