new SuperMap.JoinItem(options)
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
The parameters.
|
Example
The following uses SQL query to explain the use of joinItem:
(start code)
function queryBySQL() {
// Set the join information with exterior tables.
var joinItem = new SuperMap.JoinItem({
foreignTableName: "foreignTable",
joinFilter: "foreignTable.CONTINENT = Countries.CONTINENT",
joinType: "LEFTJOIN"
})
var queryParam, queryBySQLParams, queryBySQLService;
// Set parameters
queryParam = new SuperMap.FilterParameter({
name: "Countries@World",
joinItems: [joinItem]
}),
queryBySQLParams = new SuperMap.QueryBySQLParameters({
queryParams: [queryParam]
}),
queryBySQLService = new SuperMap.QueryBySQLService(url, {
eventListeners: { "processCompleted": processCompleted, "processFailed": processFailed}
});
queryBySQLService.processAsync(queryBySQLParams);
}
function processCompleted(queryEventArgs) {//todo}
function processFailed(e) {//todo}
(end)
Members
-
foreignTableNamestring
-
The name of the external table. If the name of the external table is “table name@datasource”, only the table name should be assigned the value. For example, the external table Name@changchun, Name is the table name, Changchun is the datasource name, the value of the attribute is: Name.
-
joinFilterstring
-
The joint expression between the vector dataset and the external table, i.e., sets the related fields between the two tables. For example, connect the district field of the Building dataset to the region field of the pure Owner attribute dataset. The names of the two tables in the two datasets are Table_Building and Table_Owner, and the joint expression is Table_Building.district = Table_Owner.region. When more than one fields are connected, the expressions are joined with AND.
-
joinTypeSuperMap.JoinType
-
The join type between two tables, i.e., the JoinType type. The join type determines the returned records of join query between two tables.
Methods
-
destroy()
JoinItem.js, line 80 -
Disposes the resource. The property that references resource is set to null.
-
toServerJSONObject()
JoinItem.js, line 91 -
Turned to be JSON object。