2

I need to redefine a Web Mercator Projection-like in order to have the projection centered on 180° instead of being centered on 0°.

In order to make this I'm using proj4js

Since the EPSG:3857 projection is defined like this :

proj4.defs("EPSG:3857","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs");

I thought the projection I would like to do would have been defined like below :

proj4.defs("centeredOn180","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=180.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs");

In order to try my new projection, I've been drawing a line between two points around its center

var points = [[-10,0],[10,0]];

The result shown is not what I expect, instead having a line between my points and going through the new origin, the line is instead going in the wrong way.

jsfiddle : http://jsfiddle.net/tlebras/gchhmhd7/2/

What's wrong with my projection? What do I need to fix ?

Thanks a lot

tlebras
  • 185
  • 1
  • 2
  • 16

0 Answers0