[Mapserver-users] how to get extents after using zoomscale()

Damian Schroder map_surfer at yahoo.com
Mon Dec 15 10:09:02 EST 2003


--0-1396200303-1071500942=:94405
Content-Type: text/plain; charset=us-ascii

don't know if this will make a difference, but I always use a dot concatenator. I would write the statement like this:
 
print " the map extent after zoom is [0] :" . $my_RectObj_after_zoom[0]. "<br>";
 
damian



Stephen Clark <stephen.clark at focus.ca> wrote:
hi all,

I am using php mapscript version 4.0 and wish to retrieve the extents of the
window after I set the scale.

Here is an example :

$map->set('width',700);
$map->set('height',700);

$my_PointObj = ms_newPointObj();
$my_PointObj->setXY(350.0,350.0);

$my_RectObj = ms_newRectObj();
$my_RectObj->setextent($extentarray[0], $extentarray[1], $extentarray[2],
$extentarray[3]);

$map->zoomscale($my_scale, $my_PointObj, 700, 700, $my_RectObj);

// get the extent after the zoom operation

$my_RectObj_after_zoom = ms_newRectObj();
$my_RectObj_after_zoom = $map->extent;

// print out the map extent now
print " the map extent after zoom is [0] : $my_RectObj_after_zoom[0]

";
print " the map extent after zoom is [1] : $my_RectObj_after_zoom[1] 
";
print " the map extent after zoom is [2] : $my_RectObj_after_zoom[2] 
";
print " the map extent after zoom is [3] : $my_RectObj_after_zoom[3] 
";


Why do I get nothing printed out?

thanks
Stephen

_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users


---------------------------------
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing
--0-1396200303-1071500942=:94405
Content-Type: text/html; charset=us-ascii

<DIV>
<DIV>don't know if this will make a difference, but I always use a dot concatenator.&nbsp;I would write the statement like this:</DIV>
<DIV>&nbsp;</DIV>
<DIV>print " the map extent after zoom is [0] :" . $my_RectObj_after_zoom[0]. "&lt;br&gt;";</DIV>
<DIV>&nbsp;</DIV>
<DIV>damian</DIV>
<DIV><BR><BR><BR><B><I>Stephen Clark &lt;stephen.clark at focus.ca&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">hi all,<BR><BR>I am using php mapscript version 4.0 and wish to retrieve the extents of the<BR>window after I set the scale.<BR><BR>Here is an example :<BR><BR>$map-&gt;set('width',700);<BR>$map-&gt;set('height',700);<BR><BR>$my_PointObj = ms_newPointObj();<BR>$my_PointObj-&gt;setXY(350.0,350.0);<BR><BR>$my_RectObj = ms_newRectObj();<BR>$my_RectObj-&gt;setextent($extentarray[0], $extentarray[1], $extentarray[2],<BR>$extentarray[3]);<BR><BR>$map-&gt;zoomscale($my_scale, $my_PointObj, 700, 700, $my_RectObj);<BR><BR>// get the extent after the zoom operation<BR><BR>$my_RectObj_after_zoom = ms_newRectObj();<BR>$my_RectObj_after_zoom = $map-&gt;extent;<BR><BR>// print out the map extent now<BR>print " the map extent after zoom is [0] : $my_RectObj_after_zoom[0]<BR><BR>";<BR>print " the map extent after zoom is [1] : $my_RectObj_after_zoom[1] <BR>";<BR>print " the map extent after zoom is
 [2] : $my_RectObj_after_zoom[2] <BR>";<BR>print " the map extent after zoom is [3] : $my_RectObj_after_zoom[3] <BR>";<BR><BR><BR>Why do I get nothing printed out?<BR><BR>thanks<BR>Stephen<BR><BR>_______________________________________________<BR>Mapserver-users mailing list<BR>Mapserver-users at lists.gis.umn.edu<BR>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users</BLOCKQUOTE></DIV><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=21260/*http://photos.yahoo.com">New Yahoo! Photos - easier uploading and sharing</a>
--0-1396200303-1071500942=:94405--



More information about the mapserver-users mailing list