dev.openlayers.org/releases/OpenLayers-2.7/doc/apidocs/files/OpenLayers/Layer/SphericalMercator-js.html dev.openlayers.org/releases/OpenLayers-2.7/lib/OpenLayers/Layer/SphericalMercator.js
20037508.34
18 19 20 21 22 23 24
# File 'lib/merc_convert.rb', line 18 def forward(lon, lat) x = lon * MAXEXTENT / 180 y = log(tan((90+lat) * PI / 360)) / (PI / 180) y = y * MAXEXTENT / 180 [x, y] end
10 11 12 13 14 15 16
# File 'lib/merc_convert.rb', line 10 def inverse(x, y) lon = (x / MAXEXTENT) * 180 lat = (y / MAXEXTENT) * 180 lat = 180/PI * (2 * atan(exp(lat * PI / 180)) - PI / 2) [lon, lat] end