[ka-Map-users] toggle layers?

Chris Brown chris at basebloc.com
Tue Jul 18 20:00:19 EDT 2006


Hi Matt, 

 

The functionality with the tick boxes in the reference box is standard
ka-map functionality, if your layers are divided into groups within your map
file, each group represented within that map file will be represented as a
separate layer which can be turned on or off or have its Z position changed.
Any layers that are not put into a GROUP will be put in a layer named Base.

Try adding a the group code I gave you to one of the layers in your map file
and then refresh your ka-map app to see what happens!

 

Chris

 

   _____  

From: aiguy82 at gmail.com [mailto:aiguy82 at gmail.com] On Behalf Of Matthew Kane
Sent: 19 July 2006 03:13
To: Base Bloc
Cc: ka-map-users at lists.maptools.org
Subject: Re: [ka-Map-users] toggle layers?

 

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: 
HYPERLINK
"http://geo.maunsell.com/kamapaus/aus.html"http://geo.maunsell.com/kamapaus/
aus.html
In contrast, the following site doesn't have checkboxes by the legend:
HYPERLINK
"http://casoilresource.lawr.ucdavis.edu/kamap/"http://casoilresource.lawr.uc
davis.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 <HYPERLINK
"mailto:chris at basebloc.com"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
HYPERLINK
"mailto:ka-Map-users at lists.maptools.org"ka-Map-users at lists.maptools.org 
HYPERLINK "http://lists.maptools.org/mailman/listinfo/ka-map-users"
\nhttp://lists.maptools.org/mailman/listinfo/ka-map-users



 

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/391 - Release Date: 18/07/2006


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/391 - Release Date: 18/07/2006
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20060719/2282fa7a/attachment-0001.html


More information about the ka-Map-users mailing list