From 4c99ab95e0449348d938ec0ceb949bceafb0cfda Mon Sep 17 00:00:00 2001 From: fengxiang <110431245@qq.com> Date: Fri, 03 Aug 2018 16:56:33 +0800 Subject: [PATCH] 设备数据和 地图相关 --- src/app/routes/grid-trace/grid-trace.component.ts | 51 ++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 46 insertions(+), 5 deletions(-) diff --git a/src/app/routes/grid-trace/grid-trace.component.ts b/src/app/routes/grid-trace/grid-trace.component.ts index 10972ac..3d17648 100644 --- a/src/app/routes/grid-trace/grid-trace.component.ts +++ b/src/app/routes/grid-trace/grid-trace.component.ts @@ -1,17 +1,58 @@ import { Component, OnInit } from '@angular/core'; import { _HttpClient } from '@delon/theme'; +import { MapOptions, HeatmapData, HeatmapOptions, NavigationControlOptions, ControlAnchor, NavigationControlType } from 'angular2-baidu-map'; +import { ViewEncapsulation } from '@angular/compiler/src/core'; +import { BMapLib } from 'angular2-baidu-map/types/BMapLib'; @Component({ selector: 'app-grid-trace', templateUrl: './grid-trace.component.html', }) export class GridTraceComponent implements OnInit { - + options: MapOptions; + private _map: any; constructor( private http: _HttpClient - ) { } - - ngOnInit() { + ) { + this.options = { + minZoom: 3, + maxZoom: 13, + cursor: 'default', + centerAndZoom: { + lng: 121, + lat: 31.4, + zoom: 17 + }, + enableKeyboard: true + }; } - + loadMap(map: any) { + this._map = map; + } + navigationOpts: NavigationControlOptions; + //��������� + heatData: HeatmapData = { + data: [ + {"lng":121,"lat":31.4,"count":99}, + {"lng":121.02,"lat":31.38,"count":95}, + {"lng":120.96,"lat":31.39,"count":95}, + ], + max: 100 + }; + heatOption: HeatmapOptions = { + radius: 100 + }; + heatmapOverlay :any; + /** + * loadHeatmap + */ + public loadHeatmap(heatmapOverlay) { + this.heatmapOverlay = heatmapOverlay; + } + ngOnInit() { + this.navigationOpts = { + anchor: ControlAnchor.BMAP_ANCHOR_BOTTOM_RIGHT, + type: NavigationControlType.BMAP_NAVIGATION_CONTROL_LARGE + }; + } } -- Gitblit v1.8.0