<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Accessing the GPS in iPhone Safari</title>
	<atom:link href="http://www.thecssninja.com/javascript/geolocation-iphone/feed" rel="self" type="application/rss+xml" />
	<link>http://www.thecssninja.com/javascript/geolocation-iphone</link>
	<description>All things CSS, Javascript &#38; xhtml</description>
	<lastBuildDate>Tue, 07 Sep 2010 21:49:48 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
	<item>
		<title>By: Billp</title>
		<link>http://www.thecssninja.com/javascript/geolocation-iphone/comment-page-1#comment-2012</link>
		<dc:creator>Billp</dc:creator>
		<pubDate>Fri, 27 Aug 2010 23:38:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecssninja.com/?p=287#comment-2012</guid>
		<description>Thanks for the reply on timeout. I&#039;m resigned to requiring my users to set auto lock to never and to reduce screen brightness.
I&#039;ve got a live demo that stores path info running at logsitall.com/geo/geo-second.asp - feedback would be welcome.</description>
		<content:encoded><![CDATA[<p>Thanks for the reply on timeout. I&#8217;m resigned to requiring my users to set auto lock to never and to reduce screen brightness.<br />
I&#8217;ve got a live demo that stores path info running at logsitall.com/geo/geo-second.asp &#8211; feedback would be welcome.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flemming</title>
		<link>http://www.thecssninja.com/javascript/geolocation-iphone/comment-page-1#comment-2010</link>
		<dc:creator>Flemming</dc:creator>
		<pubDate>Fri, 27 Aug 2010 06:39:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecssninja.com/?p=287#comment-2010</guid>
		<description>@Bill P - I agree with CSS Ninja - unfortunately this cannot be done through the Javascript API. The only way to keep getting position updates in Safari via the JS API is to manually disable the sleep setting in the iphone. 

If you are writing a native app, you can however work around this &quot;problem&quot; by doing something like this:

- (void)applicationDidFinishLaunching:(UIApplication *)application {

    application.idleTimerDisabled = YES;
    [window addSubview:[rootViewController view]];
    [window makeKeyAndVisible];
}

But this API is not exposed via Javascript, so that can only be done in native apps. I wrote a hybdid app that almost had no native code other than the code above to disable the sleep timer - the rest of my application was written using the javascript API.

As CSS Ninja says when you disable the idleTimer it will lead to serious battery drain, because not only will the GPS keep updating, the screen will also be on maximum brightness, the accelerometer will keep updating etc. etc. It would be nice if I could just turn on GPS updates and let the rest of the hardware go into sleep as usual.</description>
		<content:encoded><![CDATA[<p>@Bill P &#8211; I agree with CSS Ninja &#8211; unfortunately this cannot be done through the Javascript API. The only way to keep getting position updates in Safari via the JS API is to manually disable the sleep setting in the iphone. </p>
<p>If you are writing a native app, you can however work around this &#8220;problem&#8221; by doing something like this:</p>
<p>- (void)applicationDidFinishLaunching:(UIApplication *)application {</p>
<p>    application.idleTimerDisabled = YES;<br />
    [window addSubview:[rootViewController view]];<br />
    [window makeKeyAndVisible];<br />
}</p>
<p>But this API is not exposed via Javascript, so that can only be done in native apps. I wrote a hybdid app that almost had no native code other than the code above to disable the sleep timer &#8211; the rest of my application was written using the javascript API.</p>
<p>As CSS Ninja says when you disable the idleTimer it will lead to serious battery drain, because not only will the GPS keep updating, the screen will also be on maximum brightness, the accelerometer will keep updating etc. etc. It would be nice if I could just turn on GPS updates and let the rest of the hardware go into sleep as usual.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Css Ninja</title>
		<link>http://www.thecssninja.com/javascript/geolocation-iphone/comment-page-1#comment-2008</link>
		<dc:creator>The Css Ninja</dc:creator>
		<pubDate>Thu, 26 Aug 2010 23:27:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecssninja.com/?p=287#comment-2008</guid>
		<description>@Bill P - If you&#039;re wanting the &lt;code&gt;watchPosition&lt;/code&gt; function to keep updating the users location even when the phone is asleep I think you&#039;re out of luck. Not only would that be a serious privacy issue but also a serious battery drain.</description>
		<content:encoded><![CDATA[<p>@Bill P &#8211; If you&#8217;re wanting the <code>watchPosition</code> function to keep updating the users location even when the phone is asleep I think you&#8217;re out of luck. Not only would that be a serious privacy issue but also a serious battery drain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bill patton</title>
		<link>http://www.thecssninja.com/javascript/geolocation-iphone/comment-page-1#comment-1996</link>
		<dc:creator>bill patton</dc:creator>
		<pubDate>Thu, 26 Aug 2010 00:57:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecssninja.com/?p=287#comment-1996</guid>
		<description>thanks to this (and some other) great tutorials i&#039;ve got my web app running - however i&#039;m curious about how to control the &#039;time out&#039; value of the browser. Once the iPhone goes to sleep it stops sending position and location. Can this be controlled?

-bill</description>
		<content:encoded><![CDATA[<p>thanks to this (and some other) great tutorials i&#8217;ve got my web app running &#8211; however i&#8217;m curious about how to control the &#8216;time out&#8217; value of the browser. Once the iPhone goes to sleep it stops sending position and location. Can this be controlled?</p>
<p>-bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Css Ninja</title>
		<link>http://www.thecssninja.com/javascript/geolocation-iphone/comment-page-1#comment-1964</link>
		<dc:creator>The Css Ninja</dc:creator>
		<pubDate>Thu, 19 Aug 2010 00:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecssninja.com/?p=287#comment-1964</guid>
		<description>@cam - You could call the &lt;code&gt;getCurrentPosition&lt;/code&gt; using the &lt;code&gt;setInterval&lt;/code&gt; method and set it to fire every 5mins(300000ms) and then save the position using localStorage e.g.

&lt;pre lang=&quot;javascript&quot;&gt;
navigator.geolocation.getCurrentPosition(success, fail);

function success(pos) {
    // Do something with position
    
    // Store position in localStrorage
    window.localStorage.setItem(&quot;coords&quot;, 
    [pos.coords.latitude,pos.coords.longitude]);

    var getPositionInterval = window.setInterval(
        &quot;navigator.geolocation.getCurrentPosition(success, fail)&quot;,
         300000);
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@cam &#8211; You could call the <code>getCurrentPosition</code> using the <code>setInterval</code> method and set it to fire every 5mins(300000ms) and then save the position using localStorage e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;">navigator.<span style="color: #660066;">geolocation</span>.<span style="color: #660066;">getCurrentPosition</span><span style="color: #009900;">&#40;</span>success<span style="color: #339933;">,</span> fail<span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> success<span style="color: #009900;">&#40;</span>pos<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// Do something with position</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// Store position in localStrorage</span>
    window.<span style="color: #660066;">localStorage</span>.<span style="color: #660066;">setItem</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;coords&quot;</span><span style="color: #339933;">,</span> 
    <span style="color: #009900;">&#91;</span>pos.<span style="color: #660066;">coords</span>.<span style="color: #660066;">latitude</span><span style="color: #339933;">,</span>pos.<span style="color: #660066;">coords</span>.<span style="color: #660066;">longitude</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>;
&nbsp;
    <span style="color: #003366; font-weight: bold;">var</span> getPositionInterval <span style="color: #339933;">=</span> window.<span style="color: #660066;">setInterval</span><span style="color: #009900;">&#40;</span>
        <span style="color: #3366CC;">&quot;navigator.geolocation.getCurrentPosition(success, fail)&quot;</span><span style="color: #339933;">,</span>
         <span style="color: #CC0000;">300000</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: cam</title>
		<link>http://www.thecssninja.com/javascript/geolocation-iphone/comment-page-1#comment-1952</link>
		<dc:creator>cam</dc:creator>
		<pubDate>Wed, 18 Aug 2010 06:56:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecssninja.com/?p=287#comment-1952</guid>
		<description>Would it be possible to write a small app that gets gps periodically. Lets say every 5 minutes and then writes a file to the iphone with the coordinates. Could this easily be done in javascript or jquery?</description>
		<content:encoded><![CDATA[<p>Would it be possible to write a small app that gets gps periodically. Lets say every 5 minutes and then writes a file to the iphone with the coordinates. Could this easily be done in javascript or jquery?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Css Ninja</title>
		<link>http://www.thecssninja.com/javascript/geolocation-iphone/comment-page-1#comment-1866</link>
		<dc:creator>The Css Ninja</dc:creator>
		<pubDate>Tue, 20 Jul 2010 00:24:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecssninja.com/?p=287#comment-1866</guid>
		<description>@Idiot - 

Any browser that says they support the geolocation API will abide by the specification which states:

&lt;blockquote cite=&quot;http://www.w3.org/TR/geolocation-API/#coordinates_interface&quot;&gt;The latitude and longitude  attributes are geographic coordinates specified in decimal degrees.&lt;/blockquote&gt;

So it should always supply the coordinates in decimal degrees. Trying to work with any other format would be a nightmare in javascript.</description>
		<content:encoded><![CDATA[<p>@Idiot &#8211; </p>
<p>Any browser that says they support the geolocation API will abide by the specification which states:</p>
<blockquote cite="http://www.w3.org/TR/geolocation-API/#coordinates_interface"><p>The latitude and longitude  attributes are geographic coordinates specified in decimal degrees.</p></blockquote>
<p>So it should always supply the coordinates in decimal degrees. Trying to work with any other format would be a nightmare in javascript.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Idiot</title>
		<link>http://www.thecssninja.com/javascript/geolocation-iphone/comment-page-1#comment-1864</link>
		<dc:creator>Idiot</dc:creator>
		<pubDate>Mon, 19 Jul 2010 17:42:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecssninja.com/?p=287#comment-1864</guid>
		<description>I do not have an iPhone, so I am going on faith here.  I assume that the latitude and longitude are returned in decimal format?  

As you know, there are three different GPS formats:  decimal (45.758759), degrees-minutes (N 19° 38.416), and degrees-minutes-seconds (N 19° 38&#039; 13&#039;&#039;).

If the return values of the coordinates are not in decimal format, please let us know.  Thanks!</description>
		<content:encoded><![CDATA[<p>I do not have an iPhone, so I am going on faith here.  I assume that the latitude and longitude are returned in decimal format?  </p>
<p>As you know, there are three different GPS formats:  decimal (45.758759), degrees-minutes (N 19° 38.416), and degrees-minutes-seconds (N 19° 38&#8242; 13&#8221;).</p>
<p>If the return values of the coordinates are not in decimal format, please let us know.  Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Css Ninja</title>
		<link>http://www.thecssninja.com/javascript/geolocation-iphone/comment-page-1#comment-1658</link>
		<dc:creator>The Css Ninja</dc:creator>
		<pubDate>Mon, 05 Jul 2010 03:29:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecssninja.com/?p=287#comment-1658</guid>
		<description>@Koyetsu - Google has a &lt;a href=&quot;http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding&quot; rel=&quot;nofollow&quot;&gt;reverse geocoding service&lt;/a&gt; just pass your latlng to that and it will return JSON</description>
		<content:encoded><![CDATA[<p>@Koyetsu &#8211; Google has a <a href="http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding" rel="nofollow">reverse geocoding service</a> just pass your latlng to that and it will return JSON</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: koyetsu</title>
		<link>http://www.thecssninja.com/javascript/geolocation-iphone/comment-page-1#comment-1637</link>
		<dc:creator>koyetsu</dc:creator>
		<pubDate>Tue, 29 Jun 2010 23:17:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.thecssninja.com/?p=287#comment-1637</guid>
		<description>Ok, so pulling the gps location isn&#039;t hard...what i can&#039;t seem to find, anywhere is example code of how in the heck you turn it into a city/state location. i don&#039;t wanna map all i need is a fricken plain text &quot;New York City, NY&quot; dropped into a text box. and i can&#039;t seem to find anything like that anywhere. if someone can help me out i would appreciate it. i&#039;m sure it has to do with reverse geocoding but about half the sites i found on that don&#039;t work and the rest don&#039;t work either! hehe.
Let me know if you can point me at a resource or have sample code to share.

koyetsu AT yahoo DOT com</description>
		<content:encoded><![CDATA[<p>Ok, so pulling the gps location isn&#8217;t hard&#8230;what i can&#8217;t seem to find, anywhere is example code of how in the heck you turn it into a city/state location. i don&#8217;t wanna map all i need is a fricken plain text &#8220;New York City, NY&#8221; dropped into a text box. and i can&#8217;t seem to find anything like that anywhere. if someone can help me out i would appreciate it. i&#8217;m sure it has to do with reverse geocoding but about half the sites i found on that don&#8217;t work and the rest don&#8217;t work either! hehe.<br />
Let me know if you can point me at a resource or have sample code to share.</p>
<p>koyetsu AT yahoo DOT com</p>
]]></content:encoded>
	</item>
</channel>
</rss>
