Knowledge Base Search for: Recently modified first: KB10337 - Mouse Wheel support in the TatukGIS Project. Delphi supports the Mouse Wheel only as a focused control. So you can proceed by calling GIS_ViewerWND1.SetFocus. But better is to add OnMouseWheelXXX events on your form and redirect such events into the GIS_ViewerWND control. For example, this code shows how to add zoom-in on a mouse wheel event: procedure TForm1.FormMouseWheelDown(Sender: TObject; Shift: TShiftState; MousePos: TPoint; var Handled: Boolean); begin GISMouseWheelDown( Sender, Shift, MousePos, Handled ) ; end; procedure TForm1 ... Modified: August 04, 2015 KB10341 - Auto-center feature in the TatukGIS Project. If the auto-center feature is set to True, then the screen will be re-centered upon each click, edit, etc. event. The default TatukGIS Project auto-center value is True, so if you want to override this with your own methods for handing clicks on the map, use the following to turn it off: GIS.AutoCenter := False ; Modified: August 04, 2015 KB10353 - Defining a style in the DrawScope procedure using an ini file. An example of calling the DrawScope procedure looks like the following: ll.DrawScope("STANDID=34156", "flush"). To a style (such as color), define this in your project/ini file section, or do it programmatically: [TatukGIS Layer] Area.Color=GREEN [TatukGIS Layer 1] Style=flush Area.Color=RED or Aera.Color=$0000EE (GBR) =100:0:0 Note that the style called "selected' was predefined. Modified: August 04, 2015 KB10347 - Registration/World file created with other GIS software product is not visible. Some (non-TatukGIS) software products assign crazy dates, such as thirty years in the future, to World Files generated during rectification, which the Borland code (for some reason) in the DK does not accept. Check if your TFW (JGW, etc.) file has a logical date. If not, change the date to something reasonable, and try again to open the file in the DK or other TatukGIS product. Modified: August 03, 2015 KB10349 - Error (DB.OBJ not found) when compiling *.bpk package under Borland C++Builder. Add the DBRTL.BPI and DBEXPRESS.BPI files to the "requires" list. Modified: August 03, 2015 KB10356 - Restore the last map extent upon reopening a project. Using TGIS_Viewer.VisibleExtent will save the zoom level and extent position into the next session. Save the VisibleExtent before exiting and set this just after reopening the project. Modified: August 03, 2015 KB10355 - Calculate centroid point of an irregular shaped polygon. The DK and Editor support two possibilities: Calculate the true centriod position, regardless whether or not it lies within or outside the polygon area. Use - TGIS_Shape.Centroid Calculate the point within the polygon area closest to the true centroid position, to guarantee the calculated point is within the polygon boundary. Use - TGIS_Shape.PointOnShape It is possible to use a given point to reposition (move) an irregularly shaped polygon, such that the point becomes the centroid of the pol ... Modified: August 03, 2015 KB10354 - Calling TGIS_ControlLegendForm from the code. Use the following code: function TGIS_ControlLegendForm.Execute( const _layer : TGIS_LayerAbstract ) : Integer ; Modified: August 03, 2015 KB10348 - Display a point from a database on the map. Create a TGIS_LayerVector layer and then, on each database query, add the following code: layer.RevertAll ; // will reset layer status while not ors.Eof do begin while not ors.Eof do begin shp := layer.CreateShape( gisShapeTypePoint ) ; shp.Lock( gisLockExtent ) ; shp.AddPart ; shp.AddPoint( GisPoint( ors.Fields['X'] , ors.Fields['Y'] ) ); shp.Unlock ; shp.SetField( 'somefield', ors.Fields['somefield'] ) ; ors.MoveNext ; end ; end ; Modified: August 03, 2015 KB10344 - Creating a line feature from GPS points. Step one - create a line: shp := layer.CreateShape( gisShapeTypeArc ) ; my_uid := shp.Uid ; shp.Lock(1) ; shp.Reset ; shp.AddPoint(my_point_1 ) ; shp.AddPoint(my_point_2 ) ; shp.AddPoint(my_point_3 ) ; ... shp.Unlock ; Step two - add a point on GPS update: shp := layer.GetShape( my_uid ) ; shp.Lock(1) ; shp.AddPoint(my_point ) ; shp.Unlock ; Modified: August 03, 2015 KB10342 - Add a pie-piece shaped object to map layer. There are two options for creating pie-piece shaped (or any other shaped) objects in a DK application: 1) Draw this on your own by rendering the pie-piece shape using a series of lines, like this: shp->Lock() ; shp->Reset() ; shp->AddPoint( GisPoint() ) shp->AddPoint( GisPoint() ) shp->Unlock() 2) Override OnPaintShape event (See samples #1 BitmapFill) ll->OnPaintShape = PaintShape ; void __fastcall TForm1::PaintShape( const TObject *_sender, const TGIS_Shape *_shape ) { TPoint pt ; p ... Modified: August 03, 2015 KB10338 - Adding a new point, line, or polygon shape in Visual Basic. Create a Point: shp = layer.CreateShape(XgisShapeTypePoint) shp.Lock(1) shp.AddPart() shp.AddPoint(ptg1) shp.Unlock() Create a Line: shp = layer.CreateShape(XgisShapeTypeArc) shp.Lock(1) shp.AddPart() shp.AddPoint(ptg1) shp.AddPoint(ptg2) shp.Unlock() Create a Polygon: shp = layer.CreateShape(XgisShapeTypePolygon) shp.Lock(1) shp.AddPart() shp.AddPoint(ptg1) shp.AddPoint(ptg2) shp.AddPoint(ptg3) shp.Unlock() Modified: August 03, 2015 KB10336 - Make a polygon layer transparent except for the polygon outlines. It is possible to make polygon fills transparent while leaving the polygon outlines visible by attaching the same layer two times. First: Area.OutlineWidth = 0 (Results in transparent outline.) Second Area.OutlineWidth = a value greater than 0. Area.Pattern = Transparent (Results in transparent fill but visible polygon outlines.) Modified: August 03, 2015 KB10332 - Get the number of shapes in a layer or within a scope. There is no such thing as a shape count. Querying for an object requires, in fact, the traversing of whole layer (in order to skip deleted shapes, out of scope shapes, etc). But you can use: lastpos := layer.GetLastUid ; // first time you will call this can be time consuming layer.MoveFirst ; while ... begin percentage = ( layer.Shape.Uid. * 100 ) div last_pos end ; ... ] Modified: August 03, 2015 KB10330 - Convert coordinates from unprojected to a projected coordinate system. The DK and desktop TatukGIS Editor contain advanced support for coordinate systems with features to transform (reproject) a vector or raster layer(s) from any coordinate system to any other coordinate system, and save the result to a new file in the new coordinate system. If the coordinate system of the source layer is unknown, use the Editor to rectify (if necessary) and georeference the layer to the desired coordinate system. For guidance, refer to the Editor helpfile information for layer rectifica ... Modified: August 03, 2015 KB10329 - Measure shortest distance between a line and a point. ' place DKcomponent on the form just to be sure that an object will be connected Public ProjectionList As New TatukGIS_DK.XGIS_ProjectionList() Const Pi = 3.14159265358979 Dim GISUtils as new XGIS_Utils --- code Private Sub My_procedure() Dim proj As TatukGIS_DK.XGIS_ProjectionAbstract Dim src As New TatukGIS_DK.XGIS_Coordinate() Dim dst As New TatukGIS_DK.XGIS_Coordinate() Dim unt As New TatukGIS_DK.XGIS_Units() proj = ProjectionList.FindEx("UTM") proj.SetUp(0, 0, 0, 0, ... Modified: August 03, 2015 KB10451 - Visual Basic Package & Deployment wizard gives error message during embedding control in ... In some situations, the Visual Basic's Package & Deployment wizard gives an error message suggesting the file location of the control does not match the registry on the PC. The wizard sometimes has a problem with folders/files that have long names or names with spaces in them. In one instance of this problem, the problem was solved simply by changing the default install location for the ocx from "C:\Program Files\TatukGIS\XDK7" to the directory "C:\Test". Modified: July 31, 2015 KB10486 - Upon debugging the XGIS_LayerSQL_ADO the database is closed. The debugger (especially in VB6) can change the default directory during the debugging process. In such case, debugging the XGIS_LayerSQL_ADO gives an error message that the database is closed, even though the application runs fine in stand-alone mode. To avoid this problem during debugging, specify a full patch to the MDB file within your .ttkls. Modified: July 31, 2015 KB10424 - Reduce number of 'OnLayerPaint' calls in DK application. Question from a client: "If I resize the window, I get 2 calls to 'OnLayerPaint' when there should be only one. If I just click on the map (the view displaying the XGIS_ViewerWnd), I get a single call to 'OnLayerPaint' when there should be none. These extra paints cause the application to flicker and slow down during some operations. Is there a way to get rid of the extra paints?" There are a few states of Painting in DrawMode: gisDrawAll - all layers are painted gisDrawAllExceptTop - all layers ex ... Modified: July 31, 2015 KB10494 - Using the DK to custom draw labels. Question from a DK customer: "How can I use the DK to draw labels that are backed by a bitmap aligned with the label location following a line? I need to draw the highway markers behind the highway numbers, all aligned properly with the direction of the highway". The DK (as of the v. 8.0) does not provide a specific function to do this, but this is very easy to implement. Just override the OnPaintShape handler and draw the symbol "manually", with: ... mylayer.OnPaintShape := doPaintShape ; ... pr ... Modified: July 30, 2015 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 Tech Support Q&A Knowledge Base Common Questions