From: Alexandre A. S. <aas...@gm...> - 2011-05-12 10:43:36
|
Hi again, I'm trying to solve the multilayer issue using JSNI calling the function above: public static native void selectableAllLayers(JSObject map) /*-{ var vectors1 = new $wnd.OpenLayers.Layer.Vector("Vector Layer 1", { styleMap: new $wnd.OpenLayers.StyleMap({ "default": new $wnd.OpenLayers.Style($wnd.OpenLayers.Util.applyDefaults({ graphicOpacity: 1, rotation: -45, pointRadius: 10 }, $wnd.OpenLayers.Feature.Vector.style["default"])), "select": new $wnd.OpenLayers.Style({ }) }) }); var vectors2 = new $wnd.OpenLayers.Layer.Vector("Vector Layer 2", { styleMap: new $wnd.OpenLayers.StyleMap({ "default": new $wnd.OpenLayers.Style($wnd.OpenLayers.Util.applyDefaults({ fillColor: "red", strokeColor: "gray", graphicName: "square", rotation: 45, pointRadius: 15 }, $wnd.OpenLayers.Feature.Vector.style["default"])), "select": new $wnd.OpenLayers.Style($wnd.OpenLayers.Util.applyDefaults({ graphicName: "square", rotation: 45, pointRadius: 15 }, $wnd.OpenLayers.Feature.Vector.style["select"])) }) }); map.addLayers([vectors1, vectors2]); var selectControl = new $wnd.OpenLayers.Control.SelectFeature( [vectors1, vectors2], { clickout: true, toggle: false, multiple: false, hover: false, toggleKey: "ctrlKey", // ctrl key removes from selection multipleKey: "shiftKey" // shift key adds to selection } ); map.addControl(selectControl); selectControl.activate(); }-*/; But I received the next error: "(TypeError): Object [object Object],[object Object] has no method 'getZIndex' stack: TypeError: Object [object Object],[object Object] has no method 'getZIndex' at Object.moveLayerToTop (http://myurl) at Object.activate (http://myurl) at Object.activate (myurl) at ..." The thing is if I change the code and write SelectFeature for just one layer, it works: var selectControl = new $wnd.OpenLayers.Control.SelectFeature(vectors1, {.... but using an array doesn't work, Please, does anyone know what's the problem? Thanks in advance, Alex. ________________________________________ De: Alexandre Ascasibar Sequeiros [aas...@gm...] Enviado el: martes, 10 de mayo de 2011 13:46 Para: gwt...@li... Asunto: [Gwt-openlayers-users] Select feature in multiple layer Hi all, I'm trying to enable Select feature in multiple layers at the same time. I tried to extend SelectFeatureImpl adding the method: public static native JSObject create(JSObject layer1, JSObject layer2, JSObject options)/*-{ return new $wnd.OpenLayers.Control.SelectFeature([layer1, layer2], options); }-*/; but it doesn't work. Any one know how to handle this? Thank in advance, Alex. ______________________ This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it. ______________________ Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje erroneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracion. ______________________ ------------------------------------------------------------------------------ Achieve unprecedented app performance and reliability What every C/C++ and Fortran developer should know. Learn how Intel has extended the reach of its next-generation tools to help boost performance applications - inlcuding clusters. http://p.sf.net/sfu/intel-dev2devmay _______________________________________________ Gwt-openlayers-users mailing list Gwt...@li... https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users ______________________ This message including any attachments may contain confidential information, according to our Information Security Management System, and intended solely for a specific individual to whom they are addressed. Any unauthorised copy, disclosure or distribution of this message is strictly forbidden. If you have received this transmission in error, please notify the sender immediately and delete it. ______________________ Este mensaje, y en su caso, cualquier fichero anexo al mismo, puede contener informacion clasificada por su emisor como confidencial en el marco de su Sistema de Gestion de Seguridad de la Informacion siendo para uso exclusivo del destinatario, quedando prohibida su divulgacion copia o distribucion a terceros sin la autorizacion expresa del remitente. Si Vd. ha recibido este mensaje erroneamente, se ruega lo notifique al remitente y proceda a su borrado. Gracias por su colaboracion. ______________________ |