[OpenLayers-Users] OpenLayers.Handler.MOD_CTRL example?

Grégory COLLIN gcollin at v3d.fr
Tue Jan 29 07:15:23 PST 2013


Hi,

Isn't there a problem with your constructor ?

I read : {Object} An object whose properties correspond to abstracted
events or sequences of browser events.  The values for these properties
are functions defined by the control that get called by the handler.

For the second argument, but you passed a null value...

Not sure, but check it.

br,

Le Tue, 29 Jan 2013 15:47:25 +0100,
Andreas Schnieders <schnieders.a at gmail.com> a écrit :

> Hi there,
> 
> I'm stuck with the Handler.MOD_CTRL thing.
> 
> I have a vector layer with a number of kml features. I attach a
> selector control like this kmlLayer.events.on({
>                     ...
>                     "featureselected":          onFeatureSelect,
>                     ....
>                 });
> 
>     kmlFeatureSelector = new
> OpenLayers.Control.SelectFeature([kmlLayer, zoneLayer]);
> map.addControl(kmlFeatureSelector);
> 
> If I now create a handler like this
> tmpCtrlHandler = new OpenLayers.Handler(kmlFeatureSelector, null,
> {keyMask: OpenLayers.Handler.MOD_CTRL});
> 
> I get
> --
> [15:17:07.655] TypeError: a is undefined @
> http://localhost:8000/spatioweb-client/js/OpenLayers/OpenLayers.js?v=1:599
> 
> from
> 
> function onFeatureSelect(event) {
> 
> console.log("tmpCtrlHandler.checkModifiers(): " +
> tmpCtrlHandler.checkModifiers()); ...
> }
> 
> Shouldn't there be a simple way to detect CTRL-Key-pressed on a
> event? I'm already thinking of ways to use jQuery events in
> OpenLayers. Does anyone have experiences with that? o_O
> 
> Many thanks in advance,
> Andreas



More information about the Users mailing list