[OpenLayers-Users] Popup closebox and formatting.

Christopher Schmidt crschmidt at metacarta.com
Sat Jun 2 17:09:26 EDT 2007


On Sat, Jun 02, 2007 at 11:00:23PM +0200, Eric Lemoine wrote:
> On 6/2/07, Christopher Schmidt <crschmidt at metacarta.com> wrote:
> >On Sat, Jun 02, 2007 at 03:13:53PM +0200, Eric Lemoine wrote:
> >> On 5/31/07, kaka <drspencer at hotmail.com> wrote:
> >> >
> >> > I am trying to add a closebox to some markers, but I can??t get the 
> >close
> >> > boxes to show up. See http://www.villageografica.com/test50/test.html 
> >for a
> >> > test. The markers are located in
> >> > http://www.villageografica.com/test50/ProjectLocations.txt . What am I 
> >doing
> >> > wrong here?
> >>
> >> Unfortunatly I don' think you can have closeboxes with a Text layer.
> >> Indeed, the Text layer uses feature.createPopup()  as opposed to
> >> feature.createPopup(true). What you can do is create a class that
> >> inherits from OpenLayers.Layer.Text and overrides the markerClick()
> >> method - something along these lines (*untested*) :
> >
> >Just to throw my weight behind this: this is probably true at the
> >moment, and Eric's suggested fix is about right (though I've similarly
> >not tested it). I would consider this a bug though, and would take a
> >patch to fix it.
> 
> Christopher, what's the actual rationale behind having OL providing a
> default onclick callback for features of a Text layer? Wouldn't it be
> better to have a more generic mechanism where the user can choose the
> events (and associated callbacks) attached to its Text layer's
> features? Perhaps at this point you just want to avoid breaking
> backward compatibilty and therefore keep that default onclick callback
> thing?

The text layer is designed for people who can't write Javascript --
specifically, it's designed to support the MVS -- map viewer service, at
http://openlayers.org/viewer/ -- it's not designed to be subclassed.

I'm not sure I understand why people would want to use a text layer
rather than something like georss. Are there really that many OpenLayers
users who just use excel and still want to do more fancy things with a
text layer?

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list