[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] displaying a specific extent of the map
From:       "David William Bitner" <bitner () gyttja ! org>
Date:       2006-05-26 13:23:31
Message-ID: d2f53e190605260623k9682c3csf16753853054dd2e () mail ! gmail ! com
[Download RAW message or body]

I think that Mark was trying to point out that this is _not_ a javascript
list, but rather a list dedicated to the PostGIS extension to the PostgreSQL
database.  The two code snips that you show have nothing at all to do with
PostGIS.

On 5/26/06, simflex <simflex@millenniumhealthproducts.com> wrote:
>
>
> hi Mark,
>
> I don't believe that sql server is the problem.
>
> Rather these 2 code snips:
>
>
> <script>
> function zoomToExt ent(box) {
>    box_array = box.split(" ");
>    minx = box_array[0]*1;
>    miny = box_array[1]*1;
>    maxx = box_array[2]*1;
>    maxy = box_array[3]*1;
>    width = (maxx - minx) + 200;
>    height = maxy - miny;
>    centerx = minx + (width / 2.0);
>    centery = miny + (height / 2.0);
>   lonlatPt = map.mcsToLonLat(centerx, centery);
>   lon = lonlatPt.getX();
>    lat = lonlatPt.getY();
>    map.zoomWidth(lat, lon, width, 'FT');
> }
> </script>
>
>
> ***********************************************************************************
>
>                 <td>
>                   <a href="#" onClick="zoomToExtent('<%=tan%>');return
> false;">
>                   <font size="-1"><%=incidentlocation%></font>
>                   </a>
>                  </td>
>
>
> First of all, I am getting an error on the following lines:
>
>
>   lonlatPt = map.mcsToLonLat(centerx, centery);
>   lon = lonlatPt.getX();
>    lat = lonlatPt.getY();
>    map.zoomWidth(lat, lon, width, 'FT');
>
> If  I remove them, then the following don't do anything at all:
>
>
>
>                 <td>
>                   <a href="#" onClick="zoomToExtent('<%=tan%>');return
> false;">
>                   <font size="-1"><%=incidentlocation%></font>
>                   </a>
>                  </td>
>
>
> Not sure what I am doing wrong here.
>
>
>
>
>
>
> -----Original message-----
> From: "Mark Cave-Ayland" m.cave-ayland@webbased.co.uk
> Date: Thu, 25 May 2006 10:49:21 -0400
> To: "'PostGIS Users Discussion'" postgis-users@postgis.refractions.net
> Subject: RE: [postgis -users] displaying a specific extent of the map
>
> > PostGIS is a spatial extension for PostgreSQL (http://www.postgresql.org
> > ) rather than MS-SQL Server. I'd suggest you
> > need to ask on either an MS-SQL or an ASP/Javascript coding site for
> help,
> > but without more information it's impossible to determine exactly what
> the
> > problem you're experiencing is.
> >
> >
> >
> >
> >
> > Kind regards,
> >
> >
> >
> > Mark.
> >
> > ------------------------
> > WebBased Ltd
> > 17 Research Way
> > Plymouth
> > PL6 8BT
> >
> > T: +44 (0)1752 797131
> > F: +44 (0)1752 791023
> >
> > http://www.webbased.co.uk
> > http://www.infomapper.com
> > http://www.swtc.co.uk
> >
> > This email and any attachments are confidential to the intended
> recipient
> > and may also be privileged. If you are not the intended recipient
> please< BR>> delete it from your system and notify the sender. You should
> not copy it or
>
> > use it for any purpose nor disclose or distribute its contents to any
> other
> > person.
> >
> > _____
> >
> > From: postgis-users-bounces@postgis.refractions.net
> > [mailto:postgis-users-bounces@postgis.refractions.net] On Behalf Of
> simflex
> > Sent: 25 May 2006 14:16
> > To: postgis-users@postgis.refractions.net
> > Subject: [postgis-users] displaying a specific extent of the map
> >
> >
> >
> > Greetings all,
> >
> > First time user of this forum.
> >
> > We use a sql server db to store data including x, y values. and using
> ASP on
> > the front end to retrieve data
> >
> > Currently, we are do have a summary report laid out thus:
> >
> > incident id first name last name incident type, incident location
> >
> > 1 John Doe vehicular amber
> > street
> > ...
> > ...
> >
> *> Our issue arises because we want to be able to click on incident id to
> zoom*
> *
> > directly to the extent of the map where the incident occurred.
> >
> > so far, we are struggling with this. any ideas would greatly
> appreciated.
> >
> > Here is what we have got so far:
> >
> >
> >
> *
> *> <%
> >
> > Set cn=Server.CreateObject("ADODB.Connection")
> > nID = Request("RecordID")
> > 'response.write nID
> > 'response. end
> >
> > cn.Open "Driver={SQL Server};" & _
> > "Server=haoi;" & _
> > "Address=haoi,1433;" & _
> > "Network=DBMSSOCN;" & _
> > "Database=incidentsDB;" & _
> > "Uid=sa;" & _
> > "Pwd="
> >
> > SQL = "select incident_LOC, id,minlat,minlon,maxlat,maxlon from
> Incidents
> > where id =" & nID
> > Set rs = cn.Execute( SQL )
> > 'response.write SQL
> > 'response.end
> > %>
> > *
>
>
> >
> >
> > <%
> > cnt = 0
> > Do Until cur.EOF
> > cnt = cnt + 1
> > incidentlocation = cur(0).Value
> > recnum = CLng(cur(1).Value)
> > ileft = CLng(cur(2).value) - 250
> > ibottom = CLng(cur(3).Value) - 250
> > iright = CLng(cur(4).Value) + 250
> > itop = CLng(cur(5).Value) + 250
> >
> > ; tan = ileft & " " & ibottom & " " & iright & " " & itop
> >
> > %>
>
> >
> > <%=incidentlocation%>
> > <#10b70bee894b4b1b_>
> >
> >
> > <%
> > cur.MoveNext
> > Loop
> > %>
> >
> > <%
> > if cnt = 0 Then
> > %>
> > *No results*
>
> > <%
> > End If
> > rs.Close()
> > cn.Close()
> > %>
> >
> >
>
> _______________________________________________
> postgis-users mailing list
> postgis-users@postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
>


