PHP/Mapscript: zoomscale problem

Bart van den Eijnden bartvde at GMAIL.COM
Mon Oct 8 07:17:17 EDT 2007


Hi list,

depending on the map extent, the zoomscale function will deliver exactly
that value or a value only approaching it.

This will mean that if a user wants to zoom to 1:50000 with the application,
one time he might have a layer visible which has a MAXSCALE of 50000, but
after a pan his layer could disappear again ... which is very confusing.

For instance, when I use 50000 for the scale, and run zoomscale, I get:

MAP
  EXTENT 119638.399789862 500590.444498095 130124.889552138 506876.738093905
  RESOLUTION 90.710000
  SIZE 750 450

My test script returns the following value for the scale:

50000

If I pan one time with my application, I get:

MAP
  EXTENT 117457.209919085 501372.738812169 127943.699681677 507659.032408169
  RESOLUTION 90.710000
  SIZE 750 450

My test script returns the following value for the scale:

50000.0000015

which will mean the layer will be invisible/out of scale after the pan.

The test script is very simple:
$oMap = ms_newMapObj('/data/geoservices/tmp/sess_4709facfb1052/1191837483-
2180.map');
$oMap->draw();
echo $oMap->scale;

Is there any solution for this? Using 5.0.

Best regards,
Bart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20071008/05058c83/attachment.html


More information about the mapserver-dev mailing list