[mapserver-users] RE: Extents

Jay Kapalczynski jkapalczynski at ci.maple-grove.mn.us
Tue Oct 6 11:33:46 PDT 2009


I am using GeoMOOSE if that sheds new light on this...

What I am trying to do is click a button.
This calls a js page that runs some code every few seconds. Right now its simply refreshing a specific layer.
I want the code to grab the extent of the current map
I then use an XY to recreate a new extent.
Then zoom to that extent.

I am getting the XY from a database.  Testing to see if within current extent.
If not I want it to recenter (zoom to new extent I calculated)

Currently I am doing this in php...the only thing is that I cant figure out how to get the app to recenter from PHP.

I can do it from a button (see below) but I need it to work automatically

<h5 style="margin:0px; padding:0px;"><b>Zoom to View String:</b> <a href="javascript:Map.zoomToViewString(453633.29 + ',' + 4984898.68 + ',' + 464278.99 + ',' + 4995544.38)"><img src="shared/images/view.png" border="0" title="Click to Zoom Map to PID"></a>

I have everything I need ( I think ) but need to figure out how to get the js page to retireve the extent, then I can fire to above off in javascript.

That make sense....

Thanks for your thoughts Steve...


-----Original Message-----
From: Steve Lime [mailto:Steve.Lime at dnr.state.mn.us] 
Sent: Tuesday, October 06, 2009 1:25 PM
To: Jay Kapalczynski; 'mapserver-users at lists.osgeo.org'
Subject: [mapserver-users] RE: Extents

Why wouldn't you get the extent at the same time you get the map? You had to have one to retrieve
it in the first place. -Steve

>>> On 10/6/2009 at 1:17 PM, in message
<D7A5EAC385604446AB1DD24BF4F5A918A00826AABA at MG-Mail.ci.maple-grove.mn.us>, Jay
Kapalczynski <jkapalczynski at ci.maple-grove.mn.us> wrote:
> Can I call or make a request from a .js page to get the extent of my map?
> 
> 
> From: Jay Kapalczynski
> Sent: Tuesday, October 06, 2009 8:35 AM
> To: mapserver-users at lists.osgeo.org 
> Subject: Extents
> 
> I have a applications using MapServer.  I have a button that runs some code 
> on a .js page every few seconds.
> What I need to do is somehow get the map extent to the .js page.
> 
> Is it possible to write some javascript code to retrieve the maps extent 
> every few seconds?
> 
> Thanks




More information about the MapServer-users mailing list