User Tools

Site Tools


samples:samples:zooming

Table of Contents

Zooming sample

Documentation | Samples | Zooming

Summary

Zooming Sample - Interactive map navigation using mouse wheel zoom, drag-select zoom region, and switching between zoom and pan modes.

Description

What the sample shows:

  • Zooming using mouse movement and mouse wheel
  • Implementing zoom-to-region with drag-select
  • Setting specific zoom levels programmatically
  • Panning and scrolling within zoomed view
  • Zoom in/out button controls
  • Centering view on selected features
  • Maintaining aspect ratio during zoom
  • Animation of zoom transitions

This sample illustrates use of:

Name Description
TGIS_Viewer.OpenOpen a project.
TGIS_Viewer.FullExtentCalculate the screen origin, zoom, and viewport to place the whole map in the window.
TGIS_ViewerWnd.ModeDetermines how the viewer reacts to mouse input.
TGIS_ViewerWnd.ZoomByZoom the viewer.

Code

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

2026/07/08 06:04

Page Tools