Rename projection functions for a friendlier API

The following functions are renamed:

getTransform -> getTransformForProjections
getTransformFromCodes -> getTransform
transform -> transformWithProjections
transformWithCodes -> transform

With this change, the faster functions that avoid projection look-up
have longer names and are used internally, whereas the slower but
friendlier short name functions are available for users.
This commit is contained in:
Tom Payne
2013-03-06 19:41:27 +01:00
parent 874583656e
commit 21d34f1cc8
18 changed files with 84 additions and 86 deletions

View File

@@ -25,7 +25,7 @@ var map = new ol.Map({
// Vienna label
var vienna = new ol.AnchoredElement({
map: map,
position: ol.projection.transformWithCodes(
position: ol.projection.transform(
new ol.Coordinate(16.3725, 48.208889), 'EPSG:4326', 'EPSG:3857'),
element: document.getElementById('vienna')
});
@@ -39,7 +39,7 @@ map.addEventListener('click', function(evt) {
var coordinate = evt.getCoordinate();
popup.getElement().innerHTML =
'Welcome to ol3. The location you clicked was<br>' +
ol.Coordinate.toStringHDMS(ol.projection.transformWithCodes(
ol.Coordinate.toStringHDMS(ol.projection.transform(
coordinate, 'EPSG:3857', 'EPSG:4326'));
popup.setPosition(coordinate);
});