1 (edited by lambrtz 2016-02-16 15:17:55)

Topic: Adjusting the position of a marker's label

Hello,

I would like to know how I can adjust the position of a marker's label.

So far I can show the label permanently, as shown in the attached image. However, it seems a little bit off. I want to make it centre-aligned to the marker, and move it down a bit, closer to the marker. I suppose it has something to do with the OnPrepareTooltipStyle function, but I am not sure how I can use it.

Thank you!

Post's attachments

Attachment icon online-maps-tooltip.png 47.44 kb, 119 downloads since 2016-02-16 

Re: Adjusting the position of a marker's label

Just to add on my original post, when I built and ran the app on Android platform, the font becomes very small, as attached. Will be glad if someone can let me know how to make the font size fixed.

Thanks again!

Post's attachments

Attachment icon online-maps-tooltip-crs.png 201.79 kb, 133 downloads since 2016-02-16 

Re: Adjusting the position of a marker's label

Hello.

Example attached.

Post's attachments

Attachment icon CustomizeTooltipExample.cs 1.15 kb, 162 downloads since 2016-02-16 

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Adjusting the position of a marker's label

Thanks a lot Alex for your quick reply. That code is really cool!

I just realised that there is an OnDrawTooltipExample code that shows how to do that, sorry for not checking properly earlier.

For the benefit of other library users, I use

Rect rect = marker.realScreenRect;

to get the marker's rect. It's to be noted that marker needs to be an OnlineMapsMarker object. I use this to determine the tooltip rect.