| ArcPad Scripting Object Model Reference > ArcPad Scripting Samples > Zoom to Layer | 
Description:
How to use: 
JScript
| Copy Code  | |
|---|---|
| function ZoomToLayer() { var pLayer; if (Map.Layers.Count == 0) return; pLayer = Map.Layers(1); Map.Extent = pLayer.Extent; Map.Refresh(); pLayer = null; } ZoomToLayer(); | |
VBScript
| Copy Code  | |
|---|---|
| Sub ZoomToLayer() Dim pLayer If Map.Layers.Count = 0 Then Exit Sub Set pLayer = Map.Layers(1) Map.Extent = pLayer.Extent Map.Refresh Set pLayer = Nothing End Sub Call ZoomToLayer() | |