Browse Source

地图改为天地图

非煤矿山灾害智能感知和预警系统
jingbowen 2 years ago
parent
commit
dae5ad2fc7
  1. 29
      src/app/home/statistic-analysis/home/home.component.ts

29
src/app/home/statistic-analysis/home/home.component.ts

@ -834,8 +834,8 @@ export class HomeComponent implements OnInit {
// }); // });
// }); // });
// } // }
countries = [];
map; map;
mapInit() { mapInit() {
var T = window['T']; var T = window['T'];
var d3 = window['d3']; var d3 = window['d3'];
@ -855,6 +855,31 @@ export class HomeComponent implements OnInit {
); );
function init(sel, transform) { function init(sel, transform) {
let colors = [
{h:'319',s:0.85,l:0.56},
{h:'268',s:0.79,l:0.71},
{h:'287',s:0.79,l:0.54},
{h:'247',s:0.80,l:0.67},
{h:'206',s:0.85,l:0.57},
{h:'220',s:0.43,l:0.64},
{h:'176',s:0.86,l:0.89},
{h:'186',s:0.72,l:0.57},
{h:'200',s:0.8,l:0.69},
{h:'319',s:0.85,l:0.56},
{h:'268',s:0.79,l:0.71},
{h:'287',s:0.79,l:0.54},
];
// let colors = [
// '#EE30B3',
// '#B37CF0',
// '#BD2CE6',
// '#7768EE',
// '#359EEF',
// '#7B95CA',
// '#CAFBF8',
// '#43D0E1',
// '#72C6EF',
// ];
var upd = sel.selectAll('path.geojson').data(countries); var upd = sel.selectAll('path.geojson').data(countries);
upd upd
.enter() .enter()
@ -862,7 +887,7 @@ export class HomeComponent implements OnInit {
.attr('class', 'geojson') .attr('class', 'geojson')
.attr('stroke', 'black') .attr('stroke', 'black')
.attr('fill', function (d, i) { .attr('fill', function (d, i) {
return d3.hsl(Math.random() * 360, 0.9, 0.5); return d3.hsl(colors[i].h, colors[i].s, colors[i].l);
}) })
.attr('fill-opacity', '0.5'); .attr('fill-opacity', '0.5');
} }

Loading…
Cancel
Save