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

Andreas Schnieders schnieders.a at gmail.com
Tue Jan 29 06:47:25 PST 2013


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130129/927fbc3e/attachment.html>


More information about the Users mailing list