all 6 comments

[–]C3P0 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (5 children)

I like how simplemaps proprietary code is basically 20 lines long if you take away the coordinates of each state. You could redraw 50 states if you have the patience then you could also have more control over how to display the information. Better yet, just copy their coordinates--it's not like they measured the border of Florida physically; they copied the information without citing the source then claimed it as their own.

Don't sell yourself short. You are a budding programmer.

[–][deleted] 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (4 children)

Thanks!

I definitely don't have the patience to redraw everything. The major problem is getting the proportions right.

[–]C3P0 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (3 children)

Well, the best way would be to use Inkscape and draw all the states in one file by tracing an open source image of the US. It could be done in an hour with some finesse.

[–][deleted] 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (2 children)

Yeah, but I don't have that kind of patience — and how would I go-about converting it to a JavaScript image?

[–]C3P0 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (1 child)

I think you mean that you want to create an SVG image in JavaScript. The answer is something like this:

let svg = document.createElementNS("http://www.w3.org/2000/svg", 'svg');
svg.setAttribute('width','200px');
svg.setAttribute('height','200px');
svg.innerHTML = 'put valid xml here (this includes the coordinates and fill color)';
element.appendChild(svg);

For a better answer, see: https://stackoverflow.com/questions/3492322/javascript-createelementns-and-svg

[–][deleted] 3 insightful - 2 fun3 insightful - 1 fun4 insightful - 2 fun -  (0 children)

Oh, thanks!