Closed rafagarcia closed 11 years ago
agreed. Currently it's "whole world" or "just USA". I want to add different zoom levels to different continents.
So maybe:
$("#map").datamaps({ zoom: 'SouthAmerica' });
Which would essential be a World map but zoomed in on the center of South America.
You think that would be enough?
Is there a way to buil your js coordinates starting from gps one?
You can now specify scopes such as:
with the latest version.
after commit: https://github.com/markmarkoh/datamaps/commit/5f9ca3b1c70bd3f853442043c7635d75a55cb5db
example at http://datamaps.github.com/#scopes
Great work indeed.
Is this no longer supported in the newest version? It's working fine for scope world and usa, but for other scopes I get this error:
[03:27:49.989] TypeError: a is undefined @ http://localhost:8888/datamaps/datamaps.all.min.js:1
Hi there,
zoom
doesn't appear to be supported anymore?
I'd like to "zoom" in on Africa only.
Will I need to get custom map data or is there some way that is supported out the box?
Never mind, I've just seen the "zoom" branch. Will give it another attempt.
@kylemclaren: you don't need custom map data, but you probably want to take advantage of a custom projection.
For Africa, it'd look something like this:
http://jsbin.com/EjOHuliN/2/edit
You can mess with the scale, center and translation to move it into place.
The zoom branch is outdated, I changed my approach to zooming by exposing more d3 instead of abstracting it (as in, allowing you to specify your projection and all the options).
@markmarkoh Brilliant! Thanks for the quick reply. Let me see what I can make happen...
Hey, how would I get a map centered on Europe?
@ivdekov change your projection to europe:
var projection = d3.geo.equirectangular()
.center([10, 50])
.rotate([4.4, 0])
.scale(1500)
.translate([element.offsetWidth / 2, element.offsetHeight / 2]);
var path = d3.geo.path()
.projection(projection);
Hi All, this is an awesome library and I am using custom map feature of it. I have Senegal Topojson and its not showing in the visual area. I guess I need to set projection correctly, but I am not getting anywhere near to find the values for scale,translate and center. Is there any method to find the values of scale and translate. Thanks
Sorry for the necropost(?), but it appears the additional scopes are not working:
Uncaught TypeError: Cannot read property 'objects' of undefined
@markmarkoh Really appreciated the work you guys have done. But the datamap only supports for World and USA map and no other countries. But I need to use Canada, Brazil maps.
Can you help me how to use the maps of other countries or give me some idea about the map data and rendering, so that I can fix it.
Thanks!
By doing some brain storming in the weekend, able to come up with something. I have created demo files for India, Canada etc which shows bubble map. https://github.com/Anujarya300/bubble_maps.
Thanks @markmarkoh
@Anujarya300 that looks really great. I'd love to have that README available in this project, along with those examples. Feel like sending a pull request?
@markmarkoh, Sure, I'd love to put a pull request.
I notice all zoom examples use hard-coded coordinates. It would be nice if it was possible to get these coordinates from the continent you're zooming in on. This is possible with countries, but I have no idea if this is also possible with continents. You may have to compare all the bounding boxes of all the countries in that continent, take the min and max of that, and then average the min and max.
Impressive work. It would be a hit if it could be extended to other countries.