Location Field
The location field is used to store and retrieve geographic location information. It can be used to store addresses, coordinates, and other location-related data.
Interface
The ILocationField
interface represents a location field in the database schema. You can use the following code to get a location field from a table:
const locationField = await table.getField<ILocationField>(fieldId);
const locationField = await table.getField<ILocationField>(fieldId);
The corresponding data structure for a location is defined as follows:
type IOpenLocation = {
address: string;
adname: string;
cityname: string;
name: string;
pname: string;
fullAddress: string;
location: string;
full_address: string; // Deprecated
};
type IOpenLocation = {
address: string;
adname: string;
cityname: string;
name: string;
pname: string;
fullAddress: string;
location: string;
full_address: string; // Deprecated
};
Methods
createCell
The createCell
method creates a new cell with a location value.
createCell: (val: IOpenLocation) => Promise<ICell>;
createCell: (val: IOpenLocation) => Promise<ICell>;
getCell
The getCell
method retrieves the cell with the location value for a specific record.
getCell: (recordOrId: IRecordType | string) => Promise<ICell>;
getCell: (recordOrId: IRecordType | string) => Promise<ICell>;
setValue
The setValue
method sets the location value for a specific record.
setValue: (recordOrId: IRecordType | string, val: IOpenLocation) => Promise<boolean>;
setValue: (recordOrId: IRecordType | string, val: IOpenLocation) => Promise<boolean>;
getValue
The getValue
method retrieves the location value for a specific record.
getValue: (recordOrId: IRecordType | string) => Promise<IOpenLocation>;
getValue: (recordOrId: IRecordType | string) => Promise<IOpenLocation>;
setInputType
The setInputType
method sets the input type for the location field.
setInputType: (inputType: ELocationInputType) => Promise<IFieldRes>;
setInputType: (inputType: ELocationInputType) => Promise<IFieldRes>;
The ELocationInputType
enum defines the available input types for location fields:
enum ELocationInputType {
ONLY_MOBILE = 'ONLY_MOBILE',
NOT_LIMIT = 'NOT_LIMIT',
}
enum ELocationInputType {
ONLY_MOBILE = 'ONLY_MOBILE',
NOT_LIMIT = 'NOT_LIMIT',
}
getInputType
The getInputType
method retrieves the input type for the location field.
getInputType: () => Promise<ELocationInputType>;
getInputType: () => Promise<ELocationInputType>;
The ELocationInputType
enum defines the available input types for location fields:
enum ELocationInputType {
ONLY_MOBILE = 'ONLY_MOBILE',
NOT_LIMIT = 'NOT_LIMIT',
}
enum ELocationInputType {
ONLY_MOBILE = 'ONLY_MOBILE',
NOT_LIMIT = 'NOT_LIMIT',
}