kadoshms / react-jvectormap

A react wrapper for jvectormap maps
MIT License
98 stars 70 forks source link

country names #88

Closed pkocak closed 3 years ago

pkocak commented 3 years ago

Is there a way to obtain not only country codes but countries' full names as well in world map when onRegionClicked or onRegionSelected?

kadoshms commented 3 years ago

In the upcoming major release of 1.0.0 it will be possible due to the new unified format of maps:

 const ref = useRef(null);
  <VectorMap mapRef={ref}
      onRegionClick={(event, code) => {
         console.log(ref.current.getRegionName(code));
      }}
  ...
 />