ammap3
ammap3 copied to clipboard
Uncaught TypeError: Cannot read property 'areas' of undefined, Uncaught TypeError: Cannot read property 'scale' of undefined
Hi,
I'm using trying to build a map chart following the your first map tutorial. I'm using the library inside a React application with ES6 and Babel. I created an SVG map using the Pixel Map tool you suggested and I'm using it through mapUrl option. I get the following errors:
Uncaught TypeError: Cannot read property 'areas' of undefined
Uncaught TypeError: Cannot read property 'scale' of undefined
I imported the library as suggested here This is my code:
import React, { Component } from 'react';
import AmCharts from 'exports?window.AmCharts!ammap3/ammap/ammap';
export default class Map extends Component {
componentDidMount() {
AmCharts.makeChart( 'mapdiv', {
type: 'map',
mapUrl: require('../images/amCharts.pixelMap.svg')
});
}
render() {
const style = {
width: '600px',
height: '400px'
};
return (
<div id="mapdiv" style={style}></div>
);
}
}
Sorry for the late reply. Would you be able to try this with our official React wrapper?
https://github.com/amcharts/amcharts3-react