Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Russia is on both side of the map #208

Closed
YanivBord opened this issue Jun 29, 2015 · 4 comments
Closed

Russia is on both side of the map #208

YanivBord opened this issue Jun 29, 2015 · 4 comments

Comments

@YanivBord
Copy link

image

Hi, as you can see in my attached photo, Russia in on both sides of the map.
Sorry if this is a noob question...

Just started to learn :D

Thanks,

Merdok

@Downchuck
Copy link

That's a fairly typical representation.

@justmarkup
Copy link
Collaborator

As @Downchuck said this is a common pattern.

You can change the center position of the map if you like, eg to start with Alaska, not Russia on the very left you can use:

var map = new Datamap({
    element: document.getElementById('container'),
    setProjection: function(element) {
        var projection = d3.geo.equirectangular().center([14, 0]);
        var path = d3.geo.path().projection(projection);

        return {path: path, projection: projection};
    }
});

Hope this helps.

@markmarkoh
Copy link
Owner

Closing since @justmarkup provided a workaround

@abhickbiswas
Copy link

I hope this will be of some help for people coming around with this issue. The solution will be
var width = document.getElementById('map').offsetWidth; var height = width; // render map var map = new Datamap({ element: document.getElementById('map'), //projection: "mercator", setProjection: function(element) { var projection = d3.geo.mercator().translate([(width/2), (height/2)]).scale( width / 2 / Math.PI).rotate([-11,0]); //d3.geo.mercator().center([10,60]).scale(100); var path = d3.geo.path().projection(projection); return {path: path, projection: projection}; } });
screen shot 2017-03-23 at 1 15 11 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants