bjornd / jvectormap

jvectormap.com
GNU Affero General Public License v3.0
1.38k stars 431 forks source link

suppress "undefined" when country code is empty #453

Open ghost opened 5 years ago

ghost commented 5 years ago

The countries which have a country code displays correct with the number. Countries without a value display's as undefined. My script is in the minified version. What to add that I can suppress the countries without a value?

I was searching long time, checked the pull requests and issues, but I can't find the answer for me.

remiemalik commented 1 year ago

The countries which have a country code displays correct with the number. Countries without a value display's as undefined. My script is in the minified version. What to add that I can suppress the countries without a value?

I was searching long time, checked the pull requests and issues, but I can't find the answer for me.

Hi Ghost,

You can use the following code:

onRegionTipShow: function(e, el, code){ if(gdpData[code] === undefined) el.html(el.html()+' (no orders)'); else el.html(el.html()+' (Orders: '+gdpData[code]+')'); }

Add this to the parameters. Enjoy!