mapserver and msCross
Rodrigo Martín LÓPEZ GREGORIO
rodrigomlg at GMAIL.COM
Tue Jun 12 08:10:15 PDT 2007
Hi Mark.
The myMap.setFullExtent() is a javascript function. It is implemented in
mscross.js file and the it get only three parameters because the function
calculate the Ymax acording to the other three parameters and the map
dimension in pixels (i.e. the size in pixels of the map_tag div element), so
the aspect of the image would be the right one. If you look at the code of
the myMap.setFullExtent() javascript function you will see that even when it
takes only three parameters it sets four variables values (_ext_Xmin_orig,
_ext_Xmax_orig, _ext_Ymin_orig, _ext_Ymax_orig) and the function
myMap.setExtent() (wich is used to set the new extent each time you use a
tool, as pan or zoom) makes the same job settings the four variables
(_ext_Xmin, _ext_Xmax, _ext_Ymin and _ext_Ymax) values.
If you look then at the myMap.get_map_url() function you will see that when
the function creates the url, the four values are used:
var ext = 'mapext=' + (_ext_Xmin-i.wPixel2real(_map_w_bord)) + '+'
+ (_ext_Ymin-i.hPixel2real(_map_h_bord)) + '+'
+ (_ext_Xmax+i.wPixel2real(_map_w_bord)) + '+'
+ (_ext_Ymax+i.hPixel2real(_map_h_bord)) ;
So actually when your php mapscript file is called the 'mapext' variable
passed throug GET method have the four extent values (Xmin, Xmax, Ymin and
Ymax).
I hope I was clear enough but sometimes my bad english don't allow me to
make a better explanation. If you have any question, ask me again.
Rodrigo.
On 6/12/07, Mark Brooks <mark_brooks at ncsu.edu> wrote:
>
> Rodrigo,
>
> Thank you! This is very helpful and much easier to work with than
> ka-map, although ka-map has great potential. I do have one question for
> you.
>
> The javascript function call to set the map extent only takes three
> arguments (Xmin, Xmax, Ymin):
> myMap.setFullExtent( 5649512,5711778,6099485);
>
> while the mapscript function expects four arguments (Xmin, Ymin, Xmax,
> Ymax):
> $extent = explode(" ",$_GET['mapext']);
> $map->setExtent($extent[0], $extent[1], $extent[2], $extent[3]);
>
> I don't understand why they aren't the same. I'm having trouble getting
> this part to work. Any ideas?
>
> Mark
>
>
> > Hi Mark. A few month ago (Jan 22) Stefan Schwarzer ask a similar
> question and in that moment I send him my response outside the list. I paste
> here my last mail to him in wich I put a long explanation about all the
> steps I had to do to use PHP Mapscript with mscross. I dont even remember
> what I wrote but I paste it here. If you have any question ask me again.
> Sorry my english. Rodrigo.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070612/62505bed/attachment.htm>
More information about the MapServer-users
mailing list