[Mapserver-users] Frames
Lowther, David W
dlowther at ou.edu
Tue Sep 9 05:37:11 PDT 2003
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C376CF.17496660
Content-Type: text/plain
Steve,
We use frames for our mapserver apps (www.geo.ou.edu <http://www.geo.ou.edu>
click interactive mapper). There needs to be a form (say MAPSERV form) in a
frame that is not the map frame that targets the map frame. When the map
frame loads, it needs to push relevant values to the MAPSERV form:
parent.framename.MAPSERV.imgext.value = "[mapext]";
parent.framename.MAPSERV.centerx.value = "[center_x]";
parent.framename.MAPSERV.centery.value = "[center_y]";
You may need to push something else, but these are the basics. We chose to
put our MAPSERV form in the frame that held the legend / active layer /
layer visible controls because that was the majority of the form. In other
words, it was easier to write imgext, centerx, and centery to the MAPSERV
form then to write each layer's status.
Here's a general outline of our setup:
toolFrame:
zoom in, zoom out, zoom full, pan, identify, etc...
each tool fires javascript that sets some status in the MAPSERV form (mode,
zoomsize, etc...) in preparation for that tool's map click or drag.
legendFrame:
holds MAPSERV form containing everything from layerstatus to mapsize.
this form is submitted anytime anything happens involving mapserver, but it
NEVER is targeted to itself so it can maintain state.
mapFrame:
targeted from MAPSERV form for map status changes (extent, layers, mapsize,
etc..)
onload pushes values from the map to legendFrame, toolFrame , whatever
necessary.
idFrame:
targeted from MAPSERV form for itemquery / identify results or any results
that are not a map and are small enough not to need their own window.
I'd love to be able to tell you that it was easy to get all these frames
talking with each other, but if you persevere I think it (the interface that
results) is worth it.
And my 2 cents on javascript is: if you can write more than one line per
hour per supported browser, you are doing well...
Good luck!
David Lowther
Software Engineer
GEO Information Systems
University of Oklahoma
dlowther at ou.edu
(405) 325-3131
http://www.geo.ou.edu <http://www.geo.ou.edu/>
-----Original Message-----
From: Steve McCrone [mailto:ms57 at streamyx.com]
Sent: Monday, September 08, 2003 8:57 PM
To: mapserver-users at lists.gis.umn.edu
Subject: [Mapserver-users] Frames
Hi All,
I've tried (with no luck) to implement a simple mapserver app. using frames,
but since I am a novice in Javascript, I need your help.
I have a launching app called demo_init.html that contains -
<form method=GET name = "mapserv" action="/cgi-bin/mapserv.exe">
<input type="hidden" name="map" value="C:\Inetpub\wwwroot\demo.map">
<input type="hidden" name="layer" value="roads">
<input type="hidden" name="zoomsize" value=2>
<input type="hidden" name="program" value="/cgi-bin/mapserv.exe">
<input type="hidden" name="map_web_imagepath"
value="C:\inetpub\wwwroot\tmp\">
<input type="hidden" name="map_web_imageurl" value="/tmp/">
<center><input type="submit" value="Initialize"></center>
And I have the file Demo.html -
<form method=GET action="[program]">
<INPUT NAME="img" TYPE="image" SRC="[img]" width=600 height=600 border=0>
and a few other mapserver lines like -
<option value="roads" [roads_select]> Roads
<INPUT NAME="ref" TYPE="image" SRC="[ref]" border="0">
etc.
In my map file, I have -
TEMPLATE Demo.html
=====================================
Now, I created a Main.html that has two frames (Left and Right)
<FRAMESET cols="230,*">
<FRAME src="http://localhost/LeftFrame.html
<http://localhost/LeftFrame.html> " name="Left" >
<FRAME src="http://localhost/Demo.html <http://localhost/Demo.html> "
name="Demo">
</FRAMESET>
And changed the map file to -
TEMPLATE Main.html
==================================
But this does not work. any help would be welcomed!
Thanks
------_=_NextPart_001_01C376CF.17496660
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.2800.1226" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=531132612-09092003>Steve,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=531132612-09092003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=531132612-09092003>We use
frames for our mapserver apps (<A
href="http://www.geo.ou.edu">www.geo.ou.edu</A> click interactive mapper). There
needs to be a form (say MAPSERV form) in a frame that is not the map frame
that targets the map frame. When the map frame loads, it needs to push relevant
values to the MAPSERV form:</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=531132612-09092003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=531132612-09092003> parent.framename.MAPSERV.imgext.value =
"[mapext]";<BR> parent.framename.MAPSERV.centerx.value =
"[center_x]";<BR> parent.framename.MAPSERV.centery.value =
"[center_y]";<BR></SPAN></FONT></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff size=2>You
may need to push something else, but these are the basics. We chose to put our
MAPSERV form in the frame that held the legend / active layer / layer visible
controls because that was the majority of the form. In other words, it was
easier to write imgext, centerx, and centery to the MAPSERV form then to write
each layer's status.</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff size=2>Here's
a general outline of our setup:</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2>toolFrame:</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff size=2>zoom
in, zoom out, zoom full, pan, identify, etc...</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff size=2>each
tool fires javascript that sets some status in the MAPSERV form (mode, zoomsize,
etc...) in preparation for that tool's map click or
drag.</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2>legendFrame:</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff size=2>holds
MAPSERV form containing everything from layerstatus to
mapsize.</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff size=2>this
form is submitted anytime anything happens involving mapserver, but it NEVER is
targeted to itself so it can maintain state.</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2>mapFrame:</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2>targeted from MAPSERV form for map status changes (extent, layers,
mapsize, etc..)</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff size=2>onload
pushes values from the map to legendFrame, toolFrame , whatever
necessary.</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2>idFrame:</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2>targeted from MAPSERV form for itemquery / identify results or any
results that are not a map and are small enough not to need their own
window.</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff size=2>I'd
love to be able to tell you that it was easy to get all these frames talking
with each other, but if you persevere I think it (the interface that results) is
worth it.</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff size=2>And my
2 cents on javascript is: if you can write more than one line per hour per
supported browser, you are doing well...</FONT></SPAN></DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=531132612-09092003><FONT face=Arial color=#0000ff size=2>Good
luck!</FONT></SPAN></DIV>
<P><FONT face=Arial size=2>David Lowther</FONT> <BR><FONT face=Arial
size=2>Software Engineer</FONT> <BR><FONT face=Arial size=2>GEO Information
Systems</FONT> <BR><FONT face=Arial size=2>University of Oklahoma</FONT>
<BR><FONT face=Arial size=2>dlowther at ou.edu</FONT> <BR><FONT face=Arial
size=2>(405) 325-3131</FONT> <BR><FONT face=Arial size=2><A
href="http://www.geo.ou.edu/" target=_blank>http://www.geo.ou.edu</A></FONT>
</P><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT
face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> Steve McCrone
[mailto:ms57 at streamyx.com] <BR><B>Sent:</B> Monday, September 08, 2003 8:57
PM<BR><B>To:</B> mapserver-users at lists.gis.umn.edu<BR><B>Subject:</B>
[Mapserver-users] Frames<BR><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Hi All,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I've tried (with no luck) to implement a simple
mapserver app. using frames, but since I am a novice in Javascript, I need
your help.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have a launching app called demo_init.html that
contains - </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><form method=GET name = "mapserv"
action="/cgi-bin/mapserv.exe"></FONT></DIV>
<DIV><FONT face=Arial size=2><input type="hidden" name="map"
value="C:\Inetpub\wwwroot\demo.map"><BR><input type="hidden"
name="layer" value="roads"></FONT></DIV>
<DIV><FONT face=Arial size=2><input type="hidden" name="zoomsize"
value=2><BR><input type="hidden" name="program"
value="/cgi-bin/mapserv.exe"><BR><input type="hidden"
name="map_web_imagepath" value="C:\inetpub\wwwroot\tmp\"><BR><input
type="hidden" name="map_web_imageurl" value="/tmp/"></DIV>
<DIV><center><input type="submit"
value="Initialize"></center></DIV>
<DIV> </DIV>
<DIV>And I have the file Demo.html - </DIV>
<DIV> </DIV>
<DIV><form method=GET action="[program]"><BR><INPUT NAME="img"
TYPE="image" SRC="[img]" width=600 height=600 border=0></DIV>
<DIV> </DIV>
<DIV>and a few other mapserver lines like - </DIV>
<DIV> </DIV>
<DIV><option value="roads" [roads_select]> Roads<BR><INPUT NAME="ref"
TYPE="image" SRC="[ref]" border="0"></DIV>
<DIV> </DIV>
<DIV>etc.</DIV>
<DIV> </DIV>
<DIV>In my map file, I have - </DIV>
<DIV> </DIV>
<DIV>TEMPLATE Demo.html<BR>=====================================</DIV>
<DIV>Now, I created a Main.html that has two frames (Left and Right)</DIV>
<DIV> </DIV>
<DIV><FRAMESET cols="230,*"> <BR> <FRAME src="<A
href="http://localhost/LeftFrame.html">http://localhost/LeftFrame.html</A>"
name="Left" > <BR> <FRAME src="<A
href="http://localhost/Demo.html">http://localhost/Demo.html</A>"
name="Demo"> <BR></FRAMESET> </DIV>
<DIV> </DIV>
<DIV>And changed the map file to - </DIV>
<DIV>TEMPLATE Main.html</DIV>
<DIV>==================================</DIV>
<DIV> </DIV>
<DIV>But this does not work. any help would be welcomed!</DIV>
<DIV> </DIV>
<DIV>Thanks<BR><BR></DIV>
<DIV><BR> </DIV></FONT></FONT></DIV></BLOCKQUOTE></BODY></HTML>
------_=_NextPart_001_01C376CF.17496660--
More information about the MapServer-users
mailing list