My OpenLayers Map consists of two image layers, one of the is an aerial photo that should serve as a base layer, the other a semi-transparent overlay image.<br><br>Both images are dynamically generated on the server based on extent information supplied by the client. As a consequence, I don&#39;t know the urls of these images in advance, therefore I have to wait with the layer creation until the server responds my request with an image url plus extent information.<br>
<br>This approach works fine with one image layer, but with the 2 dynamic images i run into the following problems:<br><br>* The overlay image is generated much faster than the aerial photo. As OpenLayers automatically assigns the first image layer as base layer, the layer order is wrong (overlay not shown, because it is below rendered below the aerial layer). However I don&#39;t want to wait with the layer generation until both images have arrived because this would mean a rather poor &quot;perceived&quot; performance. My goal is to show the overlay image as base layer until the aerial image has arrived, but from that moment on it should be an overlay layer. How can I implement this behaviour?<br>
<br>* Dragging or Zooming the image layers should trigger a re-rendering of both images based on the changed extent of the map. I am not sure which event listener strategy i should choose for this scenario. One option would be to assign an &quot;autonomous&quot;  moveend/zoomend handler to each image layer that just re-requests the contained image and then re-creates the layer with the new image. The other option is a global map handler that requests both images at once. As the server-side map creation is quite performance intensive, i want to avoid duplicate requests caused by &quot;bubbled up&quot; events. Which option is better in this regard?  <br>
<br>thanks in advance,<br><br>Franz<br>