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

Xavier Mamano (jorix) xavier.mamano at gmail.com
Thu Jan 31 10:33:44 PST 2013


Hi Andreas,

AFAIK the way to do it is to go to the event that caused the event. It's not
an easy way :(

See http://jsfiddle.net/jorix/7hrhV/

Really what behavior you are looking for?

Regards,

Xavier Mamano



Andreas Schnieders wrote
> 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
> 
> _______________________________________________
> Users mailing list

> Users at .osgeo

> http://lists.osgeo.org/mailman/listinfo/openlayers-users





--
View this message in context: http://osgeo-org.1560.n6.nabble.com/OpenLayers-Handler-MOD-CTRL-example-tp5030635p5031285.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list