Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to get OpenLayer map zoomed in iphone?
    primarykey
    data
    text
    <p>I have created OpenLayer map application in iphone. so i want to access its events by the functionality of the iphone means i want to drag OpenLayer map by touch events &amp; zoom by iphone zoom gesture event. for calling OpenLayer map i have implemented one html file in web view.It's working properly i get the OpenLayer map &amp; the map touch events also now i want to zoom map like other maps or images are going to be zoomed in iphone.please guide me for implementing zoom functionality in OpenLayer map in iphone..</p> <p>for calling map &amp; touch events i have use this code in .html file</p> <pre><code> &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;OpenLayers Tutorial - Basic Map Setup&lt;/title&gt; &lt;script src="http://openlayers.org/api/OpenLayers.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; var map, baseLayer; function init(){ map = new OpenLayers.Map('map'); baseLayer = new OpenLayers.Layer.WMS("OpenLayers WMS", "http://labs.metacarta.com/wms/vmap0", {layers:"basic"}); map.addLayer(baseLayer); map.setCenter(new OpenLayers.LonLat(0,0),1); } function touchHandler(event) { var touches = event.changedTouches, first = touches[0], type = ""; switch(event.type) { case "touchstart": type = "mousedown"; break; case "touchmove": type="mousemove"; break; case "touchend": type="mouseup"; break; default: return; } var simulatedEvent = document.createEvent("MouseEvent"); simulatedEvent.initMouseEvent(type, true, true, window, 1, first.screenX, first.screenY, first.clientX, first.clientY, false, false, false, false, 0/*left*/, null); first.target.dispatchEvent(simulatedEvent); event.preventDefault(); } document.addEventListener("touchstart", touchHandler, true); document.addEventListener("touchmove", touchHandler, true); document.addEventListener("touchend", touchHandler, true); document.addEventListener("touchcancel", touchHandler, true); &lt;/script&gt; &lt;style&gt; @media screen { #map{width: 300px; height:360px; border: 2px solid black;} } &lt;/style&gt; &lt;/head&gt; &lt;body onload="init()"&gt; &lt;h3&gt;OpenLayers Tutorial - Basic Map Setup&lt;/h3&gt; &lt;div id="map"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>this code is working properly.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload