Q&A - Question

How to get selected layers from TGIS_ControlLegend

Question
BerF asked on August 14, 2020, keyword: Developer Kernel
I'm having issues where selecting shapes is quite slow. 2-3 seconds to select a shape using the documented method to do the selection.

I was wondering if I could speed up the process by using the TGIS_LayerTAB.Locate method with the lowest z-order and the layer is visible in the TGIS_ViewerWnd

I can't figure out how to determine what layers are currently visible in the viewer.
Answers
Tomasz Kosinski (TatukGIS) replied August 13, 2020
  1. Use GIS.Items to see all layers,
  2. or use GIS.Get( "name" ) to get specific layer,
  3. or use Legend.GIS_Layer to get active layer for legend control.

If you have a lot of layers than using GIS.Locate can be slower because it search all layers. Probaly the best code for you is:

layer := TGIS_LayerVecort( GIS.Get( "name_of_your_layer" ) ) ;
shp := layer.Locate( ... ) ;

 

 

If you would like to answer the question please Sign In.
*
*
Please review our recent Privacy Policy.
If you have any questions or requests, please contact us.
Rules
The Questions and Answers (Q & A) is intended to provide a means of communication between TatukGIS customers.
 
  1. Licensed users (with active maintenance play) of TatukGIS products may contribute to the Q & A content. Read-only access is available to anyone.
  2. Keep the content positive and professional.
  3. 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.
  4. The Q & A is not a replacement for TatukGIS technical support. TatukGIS team may or may not regularly follow or contribute content.