cadetill's blog | Copyright © Xavier Martínez (cadetill)

# Class TGMRestriction

Description
Hierarchy
Fields
Methods
Properties

## Unit

GMLib.Map

## Declaration

`type TGMRestriction = class(TGMPersistentStr)`

## Description

`google.maps.MapRestriction` inteface from Google Maps API.

A restriction that can be applied to the Map. The map's viewport will not exceed these restrictions.
More information at google.maps.MapRestriction interface

## Hierarchy

- TObject
- TPersistent
- TInterfacedPersistent
- TGMInterfacedOwnedPersistent
- TGMPersistent
- TGMPersistentStr
- TGMRestriction

## Overview

### Methods

| `constructor Create(AOwner: TPersistent); override;`
| `destructor Destroy; override;`
| `function PropToString: string; override;`
| `procedure Assign(Source: TPersistent); override;`

### Properties

| `property APIUrl;`
| `property Enabled: Boolean read FEnabled write SetEnabled;`
| `property LatLngBounds: TGMLatLngBounds read FLatLngBounds write FLatLngBounds;`
| `property StrictBounds: Boolean read FStrictBounds write SetStrictBounds;`

## Description

### Methods

| `constructor Create(AOwner: TPersistent); override;`
Class constructor. ###### Parameters AOwner Owner of the object.

| `destructor Destroy; override;`
Destructor class.

| `function PropToString: string; override;`
Converts all class properties values to a string separated by comma used to send values to a JavaScript function. ###### Returns string with all properties.

| `procedure Assign(Source: TPersistent); override;`
Call `Assign` to copy the properties or other attributes form an object to another. The standard form of a call to `Assign` method is `Destination.Assign(Source);` which tells the `Destination` object to copy the contents of the `Source` object to itself. ###### Parameters Source Object to copy the content.

### Properties

| `property APIUrl;`
URL to Google Maps API page.

| `property Enabled: Boolean read FEnabled write SetEnabled;`
Enables or disables TGMRestriction property.

| `property LatLngBounds: TGMLatLngBounds read FLatLngBounds write FLatLngBounds;`
When set, a user can only pan and zoom inside the given bounds. Bounds can restrict both longitude and latitude, or can restrict latitude only.

| `property StrictBounds: Boolean read FStrictBounds write SetStrictBounds;`
Bounds can be made more restrictive by setting the strictBounds flag to true. This reduces how far a user can zoom out, ensuring that everything outside of the restricted bounds stays hidden. The default is false, meaning that a user can zoom out until the entire bounded area is in view, possibly including areas outside the bounded area.

Generated by PasDoc 0.15.0.