2

I am creating a control to be used in a DNN site that will display the US map using jVectoMap.

When I click Colorado I need the state map to appear with the counties defined. Eventually I would like to have all of the US states but Colorado is critical right now.

I have tried running different Shape files through the converter as documented on the website but so far I haven't been able to get the counties. I have also contacted the developer three days ago now but have yet to hear back.

Unfortunately I am on a deadline for this and don't have anymore time to waste trying and failing.

Does anybody have a Colorado map with the county lines that is copyright free to use? Or is somebody willing to make one($-PM me)?

Any help is appreciated, thanks.

BTW if there is another library out there that has the US and state county maps available, I'm not married to jVectorMap.

  • check this question http://stackoverflow.com/questions/3544041/google-maps-w-counties-overlay – mfs Jul 25 '14 at 16:01
  • That is interesting, I'm wondering how I can use that with jVectorMap? Basically what I need to do is click on a state on the US map, pull up a map of that state with the counties, and when the user clicks on that county it loads certain data – PurpleKoolAid Jul 25 '14 at 17:23
  • @PurpleKoolAid Did you figure out how to display county? If so, could you please share it; I'm also in same saturation. – Win Aug 01 '14 at 19:17
  • @Win I have posted the answer – PurpleKoolAid Aug 02 '14 at 20:34

2 Answers2

3

I fixed this problem for all states by downloading the full project for jvectormap - http://jvectormap.com/download/

and under /tests/assets/us the author includes all the js files needed. Just copy them over to your project and use:

new jvm.MultiMap({
    container: $('.jvectormap-container'),
    maxLevel: 1,
    main: {
      map: 'us_lcc_en'
    },
    mapUrlByCode: function(code, multiMap){
      return '../js/counties/jquery-jvectormap-data-'+
             code.toLowerCase()+'-'+
             multiMap.defaultProjection+'-en.js';
    }
  });

and it will load each of the county maps on demand

Matt Sloan
  • 80
  • 10
1

How I solved this:

First use this site to find a .svg of the map you need: http://commons.wikimedia.org/wiki/File:Blank_map_of_Colorado.svg

Majority of these maps are free to use however you see fit. Just read the terms to be sure.

Then open the .svg with notepad/notepad++ etc. and paste everything to this site: http://svgto.jvectormap.com/

After you paste, hit 'Convert to map' and on the next page you will be able to create the Names (which show up on the hover labels for jVectorMap) and the IDs.

Hope this helps