1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
| import { Component, OnInit } from '@angular/core';
| import { _HttpClient } from '@delon/theme';
| import { MapOptions, HeatmapData, HeatmapOptions, NavigationControlOptions, ControlAnchor, NavigationControlType } from 'angular2-baidu-map';
|
| @Component({
| selector: 'app-sand-table',
| templateUrl: './sand-table.component.html'
| })
| export class SandTableComponent implements OnInit {
| options: MapOptions;
| private _map: any;
| constructor(
| private http: _HttpClient
| ) {
| this.options = {
| minZoom: 3,
| maxZoom: 13,
| cursor: 'default',
| centerAndZoom: {
| lng: 121,
| lat: 31.4,
| zoom: 17
| },
| mapType: window['BMAP_SATELLITE_MAP'],
| 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
| };
| }
| }
|
|