<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Save9 &#187; Demo</title>
	<atom:link href="http://www.save9.com/tag/demo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.save9.com</link>
	<description>Web Design, IT Support, Accounts, CRM and Communications</description>
	<lastBuildDate>Tue, 13 Dec 2011 14:15:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ordnance Survey OpenSpace Demo</title>
		<link>http://www.save9.com/2010/01/ordnance-survey-openspace-demo/</link>
		<comments>http://www.save9.com/2010/01/ordnance-survey-openspace-demo/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 10:12:52 +0000</pubDate>
		<dc:creator>Richard Askew</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Demo]]></category>
		<category><![CDATA[Maps]]></category>
		<category><![CDATA[OpenSpace]]></category>
		<category><![CDATA[Ordnance Survey]]></category>

		<guid isPermaLink="false">http://www.save9.com/?p=3040</guid>
		<description><![CDATA[Last week I wrote a quick article about the release of OpenSpace. I have had the opportunity to play around with it and below is a little demo to get you started]]></description>
			<content:encoded><![CDATA[<p>Last week I wrote a quick article about the release of OpenSpace. I have had the opportunity to play around with it and below is a little demo to get you started:</p>
<ul>
<li>The first step is to <a href="http://openspace.ordnancesurvey.co.uk/osmapapi/register.do">sign-up</a> for your API key &#8211; once done you will receive an email and you are ready to go.</li>
<li>When you receive your API key you will need to call the API, I did this by placing the following code inside the header:<code><br />
&lt;script type="text/javascript" src="http://openspace.ordnancesurvey.co.uk/osmapapi/openspace.js?key=paste_your_API_key_here"&gt;<br />
</code></li>
<li>Once you have done this you are ready to start constructing your javascript.. You can customise this code but I have created a Javascript function as below:<code><br />
&lt;script type="text/javascript"&gt;<br />
//&lt;![CDATA[<br />
var osMap;<br />
function init() {<br />
<br />
//Create a new instance of osMap<br />
//The 'os-map' indicates the name of our div and where it will show<br />
osMap = new OpenSpace.Map('os-map');<br />
<br />
//I find it easier to work with Lat/Long so create a lonlat var<br />
var lonlat = new OpenLayers.LonLat(-0.4020 , 54.2798);<br />
<br />//In this case we will put a grid on the map<br />
var gridProjection = new OpenSpace.GridProjection();<br />
<br />//As I want to work around a centralised point I will create a variable for it<br />
//I  have passed in the longitude and latitude variable from above<br />
var pos = gridProjection.getMapPointFromLonLat(lonlat);<br />
<br />//Now set the center of the map - using the previous variable<br />
osMap.setCenter(pos, 7);<br />
<br />//Finally add a marker - again using longitude and latitude<br />
var markers = new OpenLayers.Layer.Markers("Markers");<br />
osMap.addLayer(markers);<br />
var marker = new OpenLayers.Marker(pos);<br />
markers.addMarker(marker);</p>
<p>}<br />
//]]&gt;<br />
&lt;/script&gt;<br />
</code></li>
<li>In order to get the map to display you must do two things. Create a div with the name specified in the above code (os-map):<br />
<code><br />
&lt;div id="os-map" style="height:400px;width:400px;"&gt;<br />
</code></li>
<li>Secondly call your javascript function:<br />
<code><br />
&lt;body onload="init()"&gt;<br />
</code></li>
<li>You should now be left with a finished map:</li>
</ul>
<div id="os-map" style="height:500px;width:400px;"></div>
<p>This implementation will be very familiar to users of Google Maps. The demo above is a quick implementation to give you an idea of the basic principles. You may need to implement it in a different way but follow these basic steps and you should get there. We have shown:</p>
<ul>
<li>How to center a grid</li>
<li>Position a marker</li>
<li>Add Grid lines</li>
</ul>
<p>For more information or advice please visit <a href="http://openspace.ordnancesurvey.co.uk/openspace/developerarea.html">OpenSpace</a> directly where they have a developer community and tutorials.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.save9.com/2010/01/ordnance-survey-openspace-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

