[OpenLayers-Users] SelectFeature hover control interfering with
click-and-drag
Robert Sanson
SansonR at asurequality.com
Mon Sep 8 01:05:05 EDT 2008
Hi Roald
It was uncommented because I copied the code from another example and those lines were already commented out. I had since tried uncommenting those, and it worked! Sorry I didn't let the list know that I had solved it. Anyway, thanks for the response.
I am still using v2.6. Haven't tried v2.7rc1 yet.
Kind regards,
Robert Sanson
>>> Roald de Wit <roald.dewit at lisasoft.com> 8/09/2008 4:53 p.m. >>>
Hi Robert,
It seems you are/were very close to the solution of you problem: to
allow for the map to be dragged when your mouse pointer is over a
selectable feature, you need to override the stopDown and stopUp
attributes of the handler, just as you have in your code below (but then
uncommented!).
Could you explain why you have these lines commented out? Have you tried
uncommenting them? What version of OL are you using? 2.7-rc1, 2.6 or an
older version?
Today crschidt explained to me that in 2.7 the SelectFeature control
behaves a bit differently internally and in order for the fix work,
you'd need to rewrite the code. See [1]
But this might not apply to you and you might have other reasons why it
won't work for you.
Cheers, Roald
[1] http://trac.openlayers.org/wiki/SelectFeatureControlMapDragIssues
On Wed, 2008-09-03 at 06:56 +0930, Robert Sanson wrote:
> I have an OL map that has a GML polygon layer (loaded from a WFS
> source). I have a SelectFeature control that operates using hover:true
>
> var options = {
> hover: true,
> onSelect: function(feature) {
> OpenLayers.Util.getElement('selfarm').innerHTML =
> "<strong>Farm_id:</strong>" + feature.attributes.FARM_ID + "
> <strong>Par_no:</strong>" + feature.attributes.PAR_ID
> }
>
> };
> var select = new
> OpenLayers.Control.SelectFeature(fbnd, options);
> map.addControl(select);
> //select.handler.stopDown = false;
> //select.handler.stopUp = false;
> select.activate();
>
> Anyway, when I hover over a polygon, I get a a couple of the
> attributes displayed in a div below the map. The problem I have is
> that the normal click-and-drag control used for panning the map does
> not work when I drag on a polygon feature. It only works when I drag
> in a part of the map without one of these polygons.
>
> Any clues?
>
> Many thanks,
>
> Robert Sanson
>
>
>
> ------------------------------------------------------------------
> The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.
> ------------------------------------------------------------------
>
>
>
>
>
> This message has been scanned for malware by SurfControl plc.
> www.surfcontrol.com
>
>
>
--
Roald de Wit
Software Engineer
roald.dewit at lisasoft.com
Commercial Support for Open Source GIS Software
http://lisasoft.com/LISAsoft/SupportedProducts/
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
------------------------------------------------------------------
The contents of this email are confidential to AsureQuality. If you have received this communication in error please notify the sender immediately and delete the message and any attachments. The opinions expressed in this email are not necessarily those of AsureQuality. This message has been scanned for known viruses before delivery. AsureQuality supports the Unsolicited Electronic Messages Act 2007. If you do not wish to receive similar communications in future, please notify the sender of this message.
------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080908/d6e5ab05/attachment.html
More information about the Users
mailing list