Map load on page load

Fawcett, David David.Fawcett at STATE.MN.US
Wed Feb 7 14:48:12 PST 2007


Brad, 

If you look at the MapServer demos, you will see that they start with a button that passes the initial values of the variables that you are storing in hidden html variables on your page.  

To get the initial image, you will either need to pass them in the URL that you use to call your initial page or have an initialization page.  Obviously the first method is the cleanest.  

There are ways to hide your URL calls.  

David. 


-----Original Message-----
From: UMN MapServer Users List on behalf of Bradley Mclain
Sent: Wed 2/7/2007 4:19 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] Map load on page load
 
How do I make the map load on page load?, currently my map simply loads to a 
blank image and you must click on the map in order to get it to load the 
image. I do not want to use a button etc, like many examples show, I want 
map map to load on this page after you follow the link to this page.

[html code]
<html>
<head>
<title>De Bortoli Wines MapServer</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="800" height="600" align="center" border="0">
<tr>
<td>
<form name="mapserv" method="GET" action="/cgi-bin/mapserv">
<input type="hidden" name="map" value="/usr/local/mapfiles/dbw.map">
<input type="hidden" name="imgext" value="418485.188 6204834.362 424295.450 
6208828.520">
<input type="hidden" name="imgxy" value="320 240">
<input type="hidden" name="mode" value="browse">
<table width="70%" align="left" border="1">
<tr>
<td align="center" valign="top">
<input type="image" name="img" src="[img]" width="640" height="480" 
border="0">
</td>
</tr
[/html code]

Brad




