[OpenLayers-Users] Popup closebox and formatting.

Eric Lemoine Eric.Lemoine at camptocamp.com
Sun Jun 3 16:19:44 EDT 2007


On 6/3/07, Eric Lemoine <Eric.Lemoine at camptocamp.com> wrote:
> I understand what the text layer is for. What I don't understand is
> why OpenLayers provides a default onclick callback. Would you accept a
> patch where the programmer can specify events and callbacks at layer
> creation time?
>
> layer = new OpenLayers.Layer.Text("foo", {
>     location: "file.txt",
>     events : {
>         "click" : click_callback,
>         "mouseover" : mouseover_callback
>     }
> });

Attached is a patch (against current trunk) that implements the above.
Christopher, could you give it a quick review? I can provide some test
if inclusion into main branch is conceivable.

Kaka, to get the closebox working, you can try applying my patch,
implementing your own "onclick" callback and passing that callback to
the text layer constructor. See the markersTextLayer.html example.
Your onclick callback will ressemble the default click handler located
in lib/OpenLayers/Layer/Text.js (markerClick), but it will use
createPopup(true) as opposed to createPopup().

Note: I've created a ticket for this (see
<http://trac.openlayers.org/ticket/738>) and attached the patch to the
ticket as well.

Thanks,
-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: text-layer-event-handling-060307.patch
Type: text/x-patch
Size: 2438 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070603/665e4f08/text-layer-event-handling-060307.bin


More information about the Users mailing list