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

Part of Russia is coming to the left of America #535

Open
sirishan21 opened this issue Oct 8, 2021 · 1 comment
Open

Part of Russia is coming to the left of America #535

sirishan21 opened this issue Oct 8, 2021 · 1 comment

Comments

@sirishan21
Copy link

const map = new DataMap({ element: document.getElementById("WorldMap"), projection: "mercator", // big world map // width: 1000, // height: 800, fills: { defaultFill: "#E6E6FA" }, data: dataset, highlightBorderColor: "#B7B7B7", highlightFillColor: "#FFFF00", responsive: true, geographyConfig: { popupTemplate: function (geo, data) { if (data) { return [ '<div ><strong>', "Number of interactions in " + geo.properties.name, ": " + data.numberOfThings, "</strong></div>", ].join(""); } else { return [ '<div ><strong>', "Number of interactions in " + geo.properties.name, ": " + 0, "</strong></div>", ].join(""); } }, }, });

Could you help in fixing this?

@KevinPayravi
Copy link

KevinPayravi commented Jun 11, 2023

I know this issue is 2 years old, but I'll respond in case anyone needs help with this.

See this issue and its responses: #208

You can define a custom projection with a [-11, 0] rotation that moves the map so that Russia is entirely on the right.

Will look something like this:

setProjection: function (element) {
    let projection = d3.geo.mercator().rotate([-11, 0]);
    let path = d3.geo.path().projection(projection);

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

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

2 participants