markmarkoh / datamaps

Customizable SVG map visualizations for the web in a single Javascript file using D3.js
http://datamaps.github.io
MIT License
3.78k stars 1.01k forks source link

Is it possible to have a Canada only map? #3

Closed termy21 closed 11 years ago

termy21 commented 11 years ago

I'd even pay a small fee for this. I'd love to use the data bubbled on a Canada only map (no US).

Thanks.

markmarkoh commented 11 years ago

So, I pushed a branch that has a Canada focused scope here, the relevant build JS file that you should include is:

https://github.com/markmarkoh/datamaps/blob/o-canada/dist/datamaps.js

You would set the scope to canada, instead of world or any of the other scopes.

This still includes the US, but just set the US fill to match the background so nobody can see it, although I have no idea why you'd want to hide such a beautiful country.

example on setting the fill for the USA to mute it: https://gist.github.com/markmarkoh/4255924#file-map-js-L247

I hope this suffices!

termy21 commented 11 years ago

Thanks for the very quick reply and branch!

The site we are building only focuses on Canada at this time, which is the reasoning behind hiding the US.

Is there any way the scope can be zoomed right in to be Canada only? It's still using lots of space for non-Canada areas.

I did the background matching, which worked. The problem is that is takes out Alaska too, which then makes the Canada map a bit unrecognizable.

Which makes me think it's best if I requested a map with the US still in it, just "zoomed in" so only Canada really shows in it.

I really like your product, as would allow me to show points on a map of Canada without having the user zoom in or out, meaning a zoomed in Canada only map would be great.

With the US only map, you have the state borders outlined. I really like that idea (with the bubbles as well). Any way that can be done with the Canadian provinces/territories?

I'd still like to pay you for your time though if this requires custom development.

I look the USA only map and can only dream the Canada version could look as good, with everything outside of the country not visible, allowing me to see the province/territory borders and also color in each of the 10 provinces and 3 territories with a different color (like you do in the Choropleths example) :-)

Thanks!

termy21 commented 11 years ago

Sorry, forgot to ask if this worked with IE9?

When I browse to http://datamaps.github.com I get a blank page with the following errors:

SCRIPT438: Object doesn't support property or method 'html' datamaps-all.js, line 21 character 530504 SCRIPT5009: 'Map' is undefined datamaps.github.com, line 284 character 7 SCRIPT438: Object doesn't support property or method 'datamap' bombs.js, line 231 character 4

Works great in Chrome. Unfortunately I have IE users too.

termy21 commented 11 years ago

I just wrote a quick sample project with the branch you just created, and it views great in IE. I wonder why the http://datamaps.github.com site shows an error in IE9. Could just be one of the many examples?

markmarkoh commented 11 years ago

It should work in IE9 if you use the "stripped" library and provide jQuery, Backbone and Underscore on the page yourself. Datamaps uses Zepto, which doesn't play nice with IE*, but if jQuery is available it'll use it.

markmarkoh commented 11 years ago

It's now possible to specify your own TopoJSON and your own projection.

See comment here: https://github.com/markmarkoh/datamaps/issues/4#issuecomment-20914423