<HTML><BODY>Hello list<br><br>I stuck on the scaledenom definition in my PHPMapScript v. 6.4.1.<br>The current scaledenom required to embed in SQL-statement, but <br>$map->scaledenom returns -1. Tons of googling got nothing. Please help!<br><br> phpscript.php --------------------------------------------------------------------------------------------- <br> <br> $map = ms_newMapobj("/srv/www/htdocs/tez/design/mapfile.map"); <br> $request = ms_newOwsrequestObj();<br> if(!empty($_GET)){<br> foreach ($_GET as $key => $value) {<br> $request->setparameter($key, $value);<br> }<br> }<br> <br> $map->preparequery();<br> $map->scaledenom;//returns -1 <br> <br> $rayonLayer = $map->getLayerByName("rayon"); <br> $rayonLayer->set("data","geom from (select id, name, geom from location<br> where ST_Intersects(geom, !BOX!)) as subquery using unique id using srid=3857");<br> <br> ms_ioinstallstdouttobuffer();<br> $map->owsDispatch($request); <br> <br> $contenttype = ms_iostripstdoutbuffercontenttype();<br> header('Content-type:'.$contenttype);<br> ms_iogetStdoutBufferBytes();<br> ms_ioresethandlers(); <br><br><br>mapfile.map--------------------------------------------------------------------------------------------- <br><br>MAP<br> NAME "Map"<br> OUTPUTFORMAT<br> NAME 'AGG'<br> DRIVER AGG/PNG<br> IMAGEMODE RGB<br> END #OUTPUTFORMAT<br> STATUS ON<br> FONTSET "fonts/fonts.list" <br> CONFIG "PROJ_LIB" "/usr/lib/proj/"<br> WEB <br> METADATA<br> wms_title "Map"<br> wms_abstract "Map"<br> wms_onlineresource "http://localhost/phpscript.php"<br> wms_srs "EPSG:3857" <br> wms_enable_request "*"<br> wms_encoding "utf-8"<br> END # end METADATA <br> END # end WEB <br> PROJECTION<br> "init=epsg:3857"<br> END # end PROJECTION <br> LAYER<br> NAME "rayon" <br> STATUS ON<br> CONNECTIONTYPE postgis<br> CONNECTION "user=ms_viewer password=1 dbname=ms_db host=localhost" <br> TYPE POLYGON<br> LABELITEM "name"<br> CLASS <br> NAME "rayons" <br> STYLE<br> OUTLINECOLOR 255 0 0<br> OUTLINEWIDTH 5<br> END # end STYLE<br> END # end CLASS<br> PROJECTION<br> "init=epsg:3857"<br> END # end PROJECTION<br> METADATA<br> wms_title "rayon"<br> wms_abstract "rayon" <br> wms_srs "EPSG:3857"<br> wms_include_items "all"<br> END # end METADATA<br> END # end LAYER <br>END # end MAP<br>---------------------------------------------------------------------------------------------<br><br>Best regards<br><br></BODY></HTML>