How to generate a new map for jvectormap jquery plugin?

我的梦境 提交于 2019-11-28 04:46:24
Artem

Just in case anyone will need the same. To run converter, you need (this instruction is valid for Windows environment):

  • download and install OSGeo4W (use Express Desktop Install)
  • download desired shape file (this natural data file works fine).
  • put anyjson to converter directory
  • create makemap.bat in converter directory, like this:

python ^
   converter.py ^
   ../../ne_10m_admin_1_states_provinces_shp.shp ^
   test-map.js ^
   --width 400 ^
   --where "ISO_3166_2 = 'RU-' and code_hasc!=''" ^
   --country_name_index 12 ^
   --country_code_index 18 ^
   --minimal_area 4000000 ^
   --buffer_distance -0.5 ^
   --simplify_tolerance 10000 ^
   --longitude0 54.8270 ^
   --name russia

  • run OSGeo4W shell (it will be added to start menu)
  • run makemap.bat
  • enjoy generated map

As a sample output attaching this fiddle with russian map generated using steps mentioned above http://jsfiddle.net/dyP4c/3/

About parameters (what I know)

where condition is used to filter out shapes from shapefile using shapefile attributes

simplify_tolerance will affect map quality and size

country_name_index index of REGION NAME attribute in shapefile or column in tab separated file if codes_file is used

country_code_index index of REGION CODE attribute in shapefile or column in tab separated file if codes_file is used

codes_file is tab separated file (if you want to use names/codes not from shapefile)

longitude0 is longitude of area (used this)

name is map name

P.S.: OSGeo4W package has nice Quantium GIS Browser to browse shapefile attributes. You can try to search other shapefiles on the web (not only natural data) to convert to jvectormap

Jay K

Take a look at the command you've written. It looks like it's only for US maps:

--insets '[{"codes": ["US-AK"], "width": 200, "left": 10, "top": 370}, {"codes": ["US-HI"], "width": 100, "left": 220, "top": 400}]' \

I don't know the answer, but that's where I'd start fixing the issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!