I tried using the suggested below code but I get an <i>OpenLayers.Control.Click is not a constructor</i> error:<br><br><i>var click = new OpenLayers.Control.Click( {<br>
trigger: function(e) {<br>
// do your thing<br>
}<br>
});<br>
map.addControl(click);<br>
click.activate();</i><br><br><br>John<br><br><br><div class="gmail_quote">On Sun, Oct 16, 2011 at 8:05 PM, Richard Greenwood <span dir="ltr"><<a href="mailto:richard.greenwood@gmail.com">richard.greenwood@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Sun, Oct 16, 2011 at 5:11 PM, John Mitchell <<a href="mailto:mitchelljj98@gmail.com">mitchelljj98@gmail.com</a>> wrote:<br>
> I am using openlayers 2.11 and I am able to trap the click event (See below<br>
> code) from a PC web browser but within an ipad2 the click event does not get<br>
> trapped.<br>
><br>
> I have tried using the map.addControl(new OpenLayers.Control.Navigation());<br>
> and map.addControl(new OpenLayers.Control.TouchNavigation()); and for both<br>
> cases I get the same result described above.<br>
><br>
> How can I get a mobile browser to trap a click event like I can for a PC web<br>
> browser?<br>
><br>
> Thanks,<br>
><br>
> John<br>
><br>
> map.events.register('click', map, function (e) {<br>
> updateMapState();<br>
> var xys = map.getLonLatFromViewPortPx(e.xy);<br>
> var easting = xys.lon;<br>
> var northing = xys.lat;<br>
> var point = new OpenLayers.LonLat(easting,northing);<br>
> getFeatureInfoForLonLat(point);<br>
> Event.stop(e);<br>
> });<br>
><br>
<br>
<br>
</div></div>Use the OpenLayers.Control.Click something like the following:<br>
<br>
var click = new OpenLayers.Control.Click( {<br>
trigger: function(e) {<br>
// do your thing<br>
}<br>
});<br>
map.addControl(click);<br>
click.activate();<br>
<font color="#888888"><br>
<br>
--<br>
Richard Greenwood<br>
<a href="mailto:richard.greenwood@gmail.com">richard.greenwood@gmail.com</a><br>
<a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>John J. Mitchell<br>