[OpenLayers-Users] wfs stylemap example?

Christopher Schmidt crschmidt at metacarta.com
Fri Aug 1 09:15:03 EDT 2008


On Thu, Jul 31, 2008 at 10:44:51PM +0200, Arnd Wippermann wrote:
> Instead of "select" try "crosshair". 
> 
> I init my cursor for select with
> OpenLayers.Feature.Vector.style['select']['cursor'] = 'crosshair';, but it
> doesn't work. But when i select and then unselect a feature, then the cursor
> will change, when I hover over the feature.

Right, this is why I suggested setting it on 'default', not 'select':
setting it on select means that it will only happen after you've
selected it.

> Perhaps it is bug. When I look in my application at the generated svg in
> firebug, there is no attribute "cursor". But after a select the attribute is
> added.

Yep, it's a bug. Since the default cursor is '', when the code loops
through, it sets style properties back to defaults if they evaluate to
true, and '' evaluates to false, so it's never overridden. 

> Arnd Wippermann
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: adube at mapgears.com [mailto:adube at mapgears.com] 
> Gesendet: Donnerstag, 31. Juli 2008 15:44
> An: Christopher Schmidt
> Cc: Arnd Wippermann; users at openlayers.org
> Betreff: Re: [OpenLayers-Users] wfs stylemap example?
> 
> Christopher Schmidt wrote:
> >
> > Alternatively, set your strokeWidth to a larger number (I always use 3).
> >   
> Wow !  Haven't though about that but it's a simple and clever solution
> :)  Thanks.
> > You can't change the color when hovering, but you can change the cursor:
> > set OpenLaeyrs.Feature.Vector['default'].cursor = "select"; and it 
> > will change the cursor when it is over a feature.
> >
> >   
> I think it's more like : 
> OpenLayers.Feature.Vector.style['default'].cursor = "select";  but it's not
> working.  The value "" of the cursor IS changed to "select", but that does
> nothing when my mouse is over a feature.
> 
> In OpenLayers.Features, I have Vector and WFS.  I assumed that because my
> layer is WFS I had to change my cursor there but it has no style.
> 
> Any ideas ?
> > No real way to do that with the current code. Specifically, the reason 
> > is becasue the event is determined based on the browser saying "Here 
> > is the element that was under the mouse when the event triggered." But 
> > making the feature bigger will help.
> >
> >   
> I will try to think of something.
> 
> --
> Alexandre Dubé
> Mapgears
> www.mapgears.com
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list