-- 
************************************
David William Bitner
bitner@gyttja.org

[Attachment #3 (text/html)]

I think that Mark was trying to point out that this is _not_ a javascript list, but \
rather a list dedicated to the PostGIS extension to the PostgreSQL database.&nbsp; \
The two code snips that you show have nothing at all to do with PostGIS. \
<br><br><div><span class="gmail_quote">On 5/26/06, <b \
class="gmail_sendername">simflex</b> &lt;<a \
href="mailto:simflex@millenniumhealthproducts.com">simflex@millenniumhealthproducts.com</a>&gt; \
wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, \
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div><p><br>hi \
Mark,<br><br>I don't believe that sql server is the problem.<br><br>Rather these 2 \
code snips:</p></div><div><span class="q"><br><br>&lt;script&gt;<br>function \
zoomToExt ent(box) {<br>&nbsp;&nbsp; box_array = box.split (&quot; \
&quot;);<br>&nbsp;&nbsp; minx = box_array[0]*1;<br>&nbsp;&nbsp; miny = \
box_array[1]*1;<br>&nbsp;&nbsp; maxx = box_array[2]*1;<br>&nbsp;&nbsp; maxy = \
box_array[3]*1;<br>&nbsp;&nbsp; width = (maxx - minx) + 200;<br>&nbsp;&nbsp; height = \
maxy - miny;<br>&nbsp;&nbsp; centerx = minx + (width /  2.0);<br>&nbsp;&nbsp; centery \
= miny + (height / 2.0);<br>&nbsp; lonlatPt = map.mcsToLonLat(centerx, \
centery);<br>&nbsp; lon = lonlatPt.getX();<br>&nbsp;&nbsp; lat = \
lonlatPt.getY();<br>&nbsp;&nbsp; map.zoomWidth(lat, lon, width, \
'FT');<br>}<br>&lt;/script&gt;</span> </div><div><p></p> \
<p>***********************************************************************************</p> \
<p></p></div><div><span \
class="q">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &lt;td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;a href=&quot;#&quot; onClick=&quot;zoomToExtent('&lt;%=tan%&gt;');return \
false;&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;font size=&quot;-1&quot;&gt;&lt;%=incidentlocation%&gt;&lt;/font&gt;<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/a&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/td&gt;<br><br><br></span></div><div>First of all, I am getting an error on the \
following lines:</div><div><span class="q"><br><br>&nbsp; lonlatPt = \
map.mcsToLonLat(centerx, centery); <br>&nbsp; lon = lonlatPt.getX();<br>&nbsp;&nbsp; \
lat = lonlatPt.getY();<br>&nbsp;&nbsp; map.zoomWidth(lat, lon, width, \
'FT');<br><br></span></div><div>If&nbsp; I remove them, then the following don't do \
anything at all:</div><div><span \
class="q"><br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;td&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;a href=&quot;#&quot; onClick=&quot;zoomToExtent('&lt;%=tan%&gt;');return \
false;&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;font size=&quot;-1&quot;&gt;&lt;%=incidentlocation%&gt;&lt;/font&gt; \
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/a&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&lt;/td&gt;<br><br><br></span></div><div>Not sure what I am doing wrong \
here.</div><div><span class="q"><br><br><br><br><br><br>-----Original \
message-----<br>From: &quot;Mark Cave-Ayland&quot;  <a \
href="mailto:m.cave-ayland@webbased.co.uk" target="_blank" onclick="return \
top.js.OpenExtLink(window,event,this)">m.cave-ayland@webbased.co.uk</a><br>Date: Thu, \
25 May 2006 10:49:21 -0400<br>To: &quot;'PostGIS Users Discussion'&quot;  <a \
href="mailto:postgis-users@postgis.refractions.net" target="_blank" onclick="return \
top.js.OpenExtLink(window,event,this)">postgis-users@postgis.refractions.net</a><br>Subject: \
                RE: [postgis
 -users]
displaying a specific extent of the map<br><br>&gt; PostGIS is a spatial extension \
for PostgreSQL (<a href="http://www.postgresql.org" target="_blank" onclick="return \
top.js.OpenExtLink(window,event,this)">http://www.postgresql.org </a><br>&gt; ) \
rather than MS-SQL Server. I'd suggest you<br>&gt; need to ask on either an MS-SQL or \
an ASP/Javascript coding site for help,<br>&gt; but without more information it's \
impossible to determine exactly what the <br>&gt; problem you're experiencing \
is.<br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; <br>&gt; Kind regards,<br>&gt; \
<br>&gt; <br>&gt; <br>&gt; Mark.<br>&gt; <br>&gt; ------------------------<br>&gt; \
WebBased Ltd<br>&gt; 17 Research Way <br>&gt; Plymouth<br>&gt; PL6 8BT<br>&gt; \
<br>&gt; T: +44 (0)1752 797131<br>&gt; F: +44 (0)1752 791023<br>&gt; <br>&gt; <a \
href="http://www.webbased.co.uk" target="_blank" onclick="return \
top.js.OpenExtLink(window,event,this)"> http://www.webbased.co.uk</a> <br>&gt; <a \
href="http://www.infomapper.com" target="_blank" onclick="return \
top.js.OpenExtLink(window,event,this)">http://www.infomapper.com</a><br>&gt; <a \
href="http://www.swtc.co.uk" target="_blank" onclick="return \
top.js.OpenExtLink(window,event,this)"> http://www.swtc.co.uk</a> <br>&gt; <br>&gt; \
This email and any attachments are confidential to the intended \
recipient<br></span></div><div>&gt; and may also be privileged. If you are not the \
intended recipient please&lt;  BR&gt;&gt;
delete it from your system and notify the sender. You should not copy it \
or</div><div><span class="q"><br>&gt; use it for any purpose nor disclose or \
distribute its contents to any other<br>&gt; person.<br>&gt; <br>&gt; _____  <br>&gt; \
<br>&gt; From: <a href="mailto:postgis-users-bounces@postgis.refractions.net" \
target="_blank" onclick="return \
top.js.OpenExtLink(window,event,this)">postgis-users-bounces@postgis.refractions.net</a><br>&gt; \
[mailto: <a href="mailto:postgis-users-bounces@postgis.refractions.net" \
target="_blank" onclick="return \
top.js.OpenExtLink(window,event,this)">postgis-users-bounces@postgis.refractions.net</a>] \
On Behalf Of simflex<br>&gt; Sent: 25 May 2006 14:16 <br>&gt; To: <a \
href="mailto:postgis-users@postgis.refractions.net" target="_blank" onclick="return \
top.js.OpenExtLink(window,event,this)">postgis-users@postgis.refractions.net</a><br>&gt; \
Subject: [postgis-users] displaying a specific extent of the map <br>&gt; <br>&gt; \
<br>&gt; <br>&gt; Greetings all,<br>&gt; <br>&gt; First time user of this \
forum.<br>&gt; <br>&gt; We use a sql server db to store data including x, y values. \
and using ASP on<br>&gt; the front end to retrieve data <br>&gt; <br>&gt; Currently, \
we are do have a summary report laid out thus:<br>&gt; <br>&gt; incident id first \
name last name incident type, incident location<br>&gt; <br>&gt; 1 John Doe vehicular \
amber<br>&gt; street<br> &gt; ...<br>&gt; ...<br>&gt; </span></div><div><b>&gt;
Our issue arises because we want to be able to click on incident id to \
zoom</b></div><div><span class="q"><b><br>&gt; directly to the extent of the map \
where the incident occurred.<br>&gt; <br>&gt; so far, we are struggling with this. \
any ideas would greatly appreciated. <br>&gt; <br>&gt; Here is what we have got so \
far:<br>&gt; <br>&gt; <br>&gt;   <br></b></span></div><div><span class="q"><b>&gt; \
&lt;%<br>&gt; <br>&gt; Set \
cn=Server.CreateObject(&quot;ADODB.Connection&quot;)<br>&gt; nID = \
Request(&quot;RecordID&quot;) <br>&gt; 'response.write nID<br>&gt; 'response.
 end<br>&gt;
<br>&gt; cn.Open &quot;Driver={SQL Server};&quot; &amp; _<br>&gt;            \
&quot;Server=haoi;&quot; &amp; _<br>&gt;            &quot;Address=haoi,1433;&quot; \
&amp; _<br>&gt;            &quot;Network=DBMSSOCN;&quot; &amp; _ <br>&gt;            \
&quot;Database=incidentsDB;&quot; &amp; _<br>&gt;            &quot;Uid=sa;&quot; \
&amp; _<br>&gt;            &quot;Pwd=&quot;<br>&gt; <br>&gt; SQL = &quot;select \
incident_LOC, id,minlat,minlon,maxlat,maxlon from Incidents <br>&gt; where id =&quot; \
&amp; nID<br>&gt; Set rs = cn.Execute( SQL )<br>&gt; 'response.write SQL<br>&gt; \
'response.end<br>&gt; %&gt;<br>&gt; </b></span></div><div><p></p> <div \
align="center"><br>&gt;  <br>&gt;  <table><tbody> <tr><td><div><span \
class="q"><br>&gt; &lt;%<br>&gt; cnt = 0<br>&gt; Do Until cur.EOF<br>&gt;     cnt = \
cnt + 1<br>&gt;     incidentlocation = cur(0).Value<br>&gt;  recnum = \
CLng(cur(1).Value)<br>&gt;     ileft = CLng(cur(2).value) - 250 <br>&gt;     ibottom \
= CLng(cur(3).Value) - 250<br>&gt;     iright = CLng(cur(4).Value) + 250<br>&gt;     \
itop = CLng(cur(5).Value) + 250<br>&gt; <br>&gt;     ; tan = ileft &amp; &quot; \
&quot; &amp; ibottom &amp; &quot; &quot; &amp; iright &amp; &quot; &quot; &amp; itop \
<br>&gt; <br>&gt; %&gt; </span></div><div></div></td></tr></tbody><tbody> \
<tr><td><br>&gt; <a href="#10b70bee894b4b1b_"><br>&gt; <font \
size="-1">&lt;%=incidentlocation%&gt;</font><br>&gt; </a><br>&gt; </td><td><br>&gt; \
</td> </tr><tr><td><br>&gt; &lt;%<br>&gt;        cur.MoveNext<br>&gt;    Loop<br>&gt; \
%&gt;<br>&gt; </td></tr></tbody></table><br>&gt; &lt;%<br>&gt; if cnt = 0 \
Then<br>&gt; %&gt;<br>&gt;  <center><b>No results</b></center></div> <div><span \
class="q"><br>&gt; &lt;%<br>&gt; End If<br>&gt; rs.Close()<br>&gt; cn.Close()<br>&gt; \
%&gt;<br>&gt; <br>&gt; <br></span></div><div></div> \
</div><br>_______________________________________________<br>postgis-users mailing \
list<br><a onclick="return top.js.OpenExtLink(window,event,this)" \
href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net
 </a><br><a onclick="return top.js.OpenExtLink(window,event,this)" \
href="http://postgis.refractions.net/mailman/listinfo/postgis-users" \
target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br><br>
 <br></blockquote></div><br><br clear="all"><br>-- \
<br>************************************<br>David William Bitner<br><a \
href="mailto:bitner@gyttja.org">bitner@gyttja.org</a>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic