[OpenLayers-Dev] List of Layers

Christopher Schmidt crschmidt at metacarta.com
Thu Mar 15 17:19:42 EDT 2007


On Thu, Mar 15, 2007 at 09:52:57PM +0100, Antonio wrote:
> Hi guys,
> 
> I didn't find any method to get info about the layers available on my 
> mapfile, something that say me how many and how they are named.

OpenLayers doesn't talk to the map server you are using to learn about
the layers. You need to specify the layers in the javascript setup for
your OpenLayers Map. 

> I can just load a layer from a WMS server specifying a layer name.
> Have I to use some php/java scripts to do that, or I am not  looking in 
> the right place?

The functionality that you are looking for does not exist in OpenLayers.
Where possible, OpenLayers has taken a 'you can't talk to the server'
approach due to the Same Origin Policy. [1]

[1] http://en.wikipedia.org/wiki/Same_origin_policy

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Dev mailing list