[OpenLayers-Users] plz help

ben afia olfa benafia_olfa at yahoo.fr
Mon Mar 26 04:14:54 EDT 2007


Hi 
i have a map to get it from a geoserver 
function init(){
            map = new OpenLayers.Map( $('map') );
           
            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 
             "http://localhost:8080/geoserver/wms", {layers: 'topp:mymap'} );
            map.addLayer(layer);
           
            map.addControl( new OpenLayers.Control.LayerSwitcher() );
            map.zoomToExtent(new OpenLayers.Bounds(871444,244922,871576,245050));
        }
        

when i tried this there is no map in the web page

but when i  tried this  
function init(){

            map = new OpenLayers.Map( $('map') );

           

            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS", 

             "http://localhost:8080/geoserver/wms?bbox=871444,244922,871576,245050",{layers'topp:mymap'});

            map.addLayer(layer);

            map.addControl( new OpenLayers.Control.LayerSwitcher() );

            map.zoomToMaxExtent();  

        }

this works but there is more than one map in the page and when i zoom  it out there number decrease

and when i zoom it in there number increase

can any body helps me please ? 


Olfa




	
	
		
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20070326/9a651fdd/attachment.html


More information about the Users mailing list