Zoom to custom extent - PHP

Robert W. Burgholzer rburgholzer at MAPTECH-INC.COM
Mon Jan 24 10:50:56 EST 2005


Sorry you are so frustrated. It is really as simple as this:

   $map->setextent($lox,$loy,$hix,$hiy);

where $map is a valid php mapscript object.

This must all be done before you make any calls to draw your map, such as:
$map->draw()

Also, as the previous poster suggests, you can't be reluctant to print out
the input variables to verify that your inputs are correct.

r.b.

At 10:26 AM 1/24/2005 -0500, kgrootendorst at baird.com wrote:

>Basically, I'm trying to follow the GMAP example since they have a similar
>feature - but trying to mimic the GMAP is way too complicated.
>I'm giving up on this task - it's taking too long.
>
>Thanks for your help.
>
>______________________________
>
>
>Kristjan Annus <kristjan at tarkvarastuudio.ee>
>
>01/24/2005 02:03 AM
>To
>Kevin Grootendorst <kgrootendorst at BAIRD.COM>
>cc
>Subject
>Re: Zoom to custom extent - PHP
>
>
>
>
>Have you printed out the values  of $dfMinX, $dfMinY, $dfMaxX, $dfMaxY
>to make shure
>they arriwe correctly?
>And the SetMapExtents function - I assume its your own function what is
>the code of
>this function doing?
>
>Kristjan
>
> >Kristjan,
> >Thanks for your reply.  I forgot to include this additional PHP code in my
> >original
> >posting.  I have the following:
> >
> >if ($HTTP_FORM_VARS["ViewRegion"])
> >    {
> >        if (ereg("(-?[0-9]+),(-?[0-9]+),(-?[0-9]+),(-?[0-9]+)",
> >                 $HTTP_FORM_VARS["ViewRegion"], $ProvExtents))
> >        {
> >            $dfMinX = doubleval($ProvExtents[1]);
> >            $dfMinY = doubleval($ProvExtents[2]);
> >            $dfMaxX = doubleval($ProvExtents[3]);
> >            $dfMaxY = doubleval($ProvExtents[4]);
> >
> >            SetMapExtents($dfMinX, $dfMinY, $dfMaxX, $dfMaxY);
> >        }
> >    }
> >
> >But no luck yet.  My page just reloads with the max extents of the map.
> >
> >Kevin
> >
> >
>
>

Robert Burgholzer
Environmental Engineer
MapTech Inc.
phone: 804-869-3066
http://www.maptech-inc.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050124/bad185e0/attachment.html


More information about the mapserver-users mailing list