Q&A - Question
Making Layers Active or Inactive Programatically
Question
Crag Cox asked on December 28, 2023, keyword: Developer Kernel
I am creating an application that will use Tatuk to present graphical depictions of buildings strored as separate layers (building outlines, interior rooms, basements, etc.). A database list of addresses will be presented to the user in a grid. Each database record will hold the attributes about the building. The graphical depictions can be thought as a stick figures of a street view.
My goal is to have the graphical information particular to an address presented in the GIS Viewer as the user chooses different addresses. For example, 100 Maple Street is a single story house with a slab on grade, 200 Maple Street is a two story house with a basement.
How do I turn on and off the particular layers I need to construct the stick figure buildings? It will be triggered by an OnChange event from the database grid.
Thanks
Answers
Danv replied December 28, 2023
Hi, looking at the title of your question, this can be done as follows:
1) get a handle on the layer e.g.
l_layer := GIS.Get(l_layername);
2) set it active or not using:
l_layer.Active := [false, true]
That will then automatically set the toggle in the legend as well.
Hope this is what you were looking for.
Greetings Danny
SmallToGo
If you would like to answer the question please Sign In.
Rules
The Questions and Answers (Q & A) is intended to provide a means of communication between TatukGIS customers.
- Licensed users (with active maintenance play) of TatukGIS products may contribute to the Q & A content. Read-only access is available to anyone.
- Keep the content positive and professional.
- Be courteous to others by posting information when a question or issue asked on the Q & A is answered or resolved by other means (such as with help from TatukGIS technical support). Offer others at least a hint how the posted question was answered or the issue was resolved.
- The Q & A is not a replacement for TatukGIS technical support. TatukGIS team may or may not regularly follow or contribute content.