>From: "Fischer, Brian" <bfischer at houstonengineeringinc.com>
>To: "Bradley Mclain" <bradleym06 at hotmail.com>
>Subject: RE: [UMN_MAPSERVER-USERS] Showing multiple layers using one 
>checkbox
>Date: Tue, 6 Feb 2007 09:06:00 -0600
>
>To get the legend to show up, you just need to change the path.  Try
><img src="../legend.gif" width="159" height="77" border="0">. Otherwise
>you could hard code the entire path to the image.
>
>I believe your map is not showing up because you are not submitting the
>form on initialization.  Most people would have would put a button on
>the form to open the page.  Another option would be to put a javascript
>function in the OnLoad event of the body tag.
>
>
>Brian Fischer
>Houston Engineering, Inc.
>Maple Grove, MN
>(763) 493-4522
>
>-----Original Message-----
>From: Bradley Mclain [mailto:bradleym06 at hotmail.com]
>Sent: Monday, February 05, 2007 5:40 PM
>To: Fischer, Brian; MAPSERVER-USERS at LISTS.UMN.EDU
>Subject: Re: [UMN_MAPSERVER-USERS] Showing multiple layers using one
>checkbox
>
>Thanks I created a static image showing the layers I want, only problem
>is that once the mapserver invokes the map, the image fails to load
>because it has the mapserver-cgi directory infront of the image path,
>how do I avoid this?
>
>Image Declaration:
><td>
><p>Legend:<br>
><img src="legend.gif" width="159" height="77" border="0"> </td>
>
>Broken Path:
>http://192.168.1.130/cgi-bin/legend.gif
>
>Also on the same note as this currently my map does not show up on first
>load you must click on it to get it load. It would be much better to
>have the map load on page load. I will include the html file as well.
>
>Brad
>
>
>
>
> >From: "Fischer, Brian" <bfischer at HOUSTONENGINEERINGINC.COM>
> >Reply-To: "Fischer, Brian" <bfischer at HOUSTONENGINEERINGINC.COM>
> >To: MAPSERVER-USERS at LISTS.UMN.EDU
> >Subject: Re: [UMN_MAPSERVER-USERS] Showing multiple layers using one
> >checkbox
> >Date: Mon, 5 Feb 2007 08:22:46 -0600
> >
> >If you want to always show the legend no matter what layers are turned
> >on or off.  I would just pregenerate the legend once and have it linked
>
> >to a static image.  No reason for mapserver to generate this everytime
> >the map changes on the fly when nothing in the legend is changing.  The
>
> >easist way to do this is use the legend utility that comes with the
> >mapserver download.  Just temporary set all your layers to on and run
> >the utility.  It will generate an image to use.  The easiest way to
> >handle the group layers is to only put the name in one of those layers
> >instead of all.
> >
> >Hope this helps,
> >Brian
> >
> >
> >Brian Fischer
> >Houston Engineering, Inc.
> >Maple Grove, MN
> >(763) 493-4522
> >
> >-----Original Message-----
> >From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]
> >On Behalf Of Bradley Mclain
> >Sent: Sunday, February 04, 2007 10:29 PM
> >To: MAPSERVER-USERS at LISTS.UMN.EDU
> >Subject: Re: [UMN_MAPSERVER-USERS] Showing multiple layers using one
> >checkbox
> >
> >Excellent just what I was looking for thanks.
> >
> >Any chance you know how to fix up my legend now, there are two things
> >wrong with it. Firstly I want it to show the name of the groups not the
>
> >layers and secondly, I want it show them even when they are unticked.
> >currently they dissapear off the key when unticked.
> >
> >Brad
> >
> >
> >
> >
> > >From: "Fischer, Brian" <bfischer at HOUSTONENGINEERINGINC.COM>
> > >Reply-To: "Fischer, Brian" <bfischer at HOUSTONENGINEERINGINC.COM>
> > >To: MAPSERVER-USERS at LISTS.UMN.EDU
> > >Subject: Re: [UMN_MAPSERVER-USERS] Showing multiple layers using one
> > >checkbox
> > >Date: Sun, 4 Feb 2007 21:57:35 -0600
> > >
> > >Brad,
> > >
> > >The easiest way to do this would be to use the GROUP parameter in the
>
> > >mapfile.  This would turn all layers on with the same name in the
> > >GROUP
> >
> > >parameter.
> > >
> > >Another option is to use a javascript function to alter the layers
> > >list
> >
> > >that is passed to the CGI on the OnClick event of the checkbox.
> > >
> > >-Brian
> > >
> > >________________________________
> > >
> > >From: UMN MapServer Users List on behalf of Bradley Mclain
> > >Sent: Sun 2/4/2007 4:12 PM
> > >To: MAPSERVER-USERS at LISTS.UMN.EDU
> > >Subject: [UMN_MAPSERVER-USERS] Showing multiple layers using one
> > >checkbox
> > >
> > >
> > >
> > >Ok I currently have a mapfile which has multiple layers which make up
>
> > >my image. I have set it up so that you can use a checkbox to turn
> > >these
> >
> > >on and off. What I want to do however is combine two of them into the
>
> > >one checkbox.
> > >
> > >E.g. Currently I have two different shapefiles making up a boundary
> > >for
> >
> > >a property. They are defined in seperate layers in the mapfile. I
> > >want them to both display when I tick a "Property Boundary" checkbox.
> > >
> > >Brad
> > >
> > >_________________________________________________________________
> > >Advertisement: Meet Sexy Singles Today @ Lavalife - Click here
> > >http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Flavalife9%2Eninemsn%2
> > >Ec
> > >om%2Eau%2Fclickthru%2Fclickthru%2Eact%3Fid%3Dninemsn%26context%3Dan99
> > >%2
> > >6locale%3Den%5FAU%26a%3D23769&_t=754951090&_r=endtext_lavalife_dec_me
> > >et
> > >&_m=EXT
> >
> >_________________________________________________________________
> >Advertisement: Fresh jobs daily. Stop waiting for the newspaper. Search
>
> >Now!
> >www.seek.com.au
> >http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fninemsn%2Eseek%2Ecom%2E
> >a u&_t=757263760&_r=Hotmail_EndText_Dec06&_m=EXT
>
>_________________________________________________________________
>Advertisement: Meet Sexy Singles Today @ Lavalife - Click here
>http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Flavalife9%2Eninemsn%2Eco
>m%2Eau%2Fclickthru%2Fclickthru%2Eact%3Fid%3Dninemsn%26context%3Dan99%26l
>ocale%3Den%5FAU%26a%3D23769&_t=754951090&_r=endtext_lavalife_dec_meet&_m
>=EXT

_________________________________________________________________
Advertisement: Getting married? Tell us why to WIN @ LetsShop 
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fwww%2Eletsshop%2Ecom%2FCompetitions%2FLetsMarry%2Ftabid%2F549%2FDefault%2Easpx&_t=751480117&_r=HM_tagline_letsshop_wedding&_m=EXT



More information about the MapServer-users mailing list