[OpenLayers-Users] Tooltip for vectorlayer icons

Andreas Hocevar ahocevar at opengeo.org
Sat May 19 10:09:44 PDT 2012


If you download the latest OpenLayers (master from
http://github.com/openlayers/openlayers, you can simply give your
symbolizer a 'graphic' property. If your feature attributes have e.g. a
'tooltip' attribute, the value for the 'graphic' property would be
'${tooltip}'.

See http://openlayers.org/dev/examples/vector-features.html for an example.

Andreas.
On May 19, 2012 6:59 PM, "Matthias Meißer" <digi_c at arcor.de> wrote:

> Hi,
>
> I'm working on a map, that get's geoJSON data for a vector layer using an
> simple REST API server. As I only display the labels on demand and a the
> density of vector points can get quiet high, I like to display a usual
> native tooltiptext (aka hint). So if the mousepointer get's over an item, a
> small text appears that displays a custom text.
>
> Unfortunately it doesn't seem so easy to realise? I found a lot of old
> code snippets, that implement it by hand using hover event listeners. On
> the other side there is www.openflights.org that has exactly this
> behaviour, but the GraphicTitle sollution seems to be limited to icon based
> visualisiations, right?
>
> So how can I get the same functionality, without coding from scratch?
>
> bye
> Matthias
> ______________________________**_________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/**mailman/listinfo/openlayers-**users<http://lists.osgeo.org/mailman/listinfo/openlayers-users>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120519/778ab499/attachment.html


More information about the Users mailing list