[mapserver-users] mapserver(ms4w) map script mode

Jeff McKenna jmckenna at gatewaygeomatics.com
Wed May 18 15:35:22 PDT 2016


Hi Ankur,

To be honest I don't fully understand your question.  Are you referring 
to the "DEFRESOLUTION" parameter in the MAP object of the mapfile?

If you are referring to how to set a user defined scale for a layer (the 
"MAXSCALEDENOM" parameter), I always use MapServer in CGI mode to get 
this value.  I've added a (old) CGI viewer to download for MS4W users 
(http://www.ms4w.com/release/apps/cgi-viewer-ms4w.zip) - extract that to 
your MS4W root and restart Apache.  For new MS4W users installing 
through the setup installer, the mapfile and all paths will be 
automatically updated.  This simple CGI viewer will display MapServer's 
scale value as you zoom in; here is what it looks like: 
http://pasteboard.co/11y5aJzt.png  It's not fancy but I actually still 
use it everyday!

Here is how to set that in PHP mapscript:

   $oMap = ms_newMapObj( "path/to/mapfile.map");
   $oLayer = $oMap->getLayerByName("mylayer");
   $oLayer->set("maxscaledenom", 1000000);
   $oMap->save("path/to/mapfile.map");

-jeff

-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/


On 2016-05-18 8:10 AM, ankur chitranshi wrote:
> hello all,
>
>  can any body help me out in how touser-define map scale manually in
> mapserver(ms4w) map script mode
>
> --
> thanks & regards
> Ankur Chitranshi
>
>



More information about the mapserver-users mailing list