Search code examples
javascriptmapsjvectormap

Change the center of jvectormap from EU to ASIA


I want to change the center of jvectormap world_mill map from EU to ASIA. It is possible? If it is not, how can I create a custom world map with ASIA in the center?


Solution

  • Longitude is the geographic coordinate used to express the distance of a point east or west, relative to the Greenwich meridian or Prime meridian.

    I think if you change this parameter, you need to position markers by pixel coordinates only, not by latitude and longitude (as stated on the jvectormap website).

    To avoid this, if you absolutely need to have a world map with center in Asia, another possibility would be to do some math calculations to shift the longitude (for example to position markers by coordinates) with respect of the new meridian that will be origin of your "shifted" longitude.

    To create a new map, you can use the open-source tool SVG-edit:

    https://en.wikipedia.org/wiki/SVG-edit

    Here you will find two step-by-step tutorial how to do a custom map:

    http://anshumania.github.io/delhi-map/howtocreate.html

    http://www.jaffredo.com/2012/tutoriel-jquery-creer-ses-propres-cartes-pour-jvectormap-et-jqvmap/