Hello, I am implementing custom Markers and have a couple questions... first some background...
While doing some performance tests, we noticed that there was a great deal of overhead in creating new Marker objects, so we've decided to create custom FeatureSourceMarkerOverlay which would cache the Markers and only create a new marker when it has not been created before, otherwise we would use the cached Marker. This dramatically improved performance, however we found 2 things with this approach. First, Marker.ImageSource was always null after it was drawn the first time, and two, doing some performance tests, we found that there was also a large amount of overhead in resetting the ImageSource. So we created a custom Marker object who had its ImageSource set to null, but whos Children contained an Image object... the source of this object persists over refreshes so we were able to gain even more performance increase (I think in total we dropped from ~4 second refresh time on 800 markers to just under 1 second using this approach.
I recently got a new requirement to display labels under the Marker... simple, just add a textblock under my image. However, what I'm noticing (and totally makes sense) is that when the text is long, the image moves to the right of its actual location, so that the actual location of the marker is the upper left corner of the entire object. What I desire is to have the actual location be the center of my icon. I believe this is the behavior of something like a ShapeFileFeatureLayer and some other layers (probably even MarkerOverlay when you set the image source).
I guess my question is how do I go about achieving this? Now that I've seen it with text, doing it the way I'm doing it, even if I just have an icon with no text, the center of the icon is not the location of the text, the upper left corner is.
Any insight would be appreciated. Thank you for your time and help.
.Ryan.