Openlayers wrapper :Display some text or message on the top of a Marker ?

Hi,
I am using latest version which is 1.0.0.
I want to display some text on the top of a Marker displayed in the OpenStreetMap as base layer. Please find the attached document for reference where text “marker shows a building” is displayed on top of marker. How to display the text on the top of a marker using openlayers wrapper addon?

Thanks
12268.docx (363 KB)

I’m also looking for a way to solve this.
tried a framed PopUp, but setting width or height doesnt work, so the popup consume too much space

Hi,

Here is a possible solution:

-Draw a rectangle area vector.
-Place it above your marker (marker coordinates + adjustments)
-Add a custom style to the area vector whereas you can set the label, alignment of the label, borders etc (style it like your example) .

Hope it helps!

Hi,

I was just about to suggest something like this. PointVector can be styled to contain text. This is probably the most versatile method and works well (I’m using this in one non-finished hobby project). But we could indeed have something like LabelVector that would be easier to use.

For popup content I’d like to have possibility to align Vaadin sub Windows with coordinates and possibly have a theme with “pointer” to the exact location.

I’d really like to focus more on this add-on currently, but I’m bit busy atm. I’d by happy if somebody can find some time for these features.

cheers,
matti

Hi,

Sadly i share a common enemy, that is, the available time.
If there is any time, i would investige the creation of the labelvector.
My main problem is, that the font size doesnt scale when zooming out.
This can be solved by changing the font size based on the zoom level, but it is resource intensive.

Greetings,

Remie

Hi,

I wanted to active similar effect with some line widths. I have a patch to be landed to make it possible to set units with context function and that way make it scale with the zoom level. Using that I think it should be possible to make font size relative too.

cheers,
matti

Have tried this method - works so far (must find a solution for labels “rising away” when I zoom in). But at a few hundred displayed vectors (i’ve tried 1000, with randomly generated coordinates) the browser gets slow as hell, until it’s completely dead and has to be shut down. Don’t know what’s the problem is, whether Vaadin gets the browser stack full or it’s the browser itself having a problem displaying so many objects. (Tried with IE9 and FF19).

Max

Hi,

AFAIK OpenLayers isn’t very fast with multiple vectors. Especially on IE.
FAQ suggests
just 100-200 as maximum, which might be true with some browsers/devices. But on my experiences with webkit based browsers and an average machine even several thousands of vectors shouldn’t be an issue.

cheers,
matti