[ka-Map-users] toggle layers?

Matthew Kane markane at indiana.edu
Tue Jul 18 16:13:19 EDT 2006


Thanks so much for your help, Chris.

I'm not familiar with defining groups in mapfiles, but I think my question
is more oriented towards javascript or dhtml. To be clearer about toggling
layers, look at this page, where there are checkboxes down by the legend,
where you can turn a layer on and off:
http://geo.maunsell.com/kamapaus/aus.html
In contrast, the following site doesn't have checkboxes by the legend:
http://casoilresource.lawr.ucdavis.edu/kamap/

My ka-map demo that I downloaded and configured is just like the second site
I mention above. However, I'd like to be able to have those checkboxes in
the legend so I can turn layers on and off. Is this a straightforward thing
to do? Any help would be greatly appreciated.

Thanks a lot,
Matt

On 7/17/06, Base Bloc <chris at basebloc.com> wrote:
>
>  Hi Matt,
>
>
>
> The current query system is just an example of the variables available to
> you with which to perform a query, if you want something other than the
> alert box you will need to change the function myQuery() in startUp.js to
> suit your needs, you could trigger a popup window and use for example the
> extent to find points within the selected area by querying a MySQL or
> PostGIS database. Or if you don't want pop-ups use getXMLHTTP() and other
> functions in xhr.js (AJA'X') to fetch the results and display them in the
> innerHTML of a DIV tag, you could then open and close the DIV tags
> containing the data in the same way as has been done with the reference
> panel, to see how this works look at the togglereference() function in
> startup.js.
>
>
>
> As for the toggling of layers, I'm not sure what you mean? At present you
> can turn on and off groups (Is this in the Wiki? I can't see it), to achieve
> this you place layers in a map file into groups in your map file like so:
>
>
>
> LAYER
>
>   NAME "DEM"
>
>   GROUP   "Base Map"
>
>   DATA "dem_colour8bit.tif"
>
>   TYPE RASTER
>
>   STATUS ON
>
>
>
> END
>
>
>
> You could do this for every layer, but if it is done more than a couple of
> times it can really effect performance on slower connections as when you add
> a new group is doubles the number of tiles to be downloaded.
>
>
>
> Hope this helps a little.
>
>
>
> Chris
>
>
>
> _______________________________________________
> ka-Map-users mailing list
> ka-Map-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20060718/35a9b317/attachment.html


More information about the ka-Map-users mailing list