AnsweredAssumed Answered

Refresh of PictureMarkerSymbol source image issue.

Question asked by msbsmith on Nov 4, 2014



I have a graphics refresh issue.  I'm adding a PictureMarkerSymbol into a graphics layer which has a png image as its source url.




        var theSymbol = new esri.symbol.PictureMarkerSymbol({


            "url": "IMAGES/TestImage.png",


            "height": 30,


            "width": 30




        var mapPoint = new esri.geometry.Point(350000, 900000, new esri.SpatialReference({ wkid: 27700 }))


        var graphic = new esri.Graphic(mapPoint, theSymbol)








This works fine, but the problem is the source image changes periodically, it's updated externally and I need the graphic icon on the map to update when the user clicks an update button (actually I've only added a button for testing, ultimately I'll automate it).  However I can't get the API/browser to forget about the previous image.  I've tried clearing the graphics, removing the graphics layer and adding it again, and adding a new PictureMarkerSymbol after I know the source png image has changed, but it seems that once the API/browser knows about the original image it assumes it hasn't changed and re-uses the original image from somewhere in its memory.  Doing a full page refresh isn't really an option.




Can anyone suggest how I can make sure my PictureMarkerSymbol grabs the latest image, not what it thinks the image is?




Thank you.