[Mapserver-users] Multiple map views in one html page?

Delfos, Jacob jacob.delfos at maunsell.com
Thu Jul 22 20:07:41 EDT 2004


If you have two frames, you can use the "onSubmit" trigger of the form to
activate a javascript function. This javascript function could change the
bounding coordinates in the other frame, and dynamically submit the other
frame. I think it should be quite simple like that.

E.g. 
<FORM NAME="form1" OnSubmit="javascript:updateAndSubmitForm2()">

Jacob

-----Original Message-----
From: mapserver-users-admin at lists.gis.umn.edu
[mailto:mapserver-users-admin at lists.gis.umn.edu] On Behalf Of Rebecca
Colwell
Sent: Friday, 23 July 2004 2:18 AM
To: Steve Lime
Cc: mapserver-users at lists.gis.umn.edu
Subject: Re: [Mapserver-users] Multiple map views in one html page?


Hi Steve,

I've been trying to get your approach to work over the last few days. 
The way I'm understanding the template you provided, I am displaying two 
map images at the start of the application that the user can't change. 
Does that sound right?  I would like to have two forms that operate 
independent of each other.  Right now in my template html I have two 
forms set up.  If a layer is checked in either form and then the refresh 
button is pushed, the two maps match each other.  I'm guessing this is 
because the two forms are referencing the same [map] values.  Is there a 
way to differentiate the two forms from referring to the same layer 
change?  Can I do something like:

<form>
...lot's of stuff omitted...
<input type="hidden" name="map" value="[map]">
...lot's of stuff omitted...
</form>

<form>
...lot's of stuff omitted...
<input type="hidden" name="map2" value="[map2]">
...lot's of stuff omitted...
</form>

I tried this, but with no luck.  I don't know if it is possible and I 
just didn't change enough html code, or if I needed to change something 
in the mapfile, or if it won't work at all like this.

One thing I like and would prefer to hang on to is that if I zoom in on 
either map, the other one matches the same extent.

If you or anyone else could get back to me on this, I would appreciate it.

Thanks!

~Becky


Steve Lime wrote:

> Sure it's possible. Simplest way is just to have multiple forms on one
> page, you can also have multiple input image tags. The key (using the
> CGI anyway) is not to build the maps as you pan and zoom. This is an
> example where you'd set the main map STATUS to off. Rather you call
> MapServer with mode=map to build the map views you might need
> independantly. A template might look like:
> 
> <html>
>    ...lot's of stuff omitted...
>    <form name="view" action="/cgi-bin/mapserv">
>      <input type="hidden" name="map" value="[map]">
>      <input type="hidden" name="imgext" value="[mapext]">
>      <input type="image" name="img"
>
src="/cgi-bin/mapserv?map=[map]&mapext=[mapext_esc]&layer=layer1&mode=map">
>      <p>   
>      <input type="image" name="img"
>
src="/cgi-bin/mapserv?map=[map]&mapext=[mapext_esc]&layer=layer2&mode=map">
>    </form>
>    ...lot's of stuff omitted...
> </html>
> 
> It assumes that both images are the same size, but the content is
> totally diffent. Of course you can get very fancy using MapScript or
> Javascript. I used to have a demo application with 4 viewports, worked
> just fine.
> 
> Steve
> 
> 
>>>>Rebecca Colwell <colwell at geog.umn.edu> 7/19/2004 3:13:44 PM >>>
> 
> Hi all,
> 
> I was wondering if there is a way to have two or more map views in an 
> html document?  I would like the views to be independently "query-able"
> 
> so that different thematic maps could be compared to one another.
> 
> Thanks,
> 
> ~Becky
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu 
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list