Me again,<br><br>I gave your hint a try, but it didn&#39;t work. Seems to be projection related. <br>As soon as there is an OSM Layer it seems one needs to project the Church picture.<br><br>Anyway, I gave up on that idea, and started moving the map to another div, and then display the Church picture instead, like this:<br>

<br>OpenLayers.Util.getElement(&#39;map2&#39;).innerHTML = OpenLayers.Util.getElement(&#39;map&#39;).innerHTML ;<br>    <br>OpenLayers.Util.getElement(&#39;map&#39;).innerHTML = &quot;&lt;img src=\&quot;pictures/&quot;+globalresponse.responseText+&quot;\&quot;\/\&gt;&quot;;<br>

<br>Problem is, the map doesn&#39;t work anymore afterwards?<br><br>Actually I am looking for this layout:<br>
One big picture of e.g. a Church, and a small map below (or in a corner of the picture).<br><br>Late render could probably re-render the map, but all browsing done to that moment would be lost.<br>Or can one really just display the overview map, without the map itself?<br>

<br>Ideas please?<br><br>Thanks,<br>Jan<br><br><div class="gmail_quote">On Wed, Jun 24, 2009 at 10:48 AM, Andreas Hocevar <span dir="ltr">&lt;<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi,<br>
<br>
the image layer was not made for displaying non-geographic images, but<br>
for maps. It seems you want to use OpenLayers to display images in the<br>
map pane, and for this we may have a better solution for you.<br>
<br>
Have a look at<br>
<br>
<a href="http://www.openlayers.org/dev/examples/georss-flickr.html" target="_blank">http://www.openlayers.org/dev/examples/georss-flickr.html</a><br>
<br>
This example shows you how to display images on point locations, and in<br>
popups (click on an image to see it).<br>
<br>
As for calculating the image size and the aspect ratio: that&#39;s exactly<br>
what we do for externalGraphic point symbols<br>
(<a href="http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Renderer/VML.js#L365" target="_blank">http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Renderer/VML.js#L365</a>).<br>
So if you want to do this, the solution is to register an<br>
onreadystatechange listener before setting img.src.<br>
<br>
Regards,<br>
<font color="#888888">Andreas.<br>
</font><div><div></div><div class="h5"><br>
Ilya Braude wrote:<br>
&gt;<br>
&gt;<br>
&gt; Andreas Hocevar wrote:<br>
&gt;&gt;&gt; Problem is how to calculate OpenLayers.Bounds?<br>
&gt;&gt;&gt; Simply replacing<br>
&gt;&gt;&gt;    new OpenLayers.Bounds(-180, -88.759, 180, 88.759),<br>
&gt;&gt;&gt; by<br>
&gt;&gt;&gt;   new OpenLayers.Bounds(-20037508, -20037508, 20037508, 20037508.34)<br>
&gt;&gt;&gt; did not work.<br>
&gt;&gt;&gt; (It just blows up a single pixel to cover the whole map-div.)<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; The easiest for image layers that do not have to align with a map is<br>
&gt;&gt; to set the bounds according to the image size. So let&#39;s assume you<br>
&gt;&gt; have an image, like the one in the example, with is 580 pixels wide<br>
&gt;&gt; and 288 pixels high, then the best approach is to set the bounds to 0,<br>
&gt;&gt; 0, 580, 288.<br>
&gt;&gt;<br>
&gt; I have a similar use case where I do this in order to keep the proper<br>
&gt; aspect ratio for the image. However, is there a way to have the bounds<br>
&gt; be calculated automatically without me having to know the image size a<br>
&gt; priori?  For example, if the image URL is dynamic or user-submitted.<br>
&gt;<br>
&gt; The only way I can think to do this (and I haven&#39;t tested this) is to<br>
&gt; have the browser pre-load the image in a new &lt;img/&gt; tag, read the size<br>
&gt; attributes from it, and then use those values for creating the image<br>
&gt; layer.  In this case, how do I know that the image has been downloaded<br>
&gt; for me to read those attributes?<br>
&gt;<br>
&gt; Something like:<br>
&gt;<br>
&gt; var img = new Image();<br>
&gt;<br>
&gt; img.src = &quot;<a href="http://path.to/img/url" target="_blank">http://path.to/img/url</a>&quot;;<br>
&gt;<br>
&gt; ...<br>
&gt;<br>
&gt; var bounds = new OpenLayers.Bounds(0, 0, img.width, img.height);<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Is there a way that OpenLayers can handle this if I don&#39;t care about<br>
&gt; the extent of the image layer, just that it keeps it&#39;s aspect ratio<br>
&gt; without me having to specify the correct (in terms of aspect ratio)<br>
&gt; bounds?<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt;&gt; So how to calculate OpenLayers.Bounds to display the image at its<br>
&gt;&gt;&gt; original<br>
&gt;&gt;&gt; 100% size?<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; See above.<br>
&gt;&gt;<br>
&gt; I assume that by &quot;above&quot; you mean using the pixel size of the image<br>
&gt; for the bounds?  Would it make sense that this would be the default<br>
&gt; behavior for an image layer and implemented by OL directly?<br>
&gt; Thanks,<br>
&gt; Ilya<br>
<br>
<br>
</div></div><div><div></div><div class="h5">--<br>
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
<br>
</div></div></blockquote></div><br>