User Tools

Site Tools


samples:samples:viewer

Table of Contents

Viewer sample

Documentation | Samples | Viewer

Summary

CGMViewer sample — demonstrates rendering CGM (Computer Graphics Metafile) symbol files (Delphi/VCL).

Description

What the sample shows:

  • Loading CGM (Computer Graphics Metafile) symbol files
  • Displaying available symbols from TatukGIS symbol library
  • Rendering CGM symbols as point markers on the map
  • Using TGIS_Utils.SymbolList to enumerate symbol resources
  • Creating point shapes with symbol markers
  • Rotating symbols programmatically (90° increments)
  • Scaling symbols to fit viewer extents
  • Interactive symbol selection via file listbox
  • Displaying symbols centered on crosshair layer
  • Symbol preview and visualization
  • Supporting multiple symbol size and rotation parameters

See also ViewerLite sample.

This sample illustrates use of:

Name Description
TGIS_Viewer.OpenOpen a project.
TGIS_Viewer.CloseClose the current project.
TGIS_Viewer.ItemsAll layers.
TGIS_Viewer.UseRTreeTrue if an RTree spatial index will be used by default when a layer is created.
TGIS_Viewer.CSCoordinate system assigned to the viewer.
TGIS_Viewer.InvalidateWholeMapInvalidate whole map.
TGIS_Viewer.ExtentMap extent encompassing the collective extents of all layers.
TGIS_Viewer.InPaintTrue if the viewer is busy in the Paint procedure.
TGIS_Viewer.IsEmptyTrue if the viewer is empty and contains no layers.
TGIS_Viewer.LocateLocates the shape nearest to _ptg that is within _prec.
TGIS_Viewer.ScreenToMapConverts point coordinates from screen coordinates to map coordinates.
TGIS_Viewer.FullExtentCalculate the screen origin, zoom, and viewport to place the whole map in the window.
TGIS_Viewer.GetRetrieve the layer identified by name.
TGIS_ViewerWnd.RendererCurrently active renderer.
TGIS_ViewerWnd.ModeDetermines how the viewer reacts to mouse input.
TGIS_Utils.GisCreateLayerCreate a layer instance for the specified registered layer name and path.
TGIS_Layer.PathPath to the file holding the layer data.
TGIS_Layer.CSCoordinate Reference System (CRS) assigned to the layer.
TGIS_LayerVector.ImportLayerImport shapes from another vector layer, optionally filtered by extent, target geometry type, and SQL (Structured Query Language) WHERE clause.
TGIS_LayerPixel.BuildBuilds an in-memory georeferenced bitmap or grid layer using the specified pixel size.
TGIS_LayerVector.DeselectAllClears the selection state of all shapes in the layer.
TGIS_Shape.IsSelectedShape is selected in the layer.
TGIS_PixelExportManager.ExportFromExports a rectangular map extent from a viewer into the destination pixel layer using the configured tile settings.

Code

This sample is available on the following platforms (click to view the source code on GitHub):

2026/09/21 00:22

Page Tools