Atlaslog
Atlaslog / OpenLayers / Tutorial / Projections and coordinate systems
OpenLayers · Tutorial

Projections and coordinate systems

Quick answer

This tutorial treats projection as the main entry barrier in OpenLayers and reconciles the four places coordinates appear: view, features, services and pointer events. It explains EPSG:3857 extents, ol.proj.fromLonLat and toLonLat, dataProjection versus featureProjection in ol.format.GeoJSON, and registering proj4 definitions for EPSG:4490 and EPSG:4547. It also derives resolution from zoom and computes ol.sphere.getLength and getArea. Readers can keep every coordinate in one projection.

Last verified 2026-11-03 · OpenLayers 10.3.1 · Cite this page
Key points
Example
var center = ol.proj.fromLonLat([116.391263, 39.907359]);
var lonlat = ol.proj.toLonLat(evt.coordinate);
var center = ol.proj.fromLonLat([116.39, 39.90], 'EPSG:4490');
Notes
Runnable examplesChinese originalAll Tutorials
English edition written for Atlaslog. Code is taken from the original Chinese page and runs unchanged.
Cite this page

Atlaslog (2026). Projections and coordinate systems. https://www.jingweizhi.com/en/openlayers/tutorials/projection.html (accessed 2026-11-03).