<?xml version="1.0" encoding="iso-8859-1"?><rss version="0.91">
    <channel>
        <title>phpguru.org - Richard Heyes' ramblings and code</title>
        <link>http://www.phpguru.org/</link>
        <description>
            Quality PHP and Javascript code, along with a mild smattering of humour. Also second home of the RGraph HTML5 canvas graph library.
        </description>

                    <item>
                <title>6th March RGraph release</title>
                <link>http://www.phpguru.org/article/456</link>
                <pubDate>Sat, 06 Mar 2010 21:36:18 +0000</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">As Spring rolls inevitably on outside (ie it's getting warmer at last!), here's another RGraph release:

<ul>
  <li>Documented shadow properties for the Meter chart</li>
  <li>Added <i>RGraph.getPageWidth()</i> and <i>RGraph.getPageHeight()</i> functions</li>
  <li>Increased the radius of the ModalDialog corners (ie they're more curvy now)</li>
  <li>Documented the ModalDialog CSS classes</li>
  <li>Added context menu to the MSIE example</li>
</ul>


<a href="http://www.rgraph.net" style="float: right; font-weight: bold">Go to the RGraph website &raquo;</a>]]>
                </description>
            </item>
                    <item>
                <title>HTML5 GeoLocation example</title>
                <link>http://www.phpguru.org/article/455</link>
                <pubDate>Fri, 05 Mar 2010 21:48:12 +0000</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter"><p class="firstLetter">
    An introduction to the HTML5 GeoLocation API. For this to work (currently) you will need to be on the Chrome dev channel which you
    should use at your own risk (!), or alternatively using Firefox 3.6. There's a bare bones page which demonstrates the API
    <a href="../geolocation.html" target="_blank"><b>here</b></a>.
</p>

<h4>Step one</h4>

<p>
    You can use standard object testing to determine if the browser supports GeoLocation.
</p>

<pre class="code">
&lt;script&gt;
    /**
    * This function is the callback which is passed the result from the .getCurrentPosition()
    * function. The pos argument can contain more information than just the latitude/longitude,
    * such as altitude, accuracy and speed information.
    * 
    * @param object pos The result from the getCurrentPosition() call
    */
    function myCallback(pos)
    {
        var myLatitude  = pos.latitude;
        var myLongitude = pos.longitude;
    }

    <span style="color: green">
    /**
    * Test for GeoLocation support and make the call
    */
    if (navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(myCallback);
    } else {
        alert("Sorry, your browser doesn't appear to support GeoLocation");
    }
    </span>
&lt;/script&gt;
</pre>

<h4>Step two</h4>

<p>
    Once you have tested for it, we can then retrieve the position using the getCurrentPosition() method. You pass this method
    a callback function which you define. This callback function is given an object (if successful), with various properties:
    
    <ul>
        <li>latitude</li>
        <li>longitude</li>
        <li>altitude (optional)</li>
        <li>accuracy</li>
        <li>altitudeAccuracy (optional)</li>
        <li>heading (optional)</li>
        <li>speed (optional)</li>
        <li>timestamp</li>
    </ul>
</p>

<H4>The example page</H4>

<p>
    The example page is <a href="/geolocation.html"><b>here</b></a>. This is bare bones so dissecting it shouldn't be too much trouble.
</p>


<h4>How does it work?</h4>
<p>
    The GeoLocation API works by retrieving geographical information associated with Internet hardware. From the specification:<br /><br />
    <span style="color: green">
        "Common sources of location information include Global Positioning System (GPS) and location inferred from network signals
        such as IP address, RFID, WiFi and Bluetooth MAC addresses, and GSM/CDMA cell IDs, as well as user input. No guarantee is
        given that the API returns the device's actual location."
    </span>
</p>


<h4>Related links</h4>
<ul>
    <li><a href="http://dev.w3.org/geo/api/spec-source.html" rel="nofollow" target="_blank">The W3C GeoLocation specification</a></li>
</ul>]]>
                </description>
            </item>
                    <item>
                <title>27th February RGraph release</title>
                <link>http://www.phpguru.org/article/454</link>
                <pubDate>Sun, 28 Feb 2010 02:03:04 +0000</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">Todays release is a little later in the day due to pesky social commitments. Tut. Anyhoo, this release includes:

