I'm using angular 6 with library hightmaps and I need to change the map dinamically when I click in some area. How can I do it? It's posible? I dont find any example's of it.
THIS IS MY CODE:
declare var require: any;
import { Component, OnInit } from '@angular/core';
import { SpainService } from '../services/spain.service';
import * as Highcharts from 'highcharts';
import StockModule from 'highcharts/modules/stock';
import MapModule from 'highcharts/modules/map';
import GanttModule from 'highcharts/modules/gantt';
import ExportingModule from 'highcharts/modules/exporting';
import SunsetTheme from 'highcharts/themes/sunset.src.js';
import Drilldown from 'highcharts/modules/drilldown';
Drilldown(Highcharts);
import HC_exporting from 'highcharts/modules/exporting';
HC_exporting(Highcharts);
StockModule(Highcharts);
MapModule(Highcharts);
GanttModule(Highcharts);
ExportingModule(Highcharts);
SunsetTheme(Highcharts);
Highcharts.setOptions({
title: {
style: {
color: 'blue'
}
},
legend: {
enabled: false
},
navigation: {
buttonOptions: {
enabled: false
}
}
});
@Component({
selector: 'app-maps',
templateUrl: './maps.component.html',
styleUrls: ['./maps.component.css']
})
export class MapsComponent implements OnInit {
Highcharts: typeof Highcharts = Highcharts;
data: any = [
['ANDALUCIA', 78],
['ARAGON', 34],
['CASTILLA Y LEON', 5],
];
chartMap: Highcharts.Options = {
chart: {
map: require('../../assets/maps/ESP_regions.json'),
backgroundColor: 'rgba(255, 255, 255, 0.0)',
},
title: {
text: ''
},
subtitle: {
text: ''
},
mapNavigation: {
enabled: true,
buttonOptions: {
alignTo: 'spacingBox'
}
},
legend: {
enabled: false,
},
colorAxis: {
min: 0,
minColor: '#FFFFFF',
maxColor: '#5c881a',
},
series: [{
events: {
click: function(e) {
console.log(e);
}
},
name: 'dato',
states: {
// hover: {
// color: '#5c881a'
// }
},
dataLabels: {
enabled: true,
format: '{point.properties.NAME_1}'
},
allAreas: true,
data: this.data,
keys: ['NAME_1', 'value'],
joinBy: 'NAME_1',
} as Highcharts.SeriesMapOptions]
};
constructor() {}
ngOnInit() {}
}
I need to add navigation inside map to other areas, using the same map or navigating to other page. What is posible?