<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoPlainText>I am plotting an XY coordinate in my map using an OVF
file to hit the MySQL database.<o:p></o:p></p>

<p class=MsoPlainText>I then have a button that calls a .js page and refreshes
the layer...<o:p></o:p></p>

<p class=MsoPlainText>As the XY changes in the database it appears to be
tracking in the map<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>I want to take this one step further and test the
recently plotted XY to see if it s in the current extent.&nbsp; If not then
recenter.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><b>PART 1<o:p></o:p></b></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><b>BUITTON:&nbsp; Calls the .js page sets an interval and
refreshes the layer &#8220;Database&#8221;<o:p></o:p></b></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>&lt;service
name=&quot;refreshLayers3&quot; title=&quot;Refresh Layer every 2 Seconds&quot;
type=&quot;internal&quot; default=&quot;true&quot; locked=&quot;true&quot;
command=&quot;setIntervalNow()&quot;
icon=&quot;shared/images/toolbar/MapleGrove_Buttons/Reload.jpg&quot;
highlight=&quot;shared/images/toolbar/MapleGrove_Buttons/Pictometry.jpg&quot;/&gt;<o:p></o:p></span></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><b>.js PAGE:<o:p></o:p></b></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>//setIntervalNow();<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'><o:p>&nbsp;</o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>var varTest =
-1;<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'><o:p>&nbsp;</o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>function
setIntervalNow()<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>{<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>&nbsp;varTest
= setInterval(&quot;setIntervalNow2()&quot;, 3000);<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>}<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'><o:p>&nbsp;</o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>function
setIntervalNow2() <o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>{<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>&nbsp;Events.triggerEvent('refreshlayer',
'Database');<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>}<o:p></o:p></span></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><b>PART 2<o:p></o:p></b></p>

<p class=MsoPlainText>What I want to do is grab the current XY and test to see
if its in the current extent<o:p></o:p></p>

<p class=MsoPlainText>If not then create another extent and zoom to it.<o:p></o:p></p>

<p class=MsoPlainText>Right now I am having a hard time trying to join the two
parts.<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>For this part I am launching the code from the Identify button
which calls an Ajax page and passes the Extent to a PHP page<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>&lt;tr&gt;<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>&lt;td align=&quot;center&quot;
width='100'&gt;Tracking Testing:&lt;/td&gt;<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>&nbsp;&lt;td
style= &quot;cursor:pointer&quot; align=&quot;center&quot;
onclick=&quot;javascript:getnewresults('XY_MapRecenter.php','[imgext]','[miny]','[maxx]','[maxy]')&quot;&gt;&lt;font
size='2' color='#007FFF' &gt;Open Images&lt;/font&gt;&lt;/td&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
<o:p></o:p></span></p>

<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'>&lt;/tr&gt;<o:p></o:p></span></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>I can get test and make the new Extent but can only return
the values to a tab and then fire it off from a button....what I want to do is
have this done automatically...<o:p></o:p></p>

<p class=MsoPlainText>I don&#8217;t know how I can do this...<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Thanks<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>-----Original Message-----<br>
From: Steve Lime [mailto:Steve.Lime@dnr.state.mn.us] <br>
Sent: Friday, October 09, 2009 2:23 PM<br>
To: Jay Kapalczynski; 'mapserver-users@lists.osgeo.org'<br>
Subject: RE: [mapserver-users] RE: Extents<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Still confused on what you're trying to do. It sounds
like your PHP code is hitting the database to<o:p></o:p></p>

<p class=MsoPlainText>get the xy's. You could poll that PHP page as necessary
via AJAX and have it return the xy data<o:p></o:p></p>

<p class=MsoPlainText>as JSON. Then you use the JSON data accordingly to
control GeoMoose by zooming to a point or<o:p></o:p></p>

<p class=MsoPlainText>whatever. I don't know if GeoMoose provides AJAX wrappers
or not, that's a question for that <o:p></o:p></p>

<p class=MsoPlainText>another mailing list...<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Steve<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>&gt;&gt;&gt; On 10/6/2009 at 1:33 PM, in message<o:p></o:p></p>

<p class=MsoPlainText>&lt;D7A5EAC385604446AB1DD24BF4F5A918A00826AABB@MG-Mail.ci.maple-grove.mn.us&gt;,
Jay<o:p></o:p></p>

