"use strict";
var ol = require('openlayers');
var ProjectionService = (function () {
function ProjectionService(ol, proj4) {
this.ol = ol;
this.proj4 = proj4;
this['EPSG:27700'] = this.createEPSG27700();
}
ProjectionService.prototype.createEPSG27700 = function () {
this.proj4.defs("EPSG:27700", "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894 +datum=OSGB36 +units=m +no_defs");
function returnSameCoords(coord) {
return [coord[0], coord[1]];
}
this.ol.proj.addCoordinateTransforms('EPSG:27700', 'EPSG:27700', returnSameCoords, returnSameCoords);
return new ol.proj.Projection({
code: 'EPSG:27700',
extent: [-238375.0, 0, 700000, 1300000],
units: 'm'
});
};
return ProjectionService;
}());
exports.ProjectionService = ProjectionService;
var ProjectionServiceProvider = (function () {
function ProjectionServiceProvider() {
this.$get = ['ol', 'proj4', function (ol, proj4) {
return new ProjectionService(ol, proj4);
}];
}
return ProjectionServiceProvider;
}());
exports.ProjectionServiceProvider = ProjectionServiceProvider;
|