2

If someone have some experiences with TatukGIS developer kernel product, can you explain how to programmatically save and load layer properties like in their free TatukGIS viewer product?

The environment i use were Delphi 7 and BDS 2006

thanks

Edit, this code don't work:

var
  lyrPeta: TGIS_LayerSHP;
begin
  MapPath:= ExtractFilePath(Application.ExeName) + '\maps\';
  lyrPeta:= TGIS_LayerSHP.Create;
  lyrPeta.Path:= MapPath + 'jabodetabek'+'_asjalan.shp';
  lyrPeta.Name:= 'jabodetabek'+'_asjalan.shp';
  lyrPeta.IgnoreShapeParams:= True;
  lyrPeta.UseConfig:= True;
  lyrPeta.ConfigName:= MapPath + 'jalan.ini';
  lyrPeta.ReadConfig;
  GIS_Viewer.Add(lyrPeta);

menjaraz
  • 7,551
  • 4
  • 41
  • 81
Dels
  • 2,375
  • 9
  • 39
  • 59

1 Answers1

3

We do this as below in VB6. I think our code was originally based on this FAQ entry. It makes the Tatuk control save an INI file with the layer properties. I believe it automatically reloads the layer properties when the app starts again. If you only want one file, rather than one file per layer, you could try a TTKGP file.

With layer ' the layer is an XGIS_LayerVector '
  .StoreParamsInProject = False
  .ConfigName = "c:\test\mylayer.ini" ' a separate INI file for each layer '
  .WriteConfig
  .SaveAll
End With

EDIT: And loading again - I think this is after the layer has been added to the GIS control.

With layer ' the layer is an XGIS_LayerVector '
  .StoreParamsInProject = False
  .ConfigName = "c:\test\mylayer.ini" ' a separate INI file for each layer '
  .RereadConfig
End With

IMHO the Tatuk help and samples are hard to understand, although the product itself is pretty powerful. It's worth trying the forum for Tatuk questions as well, although you need a support agreement to access it :(

MarkJ
  • 30,070
  • 5
  • 68
  • 111
  • thanks, i never realize about ConfigName & WriteConfig (but i know about SaveAll), i will investigate this – Dels Aug 20 '09 at 01:46
  • can you give solution for reading the config by selecting the config file? i have it like in my question, but somehow it can't work – Dels Aug 20 '09 at 07:47
  • Have done, I've also added a link to an FAQ page on Tatuk - I *think* our code was originally based on this. http://www.tatukgis.com/faq/question.aspx?show=/faq/store/q10668.htm – MarkJ Aug 20 '09 at 08:17
  • thanks again for reply, i'm still evaluating tatukgis (use trial), and we will buy the retail when our project start – Dels Aug 20 '09 at 09:52
  • A contractor wrote our Tatuk code for us, and we're now maintaining it. We're fairly happy with the code and the product's powerful, we just struggle to work out how to do anything new. We use the help, samples and forum but still find it difficult. How are you getting on? – MarkJ Aug 20 '09 at 12:29
  • Hi @MarkJ :) I am working with Tatuk for 1.5 year now and generaly I am impressed by the framework \ component. I've made some nice extentions to it. Do you have any perticular new feature on your mind? – Wodzu Jan 28 '13 at 13:36