<p class=MsoPlainText>Kapalczynski &lt;jkapalczynski@ci.maple-grove.mn.us&gt;
wrote:<o:p></o:p></p>

<p class=MsoPlainText>&gt; I am using GeoMOOSE if that sheds new light on
this...<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; What I am trying to do is click a button.<o:p></o:p></p>

<p class=MsoPlainText>&gt; This calls a js page that runs some code every few
seconds. Right now its <o:p></o:p></p>

<p class=MsoPlainText>&gt; simply refreshing a specific layer.<o:p></o:p></p>

<p class=MsoPlainText>&gt; I want the code to grab the extent of the current
map<o:p></o:p></p>

<p class=MsoPlainText>&gt; I then use an XY to recreate a new extent.<o:p></o:p></p>

<p class=MsoPlainText>&gt; Then zoom to that extent.<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; I am getting the XY from a database.&nbsp; Testing
to see if within current <o:p></o:p></p>

<p class=MsoPlainText>&gt; extent.<o:p></o:p></p>

<p class=MsoPlainText>&gt; If not I want it to recenter (zoom to new extent I
calculated)<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; Currently I am doing this in php...the only thing is
that I cant figure out <o:p></o:p></p>

<p class=MsoPlainText>&gt; how to get the app to recenter from PHP.<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; I can do it from a button (see below) but I need it
to work automatically<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; &lt;h5 style=&quot;margin:0px;
padding:0px;&quot;&gt;&lt;b&gt;Zoom to View String:&lt;/b&gt; &lt;a <o:p></o:p></p>

<p class=MsoPlainText>&gt; href=&quot;javascript:Map.zoomToViewString(453633.29
+ ',' + 4984898.68 + ',' + <o:p></o:p></p>

<p class=MsoPlainText>&gt; 464278.99 + ',' + 4995544.38)&quot;&gt;&lt;img
src=&quot;shared/images/view.png&quot; border=&quot;0&quot; <o:p></o:p></p>

<p class=MsoPlainText>&gt; title=&quot;Click to Zoom Map to
PID&quot;&gt;&lt;/a&gt;<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; I have everything I need ( I think ) but need to
figure out how to get the <o:p></o:p></p>

<p class=MsoPlainText>&gt; js page to retireve the extent, then I can fire to
above off in javascript.<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; That make sense....<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; Thanks for your thoughts Steve...<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; -----Original Message-----<o:p></o:p></p>

<p class=MsoPlainText>&gt; From: Steve Lime [mailto:Steve.Lime@dnr.state.mn.us]
<o:p></o:p></p>

<p class=MsoPlainText>&gt; Sent: Tuesday, October 06, 2009 1:25 PM<o:p></o:p></p>

<p class=MsoPlainText>&gt; To: Jay Kapalczynski;
'mapserver-users@lists.osgeo.org'<o:p></o:p></p>

<p class=MsoPlainText>&gt; Subject: [mapserver-users] RE: Extents<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt; Why wouldn't you get the extent at the same time you
get the map? You had to <o:p></o:p></p>

<p class=MsoPlainText>&gt; have one to retrieve<o:p></o:p></p>

<p class=MsoPlainText>&gt; it in the first place. -Steve<o:p></o:p></p>

<p class=MsoPlainText>&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt;&gt;&gt; On 10/6/2009 at 1:17 PM, in message<o:p></o:p></p>

<p class=MsoPlainText>&gt;
&lt;D7A5EAC385604446AB1DD24BF4F5A918A00826AABA@MG-Mail.ci.maple-grove.mn.us&gt;,
Jay<o:p></o:p></p>

<p class=MsoPlainText>&gt; Kapalczynski
&lt;jkapalczynski@ci.maple-grove.mn.us&gt; wrote:<o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; Can I call or make a request from a .js page to
get the extent of my map?<o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; From: Jay Kapalczynski<o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; Sent: Tuesday, October 06, 2009 8:35 AM<o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; To: mapserver-users@lists.osgeo.org <o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; Subject: Extents<o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; I have a applications using MapServer.&nbsp; I
have a button that runs some code <o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; on a .js page every few seconds.<o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; What I need to do is somehow get the map extent
to the .js page.<o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; Is it possible to write some javascript code to
retrieve the maps extent <o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; every few seconds?<o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; <o:p></o:p></p>

<p class=MsoPlainText>&gt;&gt; Thanks<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>