themustafaomar / jsvectormap

A lightweight JavaScript library for creating interactive maps and pretty data visualization.
https://jvm-docs.vercel.app
MIT License
398 stars 80 forks source link

Can't load United States map #112

Closed hotlines-studio closed 3 months ago

hotlines-studio commented 1 year ago

Hi there,

I am trying to load a US map, for example the 'us_mill_en' here: https://jvm-docs.vercel.app/docs/available-maps

I have this js file: https://raw.githubusercontent.com/themustafaomar/jsvectormap/master/src/maps/us-mill-en.js

var jvm = new jsVectorMap({
  map: "us_mill_en",
  selector: "#map"
})

But this US map won't load. If I change the file from ../us-mill-en.js to ../world-merc.js and change the following map property from us_mill_en to world_merc it works fine:

var jvm = new jsVectorMap({
  map: "world_merc",
  selector: "#map"
})
hotlines-studio commented 1 year ago

UPDATE: I went ahead and installed vuevectormap locally for a Nuxt / Vue.js project I'm working on.

Looking at the node_modules, the world map is called from: require("jsvectormap/dist/maps/world")

Looking into this folder, the only two maps included are 'world' and 'world-merc'

If I manually copy the us-mill-en.js file and add this into this dist maps folder, and call us_mill_en it works great!

Guess this issue could be deleted and opened up in the vuevectormap repo, ha.

themustafaomar commented 1 year ago

Hi @something-strange

Sorry for the late response, I'd like to point out that jsvectormap is shipped with only two maps just like you said the world and world-merc maps, case if I decided to ship all maps via npm the package will be really heavy, however, you'll need to download your preferred map from available maps page manually.

themustafaomar commented 3 months ago

Since this issue hasn't seen any activity recently, I'm closing it.

Feel free to reopen if needed!