[mapserver-users] how generate web part of mapfile with python mapscript

Frank Broniewski brfr at metrico.lu
Thu Dec 1 05:51:07 PST 2011


Am 01.12.2011 13:43, schrieb Tonton:
> hello
> i try this
>
>      awebdef = mapscript.webObj()
>      awebdef.maxscaledenom = 1550000
>      awebdef.minscaledenom = 1000
>      awebdef.imagepath="/var/www/path/"
>      awebdef.imageurl="../tmp/"
>      awebdef.metadata = mapscript.hashTableObj()
>      awebdef.metadata.set("ows_TITLE", atitle)
>
>      mapServerUrl = u.sitepath_prm
>      mapfilepath = u.mapfilepath_prm
>
>      awebdef.metadata.set("ows_ONLINERESOURCE",
> mapServerUrl+"map="+mapfilepath+layer.name_lyr+".map")
>
>      awebdef.metadata.set("owsAbstract" , layer.libel_lyr)
>      awebdef.metadata.set("owsSrs", "EPSG:"+str(projection))
>      awebdef.log = "../tmp/web.log"
>      amapfile.web = awebdef
>
> but the result still this in my mapfile
>
>    WEB
>    END # WEB
>
>   someone knows why may be
>
> T.
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users

Hi

a new web object has already a metadata attribute "prebuild", so you 
don't need to create a new one. Just set the properties on the metadata: 
web.metadata.set('foo', 'bar'), or even shorter:
map_obj.web.metadata.set('foo', 'bar')

hth

Frank

-- 
Frank BRONIEWSKI

METRICO s.à r.l.
géomètres
technologies d'information géographique
rue des Romains 36
L-5433 NIEDERDONVEN

tél.: +352 26 74 94 - 28
fax.: +352 26 74 94 99
http://www.metrico.lu



More information about the MapServer-users mailing list