[mapserver-dev] setConnectionType(MS_WMS) doesn't work
Alexandre Dube
adube at mapgears.com
Thu Feb 26 12:38:16 EST 2009
Hi Assefa,
I already set the type to raster before the call. See my code snippet
(1).
I attached the mapfile (mamap.map) my mapObject outputs. As you can
see, both LAYER they don't have a CONNECTIONTYPE set. If I add it
there, I get my images.
Thanks a lot for your help,
Alexandre
(1) php mapscript snippet
=======================
$oLayer = ms_newLayerObj($oMap);
$oLayer->set("name", $szLayer);
$oLayer->set("type", MS_LAYER_RASTER);
$oLayer->set("status", MS_ON);
$oLayer->set("connection", $szURL);
//$oLayer->set("connectiontype", MS_WMS);
$nStatus = $oLayer->setConnectionType(MS_WMS);
//$oLayer->setConnectionType(8);
if ($nStatus){
echo "ok";
} else {
echo "error"; // <=== it always echoes "error"
}
$oLayer->set("debug", 5);
$oLayer->setMetaData("wms_name", $szLayer);
$oLayer->setMetaData("wms_server_version", "1.1.1");
$oLayer->setMetaData("wms_srs", $szSRS);
$oLayer->setMetaData("wms_format", $szFormat);
=========================
Yewondwossen Assefa wrote:
> Alexandre,
>
> What type of layer is that? If your layer type is raster, I think the
> function would work from what I can see. Maybe try to set
> $oLayer->set("type", MS_LAYER_RASTER); before the call?
>
> Best Regards,
>
> Alexandre Dube wrote:
>> Hi devs,
>>
>> Any hint about this issue ?
>>
>> Alexandre
>>
>> Alexandre Dube wrote:
>>> Hi devs,
>>>
>>> I just installed mapserver 5.4.0-beta1. In mapscript, I'm now not
>>> unable to use oLayer->set("connectiontype", MS_WMS). I get an error
>>> saying "use setConnectionType()" instead.
>>>
>>> That's what I did, but it doesn't work with MS_WMS. My collegue
>>> Julien looked deeper in the code and found out in maplayer.c, in the
>>> msInitializeVirtualTable, when we use MS_WMS it returns MS_FAILURE.
>>>
>>> So I guess it's no longer possible to set connectiontype to wms in
>>> mapscript. Is there a new way of doing this ?
>>>
>>> Also, why would a normal mapfile still accept the wms
>>> CONNECTIONTYPE ? I tried to save my map object as a mapfile and
>>> only added CONNECTIONTYPE wms and it worked.
>>>
>>> Any hint ?
>>>
>>
>>
>
>
--
Alexandre Dubé
Mapgears
www.mapgears.com
-------------- next part --------------
MAP
EXTENT -401631.010407503 178178.238306622 -388736.989592497 186309.761693378
IMAGECOLOR 255 255 255
IMAGETYPE aggpng24
SIZE 732 462
STATUS ON
UNITS METERS
CONFIG MS_ERRORFILE "/tmp/ms_tmp/wms2pdf.log"
NAME "MS"
OUTPUTFORMAT
NAME "aggpng24"
MIMETYPE "image/png; mode=24bit"
DRIVER "AGG/PNG"
EXTENSION "png"
IMAGEMODE "RGB"
TRANSPARENT FALSE
FORMATOPTION "INTERLACE=OFF"
END
PROJECTION
"init=epsg:32198"
END
LEGEND
IMAGECOLOR 255 255 255
KEYSIZE 20 10
KEYSPACING 5 5
LABEL
SIZE MEDIUM
TYPE BITMAP
BUFFER 0
COLOR 0 0 0
FORCE FALSE
MINDISTANCE -1
MINFEATURESIZE -1
OFFSET 0 0
PARTIALS TRUE
END
POSITION LL
STATUS OFF
END
QUERYMAP
COLOR 255 255 0
SIZE -1 -1
STATUS OFF
STYLE HILITE
END
SCALEBAR
ALIGN CENTER
COLOR 0 0 0
IMAGECOLOR 255 255 255
INTERVALS 4
LABEL
SIZE MEDIUM
TYPE BITMAP
BUFFER 0
COLOR 0 0 0
FORCE FALSE
MINDISTANCE -1
MINFEATURESIZE -1
OFFSET 0 0
PARTIALS TRUE
POSITION CR
END
OUTLINECOLOR 0 0 0
POSITION LL
SIZE 200 3
STATUS OFF
STYLE 0
UNITS METERS
END
WEB
IMAGEPATH "/tmp/ms_tmp"
IMAGEURL ""
QUERYFORMAT text/html
LEGENDFORMAT text/html
BROWSEFORMAT text/html
END
LAYER
CONNECTION "http://127.0.0.1:8080/cgi-bin/mapserv?map=/home/adube/proj/bdga-mapfish/msp/wms/bdga.map"
DEBUG 5
METADATA
"wms_srs" "EPSG:32198"
"wms_name" "BDGA_HABIT_S_POLY,BDGA_HYDRO_S_POLY,BDGA_HYDRO_L_ARC"
"wms_format" "agg"
"wms_server_version" "1.1.1"
END
NAME "BDGA_HABIT_S_POLY,BDGA_HYDRO_S_POLY,BDGA_HYDRO_L_ARC"
STATUS ON
TYPE RASTER
UNITS METERS
VALIDATION
"wms_srs" "EPSG:32198"
"wms_name" "BDGA_HABIT_S_POLY,BDGA_HYDRO_S_POLY,BDGA_HYDRO_L_ARC"
"wms_format" "agg"
"wms_server_version" "1.1.1"
END
END
LAYER
CONNECTION "http://127.0.0.1:8080/cgi-bin/mapserv?map=/home/adube/proj/bdga-mapfish/msp/wms/bdga.map"
DEBUG 5
METADATA
"wms_srs" "EPSG:32198"
"wms_name" "BDGA_MUNIC_S_POLY_1M,BDGA_MRC_S_POLY_1M,BDGA_REGIO_S_POLY_1M"
"wms_format" "aggtrans"
"wms_server_version" "1.1.1"
END
NAME "BDGA_MUNIC_S_POLY_1M,BDGA_MRC_S_POLY_1M,BDGA_REGIO_S_POLY_1M"
STATUS ON
TYPE RASTER
UNITS METERS
VALIDATION
"wms_srs" "EPSG:32198"
"wms_name" "BDGA_MUNIC_S_POLY_1M,BDGA_MRC_S_POLY_1M,BDGA_REGIO_S_POLY_1M"
"wms_format" "aggtrans"
"wms_server_version" "1.1.1"
END
END
END
More information about the mapserver-dev
mailing list