[mapserver-dev] setConnectionType(MS_WMS) doesn't work

Yewondwossen Assefa yassefa at dmsolutions.ca
Thu Feb 26 13:33:12 EST 2009


Alexandre,

  I have opened a bug on it http://trac.osgeo.org/mapserver/ticket/2908) 
with a patch. Can you please try the patch and see if it fixes your problem?

Thanks

  PS Another note is I think $oLayer->setConnectionType  return 0 on 
success.

Best Regards,

Alexandre Dube wrote:
> 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 ?
>>>>
>>>
>>>
>>
>>
> 
> 


-- 
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------



More information about the mapserver-dev mailing list