Hi list,

I have adapted the WfsGetFeature widget so that it's possible to select different handlers. Using simple html radiobutton, the user can choose a point handler, a box handler or an irregularpolygon handler. The backend is a custom web-service that accept a wkt geometry in the request parameters (it still returns a GML feature collection).

In my custom WfsGetFeature.js, the draw function looks like this:
        draw: function() {
           switch (objRef.handlerType) {
              case 'POINT':
                 this.handler = new OpenLayers.Handler.Point(
                    this,
                    {done: this.selectGeom},
                    {keyMask: this.keyMask}
                 );
                 break;
              case 'BOX':
                 this.handler = new OpenLayers.Handler.RegularPolygon(
                    this,
                    {done: this.selectGeom},
                    {keyMask: this.keyMask, sides: 4, irregular: true}
                 );
                 break;
           }
        },

The WfsGetFeature class also provide a method designed to handle click event on the html radiobuttons:

  this.setHandlerType = function(objRef, handlerType) {
     objRef.handlerType = handlerType;
     if (objRef.control) {
        objRef.control.draw();
        if (objRef.control.active) {
           objRef.control.deactivate();
           objRef.control.handler = objRef.control.handler;
           objRef.control.activate();
        }
     }
  }

All this works pretty fine in Firefox but does not in IE...
The behavior in IE is the following:
- when the control is selected, an handler is activated and works fine
- if the user change the handler type (using html radiobuttons), the mouse handler does not change until the next selection. For example, the handler is of type 'point' and the user clicks on 'box', when the user try to click on the map the handler is still of type 'point' but change to 'box' after this first selection.

I've spent hours trying to understand what's wrong. Any help greatly appreciated.

Regards
Gilles

--
Gilles Bassiere
MAKINA CORPUS
30 rue des Jeuneurs
FR-75002 PARIS
+33 (0) 1 44 82 00 80
http://www.makina-corpus.com

begin:vcard
fn;quoted-printable:Gilles Bassi=C3=A8re
n;quoted-printable:Bassi=C3=A8re;Gilles
org:Makina Corpus;GIS
adr;quoted-printable:;;30 rue des Je=C3=BBneurs;Paris;;FR-75011;France
email;internet:[EMAIL PROTECTED]
title:Web GIS developper
tel;work:+33 (0) 1 44 82 00 80
x-mozilla-html:FALSE
url:http://www.makina-corpus.com
version:2.1
end:vcard

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Mapbuilder-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-users

Reply via email to