<ul>
  <li>Added information about the coords array.</li>
  <li>Added information about dynamically updating your graphs.</li>
  <li>Zoom in canvas mode now has a dark background option - chart.zoom.background - can be true or false and defaults to true. Note: If you use the full canvas zoom, this will affect you - if you don't like it, you will need to turn it off.</li>
  <li>Added RGraph_zoomed_canvas CSS class. Also tweaked the default CSS for the two types of zoom.</li>
  <li>Tweaked the animation example.</li>
  <li>You can now stipulate two colors instead of one for the line chart (one for up, and one for down). For an example of this, see the <a href="http://www.rgraph.net/examples/line.html">last line chart example</a>.</li>
</ul>

<a href="http://www.rgraph.net" style="float: right; font-weight: bold">Go to the RGraph website &raquo;</a>]]>
                </description>
            </item>
                    <item>
                <title>20th February RGraph release</title>
                <link>http://www.phpguru.org/article/452</link>
                <pubDate>Sat, 20 Feb 2010 15:50:45 +0000</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">Unfortunately my shower isn't working at the moment, so this release 
may be a bit whiffy. Still, here's the list of changes: 

<ul>
  <li>Added a reasonable performance strategy to the docs</li>
  <li>Expanded the API docs regarding the data properties</li>
  <li>Removed the chart.border property from the line chart. You should use 
CSS on your canvas element 
    instead.</li>
  <li>Added chart.ymin property to the line chart</li>
  <li>Tickmarks are no longer drawn on the line chart if the tick is 
outside the Y scale range</li>
  <li>Added shadow control to the Meter</li>
  <li>Fixed the issue with the front page graphs on the website, Google 
Chrome and missing text. This was done by NOT using asynchronous processing. </li>
</ul>

<a href="http://www.rgraph.net" style="float: right; font-weight: bold">Go to the RGraph website &raquo;</a>]]>
                </description>
            </item>
                    <item>
                <title>Minor RGraph release</title>
                <link>http://www.phpguru.org/article/451</link>
                <pubDate>Wed, 10 Feb 2010 01:46:03 +0000</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">There's a new RGraph release available. Only a few tweaks in this release which fix the Pie chart sticks, and add link anchors to the documentation (eg <a href="http://www.rgraph.net/docs/bar.html#chart.background.hbars">http://www.rgraph.net/docs/bar.html#chart.background.hbars</a>)]]>
                </description>
            </item>
                    <item>
                <title>7th February RGraph release</title>
                <link>http://www.phpguru.org/article/450</link>
                <pubDate>Sun, 07 Feb 2010 16:29:05 +0000</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">The following changes are in this release:

<ul>
  <li>Added ability to specify number of Y labels - 1, 3 or 5 (the 
default) to the Bar, Line and Scatter charts</li>
  <li>Added a little missing documentation to the Line and Scatter 
charts</li>
  <li>Small fix to MSIE arrow style tickmarks on the Line chart</li>
  <li>More optimisations to all chart libraries</li>
  <li>Added RGraph_zoom_window CSS class - the front page uses it if you 
want an example</li>
</ul>

<a href="http://www.rgraph.net" style="float: right; font-weight: bold">Go to the RGraph website &raquo;</a>]]>
                </description>
            </item>
                    <item>
                <title>31st January RGraph release</title>
                <link>http://www.phpguru.org/article/448</link>
                <pubDate>Sun, 31 Jan 2010 19:32:48 +0000</pubDate>
                <description>
                    <![CDATA[<p class="firstLetter">With less and less going into each release, todays has a bumper four (!) points of (vague) interest:

<ul>
  <li>Tweaked the bar and line chart performance</li>
  <li>Made note about using tables for layout and how it can impact negatively on graph speed</li>
  <li>Documented Pie chart label sticks</li>
  <li>Opera (10.5) now supports the canvas text and shadow APIs</li>
</ul>

<a href="http://www.rgraph.net" style="float: right; font-weight: bold">Go to the RGraph website &raquo;</a>]]>
                </description>
            </item>
            </channel>
</rss>