<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> </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. If not then
recenter.<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText><b>PART 1<o:p></o:p></b></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText><b>BUITTON: Calls the .js page sets an interval and
refreshes the layer “Database”<o:p></o:p></b></p>
<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'><service
name="refreshLayers3" title="Refresh Layer every 2 Seconds"
type="internal" default="true" locked="true"
command="setIntervalNow()"
icon="shared/images/toolbar/MapleGrove_Buttons/Reload.jpg"
highlight="shared/images/toolbar/MapleGrove_Buttons/Pictometry.jpg"/><o:p></o:p></span></p>
<p class=MsoPlainText><o:p> </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> </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> </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'> varTest
= setInterval("setIntervalNow2()", 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> </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'> 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> </o:p></p>
<p class=MsoPlainText><o:p> </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> </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> </o:p></p>
<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'><tr><o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'><td align="center"
width='100'>Tracking Testing:</td><o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'> <td
style= "cursor:pointer" align="center"
onclick="javascript:getnewresults('XY_MapRecenter.php','[imgext]','[miny]','[maxx]','[maxy]')"><font
size='2' color='#007FFF' >Open Images</font></td>
<o:p></o:p></span></p>
<p class=MsoPlainText><span style='font-size:8.0pt;color:#632423'></tr><o:p></o:p></span></p>
<p class=MsoPlainText><o:p> </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’t know how I can do this...<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>Thanks<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText><o:p> </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> </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> </o:p></p>
<p class=MsoPlainText>Steve<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
<p class=MsoPlainText>>>> On 10/6/2009 at 1:33 PM, in message<o:p></o:p></p>
<p class=MsoPlainText><D7A5EAC385604446AB1DD24BF4F5A918A00826AABB@MG-Mail.ci.maple-grove.mn.us>,
Jay<o:p></o:p></p>
<p class=MsoPlainText>Kapalczynski <jkapalczynski@ci.maple-grove.mn.us>
wrote:<o:p></o:p></p>
<p class=MsoPlainText>> I am using GeoMOOSE if that sheds new light on
this...<o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>> What I am trying to do is click a button.<o:p></o:p></p>
<p class=MsoPlainText>> This calls a js page that runs some code every few
seconds. Right now its <o:p></o:p></p>
<p class=MsoPlainText>> simply refreshing a specific layer.<o:p></o:p></p>
<p class=MsoPlainText>> I want the code to grab the extent of the current
map<o:p></o:p></p>
<p class=MsoPlainText>> I then use an XY to recreate a new extent.<o:p></o:p></p>
<p class=MsoPlainText>> Then zoom to that extent.<o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>> I am getting the XY from a database. Testing
to see if within current <o:p></o:p></p>
<p class=MsoPlainText>> extent.<o:p></o:p></p>
<p class=MsoPlainText>> If not I want it to recenter (zoom to new extent I
calculated)<o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>> Currently I am doing this in php...the only thing is
that I cant figure out <o:p></o:p></p>
<p class=MsoPlainText>> how to get the app to recenter from PHP.<o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>> I can do it from a button (see below) but I need it
to work automatically<o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>> <h5 style="margin:0px;
padding:0px;"><b>Zoom to View String:</b> <a <o:p></o:p></p>
<p class=MsoPlainText>> href="javascript:Map.zoomToViewString(453633.29
+ ',' + 4984898.68 + ',' + <o:p></o:p></p>
<p class=MsoPlainText>> 464278.99 + ',' + 4995544.38)"><img
src="shared/images/view.png" border="0" <o:p></o:p></p>
<p class=MsoPlainText>> title="Click to Zoom Map to
PID"></a><o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>> I have everything I need ( I think ) but need to
figure out how to get the <o:p></o:p></p>
<p class=MsoPlainText>> js page to retireve the extent, then I can fire to
above off in javascript.<o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>> That make sense....<o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>> Thanks for your thoughts Steve...<o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>> -----Original Message-----<o:p></o:p></p>
<p class=MsoPlainText>> From: Steve Lime [mailto:Steve.Lime@dnr.state.mn.us]
<o:p></o:p></p>
<p class=MsoPlainText>> Sent: Tuesday, October 06, 2009 1:25 PM<o:p></o:p></p>
<p class=MsoPlainText>> To: Jay Kapalczynski;
'mapserver-users@lists.osgeo.org'<o:p></o:p></p>
<p class=MsoPlainText>> Subject: [mapserver-users] RE: Extents<o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>> 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>> have one to retrieve<o:p></o:p></p>
<p class=MsoPlainText>> it in the first place. -Steve<o:p></o:p></p>
<p class=MsoPlainText>> <o:p></o:p></p>
<p class=MsoPlainText>>>>> On 10/6/2009 at 1:17 PM, in message<o:p></o:p></p>
<p class=MsoPlainText>>
<D7A5EAC385604446AB1DD24BF4F5A918A00826AABA@MG-Mail.ci.maple-grove.mn.us>,
Jay<o:p></o:p></p>
<p class=MsoPlainText>> Kapalczynski
<jkapalczynski@ci.maple-grove.mn.us> wrote:<o:p></o:p></p>
<p class=MsoPlainText>>> 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>>> <o:p></o:p></p>
<p class=MsoPlainText>>> <o:p></o:p></p>
<p class=MsoPlainText>>> From: Jay Kapalczynski<o:p></o:p></p>
<p class=MsoPlainText>>> Sent: Tuesday, October 06, 2009 8:35 AM<o:p></o:p></p>
<p class=MsoPlainText>>> To: mapserver-users@lists.osgeo.org <o:p></o:p></p>
<p class=MsoPlainText>>> Subject: Extents<o:p></o:p></p>
<p class=MsoPlainText>>> <o:p></o:p></p>
<p class=MsoPlainText>>> I have a applications using MapServer. I
have a button that runs some code <o:p></o:p></p>
<p class=MsoPlainText>>> on a .js page every few seconds.<o:p></o:p></p>
<p class=MsoPlainText>>> What I need to do is somehow get the map extent
to the .js page.<o:p></o:p></p>
<p class=MsoPlainText>>> <o:p></o:p></p>
<p class=MsoPlainText>>> Is it possible to write some javascript code to
retrieve the maps extent <o:p></o:p></p>
<p class=MsoPlainText>>> every few seconds?<o:p></o:p></p>
<p class=MsoPlainText>>> <o:p></o:p></p>
<p class=MsoPlainText>>> Thanks<o:p></o:p></p>
<p class=MsoPlainText><o:p> </o:p></p>
</div>
</body>
</html>