<div class="gmail_quote">Hi,i dont good speak english. i have a map file with one layer default, i have added dynamically, one layer ,  that i get   of consult a data base, into this map file, but i have got one error "wms mswmsloadgetmapparams wms server  invalid layer s given in the layers parameter"<br>

<br>en php<br>$nombreMapa ="dmWmsDB2";<br>$jMap = ms_newMapObj("/var/www/gisPrueba1/".$nombreMapa.".map");<br>//$wms_title=$jMap->web->metadata->get("wms_title");<br>$wms_srs=strtok(trim($jMap->web->metadata->get("wms_srs")), " ");<br>

$wms_onlineresource=$jMap->web->metadata->get("wms_onlineresource");<br>$map_extent=$jMap->extent;<br><br><br>$layer  = $jMap->getLayerByName('filtro'); <br>$wms_title=$layer->metadata->get("wms_title");<br>

$clasp = $layer->getClass('parcela'); <br>//$clasp->setExpression($filtro);           <br>$image=$jMap->draw();<br><br>if($query!=""){<br>//$layer->set( "DATA","the_geom from (SELECT * FROM alachua  WHERE ".$_POST['atributo']."= '".$_POST['condicion']."') as subquery using unique gid using srid=4326");<br>

$jLayer = ms_newLayerObj($jMap);<br>$jLayer->set( "name", "atributo");<br>$jLayer->set( "type", MS_LAYER_POLYGON);<br>$jLayer->set( "status", MS_ON);<br>//$jLayer->set( "connectiontype",MS_POSTGIS );<br>

$jLayer->setConnectionType(MS_POSTGIS);<br>$jLayer->set( "connection","user=xxxx password=xxxx host=localhost port=xxxx dbname=template_postgis" );<br>$jLayer->set( "data","the_geom from (SELECT * FROM alachua  WHERE ".$_POST['atributo']."= '".$_POST['condicion']."') as subquery using unique gid using srid=4326");<br>

$jLayer->set("maxscale",'-0.1');<br>$jLayer->set("minscale",'-0.1');<br>$jLayer->set("transparency",'100');<br>$jLayer->set("sizeunits",'pixels');<br>

//Creamos un classObj dentro del LayerObj<br>$jLayer->set("classitem",$_POST['atributo']);<br>$jLayer->setProjection("epsg:4326");<br>$jClass = ms_newClassObj($jLayer);<br>//Creamos un styleObj dentro del classObj<br>

$jStyle = ms_newStyleObj($jClass);<br>$jStyle->color->setRGB(00, 99, 0);<br>$jStyle->outlinecolor->setRGB(0, 0, 0);<br>$jLayer->metadata->set('wms_title', 'atributo');<br>$jLayer->metadata->set('wms_abstract', 'generated by gvSIG');<br>

$jLayer->metadata->set('wms_extent', '529495.77 602500.66 588409.96 660674.98');<br>$jLayer->metadata->set('gml_include_items', 'all');<br><br>$jImagen = $jMap->draw();<br><br>

<br>**********<br> var NASAwms1 = new OpenLayers.Layer.WMS("atributo",<br>                                "<a href="http://localhost/cgi-bin/mapserv?map=%2Fvar%2Fwww%2FgisPrueba1%2FdmWmsDB2.map" target="_blank">http://localhost/cgi-bin/mapserv?map=%2Fvar%2Fwww%2FgisPrueba1%2FdmWmsDB2.map</a>", {layers: 'atributo',<br>

                                format: 'image/png', projection:new OpenLayers.Projection("EPSG:4623"),transparent: true},{isBaseLayer: false, visibility:true});<br>                                }<br>
<br clear="all">
<br><br>
</div><br><br clear="all"><br>-- <br><p style="text-align: center;"><font color="#cc33cc"><font style="color: rgb(102, 51, 102);" color="#ff6600"><i><font face="comic sans ms,sans-serif">************** </font></i>  :)</font><span style="color: rgb(153, 153, 255);"> </span></font><span style="color: rgb(51, 153, 153);"></span><i><font color="#3366ff"><span style="color: rgb(153, 153, 255);"><span style="color: rgb(51, 153, 153);">sonrei que te queda lindo</span> </span><span style="color: rgb(102, 0, 0);">:):):):):<span style="color: rgb(102, 51, 102);"> </span></span></font></i><font style="color: rgb(102, 51, 102);" color="#ff6600"><font face="comic sans ms,sans-serif"><i>amy </i></font></font><i><font color="#3366ff"><span style="color: rgb(102, 0, 0);"><span style="color: rgb(102, 51, 102);">cgc</span>  **************************<br>
</span></font></i></p><br>