[Mapserver-users] Multiple map views in one html page?
Rebecca Colwell
colwell at geog.umn.edu
Thu Jul 22 11:18:16 PDT 2004
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
More information about the MapServer-users
mailing list