Reputation: 264
I use HereMap on my android app. I am able to plot markers over the map but not able to show text next to markers. Already tried using setTitle and MapLabeledMarker but these do not seem to be working. How can we show some text next to markers plotted on the map in HereMap Android sdk?
Upvotes: 0
Views: 789
Reputation: 719
MapLabeledMarker is working but does not provide enough control on the rendering and sometimes the text is hidden for some reason (over an other marker, a road element, etc.)
I'm adressing this issue by adding two markers, one for the image and one for the text. I'm drawing the text in a bitmap using android.graphics.Paint.
This is probably worse for performance than David Leong solution but it provides a way to hide the text for lower zoom level using the MapObject.setVisibleMask method.
Upvotes: 1
Reputation: 1762
The best way to implement this is to use a regular android view layout, inflate it and draw to a bitmap via Canvas APIs. Use the bitmap as the image of the marker as needed.
This provides the best performance as the graphics engine will cache the bitmap you provide and use hardware acceleration to render it.
Upvotes: 1