I have implemented map with amcharts
. When I select(zoom) a particular country, filling it will color. Now when I want to reset the map size, not able to remove the fill color.
This is my code
this.polygonSeries.dataFields.zoomLevel = "zoomLevel";
this.polygonSeries.dataFields.zoomGeoPoint = "zoomGeoPoint";
var polygonTemplate = this.polygonSeries.mapPolygons.template;
var as = polygonTemplate.states.create("active");
as.properties.fill = am4core.color("#d8854f");
Code to zoomout map
public mapCountry_selected(country)
{
var target=this.polygonSeries.getPolygonById(country.id);
// Pre-zoom
this.mapChart .zoomToMapObject(target);
setTimeout(function() {
target.isActive = true;
}, 1000);
}
Code to Reset map. This code is only setting map to normal position but not removing the selected color from mapCountry_selected
public ResetButton()
{
var polygonTemplate = this.polygonSeries.mapPolygons.template;
var as = polygonTemplate.states.create("active");
as.properties.fill = am4core.color("#d9d9d9"); //default color
this.mapChart.goHome()
}
How can I remove fill
color to normal?