I am currently working with markers and text. I have noticed a few strange things going on.
First, when I add text with a text offset, it changes the location of the markers.
The second thing is all my markers are clickable. So when I add text, the boundary for where you can click for the marker expands significantly to the point where almost half my map is clickable (something I would prefer not to have happen). I have checked that my image does not have any extra pixels around it.
I checked the source code and found the ImageOffsetX/ImageOffsetY can impact the position of the marker, the following figure shows the result on my side.
In the figure, there are 2 markers with the same coordinates, one has the text with offset and the other doesn’t. The code like below:
var marker1 = new Marker(-8922952.93266, 2984101.58384, new WebImage("~/Content/images/marker_blue.gif", 21, 25) {Text = "Text", TextOffsetX = 10});
var marker2 = new Marker(-8922952.93266, 2984101.58384);
markerOverlay.Markers.Add(marker1);
markerOverlay.Markers.Add(marker2);
In MVC Edition the markers with text are drawn into a new image with the text like following, so please try reduce the text or the values of the TextOffestX/TextOffsetY to avoid the issue:
In regards to the second issue, unfortunately, I am not able to reduce the amount of text (I do not have more than four words on each marker) or the TextOffset due to restraints by my client. The reason for not wanting to adjust the TextOffset is it causes the text to not be readable. Would it be better for me to instead of using the text available with markers, overlay text either using another marker overlay or just a different type of overlay?
I have tried what you have said. I am not able to get a normal text layer to appear in front of a marker. I did mess around with putting the text in a blank marker layer, but the issue I am running into with that is, the user can no longer select in the location where the text is. Any suggestions would be greatly appreciated.