[OpenLayers-Users] Pinch-Zoom / Drag while having an active clickControl

Andreas Hocevar ahocevar at boundlessgeo.com
Tue Apr 15 02:47:44 PDT 2014


You could use feature events instead of a SelectFeature control. See
http://openlayers.org/dev/examples/feature-events.html to see how this
is done.

Andreas.

On Mon, Apr 14, 2014 at 3:36 PM, Frederick Löbig
<frederick.loebig at live.de> wrote:
> Hi all,
>
> I have a small problem which I think can be solved pretty quickly.
>
> The map I have as multiple different "clickControls", which, depending on
> which one is activated, lead to several different actions. One of these
> controls is a simple clickFeature, to show a detail window of the selected
> vector feature (added via a GML file). I now want to use pinch zoom and
> simple map dragging without selecting a feature each time I touch the map.
> So basically, what I want to achieve is, to drag and zoom the map in any
> case, even if I hold down on a feature. This is my code for the
> selectFeature control:
>
> clickFeature = new OpenLayers.Control.SelectFeature(
>   [pointLayer],
>   {
>   clickout: true, toggle: false,
>   multiple: false, hover: false,
>   }
> );
> map.addControl(clickFeature);
> pointLayer.events.on({
>   "featureselected": function(e) {
> //drag.activate();
>
> //openDetail(e.feature.attributes.Id);
> ajax_request('mob_detail.php','POST','?t=1&id='+e.feature.attributes.Id,'mob_detailLayer');
>                                                 closeToolTip();
> //dumpProps(e.feature.attributes);
>
> //document.getElementById("debug").value=e.feature.attributes.Id;
>   },
>   "featureunselected": function(e) {
> closeDetail();
>   }
>   });
>
> clickFeature.activate();
>
>
>
>
>
> This is the link to the current application:
> www.linie11.org/mapApp/go_map.php
> Any ideas? Thanks in advance! It's driving me crazy right now...
>
> Cheers,
> Freddy
>
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users



-- 
Andreas Hocevar
Geospatial Solutions Engineer | Boundless
ahocevar at boundlessgeo.com
@boundlessgeo


More information about the Users mailing list