PcitureMarkerSymbol - SetSourceAsync image missing randomly

3962
3
04-29-2015 06:46 AM
RobertKennedy
New Contributor

Hi there,

Using the .NET SDK 10.2.5, I'm creating PictureMarkerSymbols to display a placemark style graphics.  I'm setting the images for these using SetSourceAsync.  I'm finding that frequently some of the images are not loading properly/are missing (like in the image on the left). 

Out of say 100 graphics, that have 100 different images, maybe 50% will load correctly.  The underlying images are there (you can see from the popup), but it's random how many of the PictureMarkerSymbols fail to load their picture and which particular images they are.

Any ideas?

Thanks

missingPictureMarkerSymbol.png

0 Kudos
3 Replies
RobertKennedy
New Contributor

Note that the pictures are from two different runs of the app (not two different graphics during the same run).  Sometimes the orange will load fine, sometimes it'll fail.

0 Kudos
HuyHo
by
Occasional Contributor

It is possible that you are running into file locking where while the image is being loaded, it prevents another thread from trying to use the same image.  How are you setting the image source?

This is what I do for my application...

try

{       

          using (FileStream fs = File.Open(imagePath, FileMode.Open, FileAccess.Read, FileShare.Read))

          {

            symbol.SetSourceAsync(fs);

          }

}

...

0 Kudos
RobertKennedy
New Contributor

Thanks for the reply.  Unfortunately I don't think that's the root issue.  I'm using the SetSourceAsync(Uri ur) version of the call, and passing in URLs that truly are remote (http) images.  All the images are unique.

0 Kudos