[OpenLayers-Users] Multiple layers display

Lehtonen, Mika mika at digikartta.net
Fri Aug 15 01:26:19 EDT 2008


Hi Greg,
I believe you need to add layers with:

map.addLayers([stationsLayer,wms]);

instead of separate addLayer, though I am not sure if this is the thing 
preventing both layers to appear.


regards,
- mika -

Greg Ederer kirjoitti:
> Oh, and here's my code:
>
>   wms = new OpenLayers.Layer.WMS(
>     "esv:countries - Tiled", "http://localhost:8080/geoserver/wms",
>     {
>       styles: '',
>       layers: 'esv:countries',
>       width: '800',
>       height: '362',
>       srs: 'EPSG:4326',
>       format: format,
>       tiled: 'true',
>       tilesOrigin : "-198,-98.68117980957031"
>     },
>     {
>       buffer: 0
>     }
>     );
>
>   stationsLayer = new OpenLayers.Layer.WMS(
>     "esv:grid_stations_daily_jan_1979 - Tiled", 
> "http://localhost:8080/geoserver/wms",
>     {
>       styles: '',
>       layers: 'esv:grid_stations_daily_jan_1979',
>       width: '569',
>       height: '550',
>       srs: 'EPSG:4326',
>       format: format,
>       tiled: 'true',
>       tilesOrigin : "-21.339,-40.85165"
>     },
>     {
>       buffer: 0
>     }
>     );
>  
>   map.addLayer(stationsLayer);
>  
>   map.addLayer(wms);
>
> Thanks for taking a look!
>
> Greg
>
> Greg Ederer wrote:
>   
>> Hi,
>>
>> I have created two layers.  I can add either of these layers to my map, 
>> and it displays correctly.  But, when I add both layers, only the first 
>> one added appears.
>>
>> I'm probably making a simple, newbie mistake.  Any suggestions?
>>
>> Thanks!
>>
>> Greg
>>
>>   
>>     
>
>
>   




More information about the Users mailing list