<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div>That did it!</div><div><br></div><div>That and removing the reference to the projection. &nbsp;Thanks to Dave Winfield's help, I realised that EPSG:27700 is not, in fact, the OS grid I was using. &nbsp;Since it's a simple cartesian grid, though, I just removed all reference to projection but kept the maxExtents and that worked fine. &nbsp;If you visit the site again, you'll see the map complete with markers (nevermind the few outliers in the sea, though). &nbsp;</div><div><br></div><div><a href="http://www.thomasav.com/countiesimage.html">http://www.thomasav.com/countiesimage.html&nbsp;</a></div><div><br></div><div>Thanks to everyone!</div><div><br></div><div>-- Anthony</div><div><br></div><br><div><div>On Jul 23, 2009, at 10:20 PM, Arnd Wippermann wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">  <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="062001821-23072009">Hi,</span></font></div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="062001821-23072009"></span></font>&nbsp;</div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="062001821-23072009">insert&nbsp;maxResolution to your options2, then it should work.</span></font></div> <div dir="ltr" align="left"><font face="Arial" color="#0000ff" size="2"><span class="062001821-23072009"></span></font>&nbsp;</div> <div dir="ltr" align="left"><font><font face="Arial" color="#0000ff" size="2">var options2 = {numZoomLevels:&nbsp;<span class="062001821-23072009">3</span>, projection: "EPSG:27700", isBaseLayer: true, maxResolution:1000};<br></font></font></div><font> </font><div><span class="062001821-23072009"></span><font face="Arial"><font color="#0000ff"><font size="2">Arnd</font></font></font></div> <div><font face="Arial"><font color="#0000ff"><font size="2"><span class="062001821-23072009"></span></font></font></font><br>&nbsp;</div> <div class="OutlookMessageHeader" lang="de" dir="ltr" align="left"> <hr tabindex="-1"> <font face="Tahoma" size="2"><b>Von:</b> users-bounces@openlayers.org [<a href="mailto:users-bounces@openlayers.org">mailto:users-bounces@openlayers.org</a>] <b>Im Auftrag von </b>Anthony Masinton<br><b>Gesendet:</b> Donnerstag, 23. Juli 2009 16:07<br><b>An:</b> <a href="mailto:users@openlayers.org">users@openlayers.org</a><br><b>Betreff:</b> [OpenLayers-Users] Map Image Layer<br></font><br></div> <div></div><br clear="all"> <div></div> <div>Good afternoon,</div> <div>&nbsp;</div> <div>I've been beating my head against this all day so I'll ask for wisdom from the group.</div> <div>&nbsp;</div> <div>I'm trying to create a simple map of England with the outlines of all of the counties.&nbsp; I have an image which showing this, which I would like to use as my basemap&nbsp;for an eventual marker overlay.</div> <div>&nbsp;</div> <div>Because all of my marker coordinates are in Ordnance Survey British National Grid format (x and y are six digit numbers), I have georeferenced this image in ArcGIS to get the image bounds.&nbsp; I have then noted these bounds in the extents of the image.</div> <div>&nbsp;</div> <div>The map is here: <a href="http://www.thomasav.com/countiesimage.html">http://www.thomasav.com/countiesimage.html</a></div> <div>&nbsp;</div> <div>As you can see, this is simply the image layer example but with the WMS layer removed and the properties of the image layer altered to suit my image.</div> <div>&nbsp;</div> <div>As you can alos see, nothing happens when the page loads. The image area is blank.&nbsp; Firebug tells me that map is undefined.&nbsp; I can't figure out what this means, as the only thing I've changed is image layer itself.</div> <div>&nbsp;</div> <div>The code for the page follows, as you can see, I've tried a few things to fix this (commented out) but to no avail.</div> <div>&nbsp;</div> <div>Many many thanks for your time and comments.</div> <div>-- Anthony</div> <div>&nbsp;</div> <div>Code:</div> <div>&lt;html xmlns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>"&gt;<br>&nbsp; &lt;head&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;title&gt;OpenLayers Image Layer Example&lt;/title&gt;<br>&nbsp;&nbsp;&nbsp; &lt;link rel="stylesheet" href="/theme/default/style.css" type="text/css" /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;link rel="stylesheet" href="style.css" type="text/css" /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;style type="text/css"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; p.caption {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width: 512px;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &lt;/style&gt;<br>&nbsp;&nbsp;&nbsp; &lt;script src="/lib/OpenLayers.js"&gt;&lt;/script&gt;<br>&nbsp;&nbsp;&nbsp; &lt;script type="text/javascript"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var map;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function init(){<br>&nbsp;&nbsp;<br>//&nbsp;&nbsp;&nbsp;var options = {<br>//&nbsp;&nbsp;&nbsp;maxExtent: new OpenLayers.Bounds(125755.604,922.206,662492.41,661558.365),<br>//&nbsp;&nbsp;&nbsp;var center = bounds.getCenterLonLat(400000, 400000),<br>//&nbsp;&nbsp;&nbsp;maxResolution: 156543,<br>//&nbsp;&nbsp;&nbsp;units: 'm',<br>//&nbsp;&nbsp;&nbsp;projection: "EPSG:27700"<br>//&nbsp;&nbsp;&nbsp;isBaseLayer: true<br>//&nbsp;&nbsp;&nbsp;};<br>&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map = new OpenLayers.Map ("map");</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var options2 = {numZoomLevels: 3, projection: "EPSG:27700", isBaseLayer: true};</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var graphic = new OpenLayers.Layer.Image(<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Counties',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '<a href="http://www.thomasav.com/england.jpg">http://www.thomasav.com/england.jpg</a>',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new OpenLayers.Bounds(125755.604,922.206,662492.41,661558.365),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new OpenLayers.Size(2231, 2746),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; options2);</div> <div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addLayers([graphic]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addControl(new OpenLayers.Control.LayerSwitcher());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.zoomToMaxExtent();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; &lt;/script&gt;<br>&nbsp; &lt;/head&gt;<br>&nbsp; &lt;body onload="init()"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;h1 id="title"&gt;Image Layer Example&lt;/h1&gt;</div> <div>&nbsp;&nbsp;&nbsp; &lt;div id="tags"&gt;&lt;/div&gt;</div> <div>&nbsp;&nbsp;&nbsp; &lt;p id="shortdesc"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Demonstrate a single non-tiled image as a selectable base layer.<br>&nbsp;&nbsp;&nbsp; &lt;/p&gt;</div> <div>&nbsp;&nbsp;&nbsp; &lt;div style="width:100%; height:100%" id="map"&gt;&lt;/div&gt;</div> <div>&nbsp;&nbsp;&nbsp; &lt;div id="docs"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;p class="caption"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The "City Lights" layer above is created from a single web accessible<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; image.&nbsp; If you construct it without any resolution related options,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the layer will be given a single resolution based on the extent/size.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Otherwise, it behaves much like a regular layer.&nbsp; This is primarily<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; intended to be used in an overview map - where another layer type<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; might not make a good overview.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/p&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/div&gt;<br>&nbsp; &lt;/body&gt;<br>&lt;/html&gt;</div> <div>&nbsp;</div> <div><br><br>&nbsp;</div></blockquote></div><br></body></html>