[mapserver-users] Developing Skins for Mapserver Apps
Stephen Woodbridge
woodbri at swoodbridge.com
Mon Jan 21 06:02:28 PST 2002
Antti,
Good point about caching the menu stuff. My sample code does something
similar. I also modified it to display the legendicons. Check out this
link and select "Demo It" and then "demo.map":
http://swoodbridge.com/map/mapserver/snippets/
-Steve
Antti.Roppola at brs.gov.au wrote:
>
> Hi all,
>
> I have been working on something like that. We have a couple of
> Mapserver apps up, and already, trying to keep the content and
> the supporting HTML is sync is a pain.
>
> Currently, I have a PHP app that recurses through a .map file and
> builds an interface based entirely on what it finds there. Here is
> an example:
>
> for($n=0; $n < $map->{numlayers}; $n++) { // Create gadgets while layers exist in $map
> $layer = $map->getlayer($n);
> $layer_name = $layer->{name};
> if($layer_select[$n]==1) {
> $checked="checked";
> $layer = $map->getlayer($n);
> $layer->set("status", 1);
> } else {
> $checked="";
> }
> echo("<input type=checkbox name=layer_select[$n] value=1 $checked>$layer_name<br>\n");
> }
>
> This is a *bit* silly (to build the form on every transaction even if
> the map file hasn't changed), but it would be easy to build in hooks
> to cache all this work so it's only done when the map file changes.
>
> Hopefully I'll put the whole thing up for FTP once it's completed, I am
> currently doing Zoom & Pan, & was able to re-use Daniel's GMap code to
> do the query function. Reusable code is good... :o)
>
> Cheers,
>
> Antti
>
> -----Original Message-----
> From: Stephen Woodbridge [mailto:woodbri at swoodbridge.com]
>
> if we could make navigation interfaces like "skins." It would be really
> cool of you could drop a "skin" into a directory with a map file and it
> would just work! You might need to run a utility to init the "skin", but
>
> To accomplish this, you would need to be able to discover what is in a
> map file (doable today) and maybe via the metadata get info on what
> should be exposed via the skin. And if you wanted to use an external
More information about the MapServer-users
mailing list