-1

I would like to change the projection of the map to be more flat for the user
I have tried setting the projection to d3.geoIdentity() it worked but it's not "flat enough" And when i try to change to d3.geoAlbers() it gives errors and by using other methods it either giving me errors of null path values or it's working but with a roundish map here's the chunk of code that matters since the rest of the code including the json file all good what i would like is to set the projection in a way to have the map displayed as the map of USA

[this is what i would like the projection to be

 var geojson = topojson.feature(dz, dz.objects.DZA_adm1)
 var projection = d3.geoIdentity()
    .reflectY(true)
    .fitSize([width, height * 2/3],geojson)
const path = d3.geoPath().projection(projection)

[this is what i'm getting]2

Harvester Haidar
  • 531
  • 7
  • 16
  • Is there a comparison image of Algeria that you want to emulate, I'm not clear on what you mean by "flat enough". It's difficult to compare with the US Albers, which also gives the US a bit of a curve (as seen on the northern border which is largely "straight" along a parallel), as it is a conical projection, which could also be giving you your "roundish" map too. – Andrew Reid Apr 11 '20 at 18:13
  • i wish i had a good comparison image , the problem is that the northern cities on the Algerian map are way to small and far to click on , it's like as if the north part of the map is deep in Z dimension – Harvester Haidar Apr 11 '20 at 18:23

1 Answers1

0

Projection finally works!

so the topojson file (json file of the map) was actually wrong Thank to mapstarter tool i found online , i could try a few projection options they provide , i reshaped the json file using mapshaper and now it works good

Harvester Haidar
  • 531
  • 7
  • 16