[OpenLayers-Dev] Open Layers Image layer?

Tim Schaub tschaub at opengeo.org
Wed Mar 11 15:51:40 EDT 2009


Hey-

mortac8 wrote:
> Did you ever get this working?  Can you tell me how you went about it?  I am
> looking to go with a dynamic Image layer solution over WMS in search of
> performance improvements.
> 
> 
> Darko Radiceski wrote:
>> Greetings all,
>>
>> Has anyone played with the image layer in open layers and dynamicly
>> generating images for different scales?
>>

This image layer (OpenLayers.Layer.Image) would not be the appropriate 
layer to accomplish this.  For this layer, a request is only made once 
for the image.  No subsequent requests go out after you zoom/pan.

If you want to set up a service that dynamically generates images, your 
service will need to know about the client resolution & bounds.  This 
information is provided in a request by a WMS layer.

If you have a set of static images and you want the client to request 
different ones based on resolution only (this is different than having 
the server dynamically generate images), then you use the image layer 
and call setUrl with each change in zoom.

This would look something like:

var layer = new OpenLayers.Layer.Image(args);

map.events.on({
     zoomend: function() {
         layer.setUrl("something_to_do_with_" + map.zoom);
     }
});

Tim

>> Like one zoomed lavel and then when the user goes at a location at
>> different
>> zoom level to dynamily request a new image to be generated?
>>
>> Cheers
>> Dan
>>
>>
>> -- 
>> Radiceski Darko
>> University of Wollongong
>> Australia
>> SIFE - UOW Chapter - Alumni
>> CASUAL ACADEMIC STAFF TEACHING - UOW SITACS
>> (School of Information Technology and Computer Science,University of
>> Wollongong)
>> Univeristy of Wollongong - Alumni
>>
>> _______________________________________________
>> Dev mailing list
>> Dev at openlayers.org
>> http://openlayers.org/mailman/listinfo/dev
>>
>>
> 


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Dev mailing list