jvectormap missing countries
Asked Answered
L

4

6

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?

Lynch answered 3/2, 2013 at 19:12 Comment(3)
What countries are you interested in that are missing?Stochastic
i'm interested in all countries. thats the problem. but heres a list of missing countries i know: vatican city, monaco, nauru, tuvalu, san marino, liechtenstein, marshall islands, saint kitts and nevis, maledivs, malta, grenada, saint vincent and the grenadines, micronesia, barbados, antigua and barbuda, seychells, palau, andorra, saint lucia, singapore, kiribati, tonga, dominica, mauritius, bahrain, sao tome and principe, ... and all that tare missing. :-) i need a complete mapLynch
For anyone that finds this in the future, I've made a version of the default map with the micro countries included here that you might find useful.Antiquity
L
1

finally I found a vector-map with all countries at wikimedia:

wikimedia.org

Lynch answered 15/1, 2014 at 13:56 Comment(4)
can you please explain how to use this SVG fileArmil
you need to convert the SVG-Element to Objects. Thats not hard because each country has it's own svg-element and the correct name in it.Lynch
i added this new line to existing code ... "sp": { "path": "M103.97,1.331L103.82,1.265L103.65,1.326L103.705,1.423L103.818,1.447L103.909,1.416L103.961,1.392L103.996,1.365L103.97,1.331z", "name": "Singapore" },Armil
@WasimA. There is incorrect syntax in your file. Please replace "pathes" with "paths". Then map will load.Colenecoleopteran
F
8

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'},
  ...
}
Footlocker answered 4/2, 2013 at 16:5 Comment(2)
i know this demo. i also tried to use it. but i have data in the backend, which gives me some ISO-Codes with a number. now i have to fill regions AND markers with some new fill. for regions its easy: mo.series.regions[0].setValues(values); but how should i do it for markers, because the markers doesnt support that?: mo.series.markers[0].setValues(values);Lynch
@Lynch See edit. Regarding the map realism. It's always a trade-off between size and number of details. The maps on the site is something casual developer can use. If you need something specific you can use converter and create a super-detailed map of several MB in size.Footlocker
B
4

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"}
Brevier answered 7/8, 2018 at 10:5 Comment(0)
L
1

finally I found a vector-map with all countries at wikimedia:

wikimedia.org

Lynch answered 15/1, 2014 at 13:56 Comment(4)
can you please explain how to use this SVG fileArmil
you need to convert the SVG-Element to Objects. Thats not hard because each country has it's own svg-element and the correct name in it.Lynch
i added this new line to existing code ... "sp": { "path": "M103.97,1.331L103.82,1.265L103.65,1.326L103.705,1.423L103.818,1.447L103.909,1.416L103.961,1.392L103.996,1.365L103.97,1.331z", "name": "Singapore" },Armil
@WasimA. There is incorrect syntax in your file. Please replace "pathes" with "paths". Then map will load.Colenecoleopteran
G
1

Here is an updated JS file with all the countries

https://gist.github.com/paulsheldrake/69d8817ab616aa81919b9dc438359ccf

Grimbal answered 14/5, 2020 at 18:3 Comment(1)
Hey man, I just pasted the code inside jquery-jvectormap-world-mill.js file from the gist above, but I'm getting Uncaught Error: Attempt to use map which was not loaded: world_mill error. What could be going wrong here?Rudelson

© 2022 - 2024 — McMap. All rights reserved.