title: Equirectangular map on Web
body: <p>I plan to build an online map for markers (pins) of a game and I don't manage to set the correct latitude of my markers.</p>
  
  <p>Original map is a <strong>square of 2048*2048px</strong></p>
  
  <p>Then I got markers (many thousands)</p>
  
  <p>Map coordinates are set with a x, y notation from 0 to 100.
  0, 0 is the <strong>top left</strong> corner and 100, 100 is the <strong>bottom right</strong> corner of the map.
  x=50, y=50 is lat = 0°, lng = 0° (the center of the picture).</p>
  
  <p>To convert from my notation to longitude I use this JS function, it works well :</p>
  
  <pre><code>        function longitude(x)
          {
              var lng = 0
              if (x &lt; 50) // Negative Longitude (West)
              {
                  lng = (x - 50) / 50 * 180;
              }
              else // Positive Longitude (East)
              {
                  lng = (50 - x) / 50 * 180;
              }
              return lng
          }
  </code></pre>
  
  <p>But for latitude it don't work because those engines use a Mercator projection and me not.</p>
  
  <p>If someone have the correct formula, it would be greatly appreciated :(</p>