I'm using Reactjs to display a map with jvectormap-next. I have to use jquery because react-jvectormap stop getting supported I guess. Here is my code:
import React from "react";
import $ from "jquery";
window.jQuery = $;
require("jvectormap-next")($);
export default class App extends React.Component {
getMap() {
var gdpData = {
AF: 16.63,
AL: 11.58,
DZ: 158.97
// ...
};
$("#world-map-gdp").vectorMap({
map: "world_mill",
series: {
regions: [
{
values: gdpData,
scale: ["#C8EEFF", "#0071A4"],
normalizeFunction: "polynomial"
}
]
},
onRegionTipShow: function(e, el, code) {
el.html(el.html() + " (GDP - " + gdpData[code] + ")");
}
});
}
render() {
return (
<div className="App">
{this.getMap()}
</div>
);
}
}
The error I'm getting is Attempt to use map which was not loaded: world_mill Can anyone help with this? Is there something else I need to import or add to my HTML file?