JVectorMap - change region label

I need to translate region name in JVectorMap. I use onRegionLabelShow but nothing happens here is my code:<script> jQuery(function($) { $(function(){ var regionColor = "#ee943...

I need to translate region name in JVectorMap. I use onRegionLabelShow but nothing happens here is my code:

<script>
  jQuery(function($) {
    $(function(){

      var regionColor = "#ee9439"
      color = {};

      color['US'] = regionColor;
      color['FI'] = regionColor;
      color['BY'] = regionColor;
      color['UK'] = regionColor;
      color['GB'] = regionColor;

      var name = {
      'US': 'USA', 
      'DE': 'Deutschland',
      'RU': 'Russland' 
      }

      $('#world-map').vectorMap({

        map: 'world_mill_en',
        backgroundColor: '#00AAA1',
        series: {
          regions: [{
            values: color,
            attribute: 'fill'
          }]
        },
        onRegionLabelShow: function(e, el, code){

          label.html(names[code]);
        }

      });
    });
  });
</script>

You have a typo in your code: You declare an array name, but your onRegionLabelShow tries to access names.

Translating... 0%