[mapserver-users] Fwd: Error in WMS server mswmsloadgetmapparams wms server error. invalid layer s given in the layers parameter
Amalia Carolina Canavire
acarolinagc at gmail.com
Fri Aug 26 08:54:52 PDT 2011
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"
en php
$nombreMapa ="dmWmsDB2";
$jMap = ms_newMapObj("/var/www/gisPrueba1/".$nombreMapa.".map");
//$wms_title=$jMap->web->metadata->get("wms_title");
$wms_srs=strtok(trim($jMap->web->metadata->get("wms_srs")), " ");
$wms_onlineresource=$jMap->web->metadata->get("wms_onlineresource");
$map_extent=$jMap->extent;
$layer = $jMap->getLayerByName('filtro');
$wms_title=$layer->metadata->get("wms_title");
$clasp = $layer->getClass('parcela');
//$clasp->setExpression($filtro);
$image=$jMap->draw();
if($query!=""){
//$layer->set( "DATA","the_geom from (SELECT * FROM alachua WHERE
".$_POST['atributo']."= '".$_POST['condicion']."') as subquery using unique
gid using srid=4326");
$jLayer = ms_newLayerObj($jMap);
$jLayer->set( "name", "atributo");
$jLayer->set( "type", MS_LAYER_POLYGON);
$jLayer->set( "status", MS_ON);
//$jLayer->set( "connectiontype",MS_POSTGIS );
$jLayer->setConnectionType(MS_POSTGIS);
$jLayer->set( "connection","user=xxxx password=xxxx host=localhost port=xxxx
dbname=template_postgis" );
$jLayer->set( "data","the_geom from (SELECT * FROM alachua WHERE
".$_POST['atributo']."= '".$_POST['condicion']."') as subquery using unique
gid using srid=4326");
$jLayer->set("maxscale",'-0.1');
$jLayer->set("minscale",'-0.1');
$jLayer->set("transparency",'100');
$jLayer->set("sizeunits",'pixels');
//Creamos un classObj dentro del LayerObj
$jLayer->set("classitem",$_POST['atributo']);
$jLayer->setProjection("epsg:4326");
$jClass = ms_newClassObj($jLayer);
//Creamos un styleObj dentro del classObj
$jStyle = ms_newStyleObj($jClass);
$jStyle->color->setRGB(00, 99, 0);
$jStyle->outlinecolor->setRGB(0, 0, 0);
$jLayer->metadata->set('wms_title', 'atributo');
$jLayer->metadata->set('wms_abstract', 'generated by gvSIG');
$jLayer->metadata->set('wms_extent', '529495.77 602500.66 588409.96
660674.98');
$jLayer->metadata->set('gml_include_items', 'all');
$jImagen = $jMap->draw();
**********
var NASAwms1 = new OpenLayers.Layer.WMS("atributo",
"
http://localhost/cgi-bin/mapserv?map=%2Fvar%2Fwww%2FgisPrueba1%2FdmWmsDB2.map",
{layers: 'atributo',
format: 'image/png', projection:new
OpenLayers.Projection("EPSG:4623"),transparent: true},{isBaseLayer: false,
visibility:true});
}
--
*************** * :) *sonrei que te queda lindo :):):):): **amy **cgc
**************************
*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110826/875e0a1a/attachment.htm>
More information about the MapServer-users
mailing list