Wait...I&#39;m confused...<div><br></div><div>enablehighaccuracy with a timeout set to earlier will get the high accuracy coords and get you the speed you want because it will use a cached location and not fire up the gps on the device, but it will give you the accuracy you want. If you&#39;re not using it as set to true, you&#39;re doing geoloc based on cell towers or ip...</div>
<div><br></div><div>as for what you use to get the coords, I&#39;m using the same thing, aren&#39;t I? or am I missing something else here...</div><div><br></div><div>thanks for the link, here&#39;s one I found useful.</div>
<div><a href="http://mobile.tutsplus.com/tutorials/mobile-web-apps/html5-geolocation/">http://mobile.tutsplus.com/tutorials/mobile-web-apps/html5-geolocation/</a></div><div><br><div><br><div class="gmail_quote">On Wed, Jul 13, 2011 at 8:35 AM, Noli Sicad <span dir="ltr">&lt;<a href="mailto:nsicad@gmail.com">nsicad@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Thanks for the tip.<br>
<br>
However, I rather do the GPS, since this is native app (hybrid app -<br>
Xcode and JS) and use<br>
<br>
 position.coords.latitude<br>
 position.coords.longitude<br>
<br>
See the advantage here:<br>
<br>
<a href="http://www.thecssninja.com/javascript/geolocation-iphone" target="_blank">http://www.thecssninja.com/javascript/geolocation-iphone</a><br>
<font color="#888888"><br>
Noli<br>
</font><div><div></div><div class="h5"><br>
On 7/13/11, Nicholas Efremov-Kendall &lt;<a href="mailto:n.e.kendall@gmail.com">n.e.kendall@gmail.com</a>&gt; wrote:<br>
&gt; set : enablehighaccuracy to True, that actually access the GPS on the<br>
&gt; devices.<br>
&gt;<br>
&gt; On Wed, Jul 13, 2011 at 1:02 AM, Noli Sicad &lt;<a href="mailto:nsicad@gmail.com">nsicad@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; I would like to replace the Geolocate control functionality to reading<br>
&gt;&gt; from the GPS from mobile devices (e.g. iPhone and iPad 2). Geolocate<br>
&gt;&gt; html5 is so off from the actual real coordinate (lonLat) like 500<br>
&gt;&gt; metres away.<br>
&gt;&gt;<br>
&gt;&gt; How are do I am going to do this in easiest and nicer way?<br>
&gt;&gt;<br>
&gt;&gt; I am able to get the my current location (i.e. lon and lat values)<br>
&gt;&gt; from the iPhone/ iPad  GPS  to HTML DOM (i.e. Textbox).<br>
&gt;&gt;<br>
&gt;&gt; e.g.<br>
&gt;&gt;<br>
&gt;&gt; jQTouch with Xcode,<br>
&gt;&gt;<br>
&gt;&gt; &lt;ul class=&quot;edit rounded&quot;&gt;<br>
&gt;&gt;      &lt;li&gt;Longitude: &lt;input id=&#39;lng&#39; type=&quot;text&quot; value=&#39;&#39; /&gt;&lt;/li&gt;<br>
&gt;&gt;      &lt;li&gt;Latitude: &lt;input id=&#39;lat&#39; type=&quot;text&quot; value=&#39;&#39; /&gt;&lt;/li&gt;<br>
&gt;&gt; &lt;/ul&gt;<br>
&gt;&gt;<br>
&gt;&gt; Now, the question is, would I be able to get icon from the local<br>
&gt;&gt; directory, not from http server?<br>
&gt;&gt;<br>
&gt;&gt; In this example below, it seems that OpenLayers.Icon is retrieved from<br>
&gt;&gt; http server.<br>
&gt;&gt;<br>
&gt;&gt; ~~~~~~<br>
&gt;&gt; var icon = new OpenLayers.Icon(&#39;<br>
&gt;&gt; <a href="http://www.openstreetmap.org/openlayers/img/marker.png" target="_blank">http://www.openstreetmap.org/openlayers/img/marker.png</a>&#39;,size,offset);<br>
&gt;&gt; layerMarkers.addMarker(new OpenLayers.Marker(lonLat,icon));<br>
&gt;&gt; ~~~~~~<br>
&gt;&gt; from,  <a href="http://wiki.openstreetmap.org/wiki/Openlayers_Track_example" target="_blank">http://wiki.openstreetmap.org/wiki/Openlayers_Track_example</a><br>
&gt;&gt;<br>
&gt;&gt; If not, would vector maker good option for this?<br>
&gt;&gt;<br>
&gt;&gt; In this example, <a href="http://openlayers.org/dev/examples/geolocation.html" target="_blank">http://openlayers.org/dev/examples/geolocation.html</a><br>
&gt;&gt;<br>
&gt;&gt; How can I mapulated this function to cater to the lon and lat values<br>
&gt;&gt; from the GPS?<br>
&gt;&gt;<br>
&gt;&gt; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
&gt;&gt; var geolocate = new OpenLayers.Control.Geolocate({<br>
&gt;&gt;    bind: false,<br>
&gt;&gt;    geolocationOptions: {<br>
&gt;&gt;        enableHighAccuracy: false,<br>
&gt;&gt;        maximumAge: 0,<br>
&gt;&gt;        timeout: 7000<br>
&gt;&gt;    }<br>
&gt;&gt; });<br>
&gt;&gt; map.addControl(geolocate);<br>
&gt;&gt; var firstGeolocation = true;<br>
&gt;&gt; geolocate.events.register(&quot;locationupdated&quot;,geolocate,function(e) {<br>
&gt;&gt;    vector.removeAllFeatures();<br>
&gt;&gt;    var circle = new OpenLayers.Feature.Vector(<br>
&gt;&gt;        OpenLayers.Geometry.Polygon.createRegularPolygon(<br>
&gt;&gt;            new OpenLayers.Geometry.Point(e.point.x, e.point.y),<br>
&gt;&gt;            e.position.coords.accuracy/2,<br>
&gt;&gt;            40,<br>
&gt;&gt;            0<br>
&gt;&gt;        ),<br>
&gt;&gt;        {},<br>
&gt;&gt;        style<br>
&gt;&gt;    );<br>
&gt;&gt;    vector.addFeatures([<br>
&gt;&gt;        new OpenLayers.Feature.Vector(<br>
&gt;&gt;            e.point,<br>
&gt;&gt;            {},<br>
&gt;&gt;            {<br>
&gt;&gt;                graphicName: &#39;cross&#39;,<br>
&gt;&gt;                strokeColor: &#39;#f00&#39;,<br>
&gt;&gt;                strokeWidth: 2,<br>
&gt;&gt;                fillOpacity: 0,<br>
&gt;&gt;                pointRadius: 10<br>
&gt;&gt;            }<br>
&gt;&gt;        ),<br>
&gt;&gt;        circle<br>
&gt;&gt;    ]);<br>
&gt;&gt;    if (firstGeolocation) {<br>
&gt;&gt;        map.zoomToExtent(vector.getDataExtent());<br>
&gt;&gt;        pulsate(circle);<br>
&gt;&gt;        firstGeolocation = false;<br>
&gt;&gt;        this.bind = true;<br>
&gt;&gt;    }<br>
&gt;&gt; });<br>
&gt;&gt; geolocate.events.register(&quot;locationfailed&quot;,this,function() {<br>
&gt;&gt;    OpenLayers.Console.log(&#39;Location detection failed&#39;);<br>
&gt;&gt; });<br>
&gt;&gt; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
&gt;&gt;<br>
&gt;&gt; Any ideas and implementation how to do this?<br>
&gt;&gt;<br>
&gt;&gt; Thanks.<br>
&gt;&gt;<br>
&gt;&gt; Regards, Noli<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Users mailing list<br>
&gt;&gt; <a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
&gt;&gt; <a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
&gt;&gt;<br>
&gt;<br>
</div></div></blockquote></div><br></div></div>