MapBuilding
Map building class
Example:
var mapView = new KQ.Map.MapView({
center: [ 30.56, 113.66 ],
zoom: 10,
maxZoom: 16,
});
mapView.initAsync(function () {
var geoJSON = { ... };
var building = KQ.Map.MapBuilding.getInstance();
building.setOnClick(function (e) {
console.log('building on click !!!');
})
building.addToMapView(mapView);
building.addData(geoJSON);
});
Static Method Summary
| Static Public Methods | ||
| public static |
getInstance(options: Object): MapBuilding Get object instance |
|
Method Summary
| Public Methods | ||
| public |
Add data |
|
| public |
addToMapView(mapview: MapView): Null Added to the mapview |
|
| public |
Clear data |
|
| public |
delData(id: *) Delete the data |
|
| public |
Get the data |
|
| public |
Set or obtain the minimum display zoom |
|
| public |
remove(): Null Remove from the map |
|
| public |
setOnClick(onClick: Function): null Set the click event response function |
|
Static Public Methods
public static getInstance(options: Object): MapBuilding source
Get object instance
Params:
| Name | Type | Attribute | Description |
| options | Object | Set the parameters |
|
| options.onClick | Color | The response event when the mouse clicks |
Public Methods
public addData(geojson: Object, options: Object): * source
Add data
Params:
| Name | Type | Attribute | Description |
| geojson | Object | GeoJSON |
|
| options | Object | Set the parameters |
|
| options.wallColor | Color | Wall color |
|
| options.roofColor | Color | Roof color |
|
| options.buildingHeight | Number | Building height(m) |
|
| options.roofHeight | Number | Roof height(m) |
|
| options.shadows | Boolean | Whether to display shadow(true or false) |
Return:
| * | null |
public addToMapView(mapview: MapView): Null source
Added to the mapview
Params:
| Name | Type | Attribute | Description |
| mapview | MapView | mapview object |
Return:
| Null |
public getData(id: Number): Object source
Get the data
Params:
| Name | Type | Attribute | Description |
| id | Number | data id |
Reference
Source