-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AmMaps - Uncaught TypeError: Cannot read property '0' of undefined #40
Comments
I've done a bit more investigations on this and have narrowed it down a bit. For the scenario (based on the example code above) where you go from Continent View to Worldview and then try to change the state via the "Change Labels" button the issue is in line 150 of amcharts3-react.js. It is trying to access a key which the object does not have:
This was easily fixed by checking The second scenario is in the same area but a different issue. Under the scenario of going from Worldview to Country view and then updating the state the issue arises when setting the key for 'images'. The object is undefined. However it is an array of objects and the comparison on line 144 Hope this helps. Joe |
@AaronONeill Thanks for reporting this! @joesken Thanks for the detailed information! I'll look into fixing this ASAP. |
@AaronONeill Sorry for the wait, I have fixed this in version 2.0.3 |
Hi,
I have been building a prototype for a drilldown map (continents -> world -> country) and I have added labels at each stage which is working correctly.
I am now trying to update the maps labels (images) via a button click. The button simply updates the state where the label text is coming from. This is working fine if I click the button on the "Continent" view however if I click on "North America" for example, the map switches to World view and if I now click on the Update Labels button, it causes the following error:
Below is the React application so far:
Here is the HTML page which displays the map (attached is the index.html with JS):
app.zip
The text was updated successfully, but these errors were encountered: