Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jvectormap missing countries

I have been using jvectormap now for a few weeks, but there are a lot of missing countries. Does anyone know where I can get the countries information in the jvectormap format?

I searched in google for hours but cannot find anything.

There is a jqvmap with a few more countries, but it's in a different projection and there are also some countries missing.

At the moment I am using:

jvectormap-world-en.js

and I cannot handle the python converter.

Does anyone have a source for that?

like image 498
Laokoon Avatar asked Feb 03 '13 19:02

Laokoon


2 Answers

The problem you have is wider than just absence of some countries on the map. If you just add bunch of small countries to the map most of them won't be visible even at the highest level of zoom. The solution that was suggested by this demo is to use markers feature of jVectorMap to present smaller countries.

You need to assign codes instead of indexes for markers to make data methods to work properly. To do this just use hash instead of array when defining markers:

//instead of this
markers: [
  {latLng: [41.90, 12.45], name: 'Vatican City'},
  {latLng: [43.73, 7.41], name: 'Monaco'},
  ...
]

//use this
markers: {
  "VA": {latLng: [41.90, 12.45], name: 'Vatican City'},
  "MC": {latLng: [43.73, 7.41], name: 'Monaco'},
  ...
}
like image 176
bjornd Avatar answered Oct 07 '22 00:10

bjornd


You can add the below lines to jquery-jvectormap-world-mill.js file for some of the missing countries

    "BH":  {"path": "M548 215 L549 215 L549 216 L548 216 Z", "name": "Bahrain"},
    "MV":  {"path": "M622 291 L624 291 L624 293 L622 293 Z", "name": "Maldives"},
    "SC":  {"path": "M564 301 L566 301 L566 303 L564 303 Z", "name": "Seychelles"},
    "MU":  {"path": "M571 347 L573 347 L573 349 L571 349 Z", "name": "Mauritius"},
    "SG":  {"path": "M680 280 L682 280 L682 282 L680 282 Z", "name": "Singapore"},
    "PW":  {"path": "M779 260 L781 260 L781 262 L779 262 Z", "name": "Palau"}
like image 44
Mohsen Gorzin Avatar answered Oct 06 '22 22:10

Mohsen Gorzin