Support OGC WKT proj4 def.units and def.to_meter

This commit is contained in:
Torben Barsbsballe
2015-10-06 15:57:01 -07:00
parent da830a7670
commit 7cefe56167
3 changed files with 30 additions and 3 deletions

View File

@@ -153,8 +153,9 @@ ol.proj.Projection = function(options) {
}
if (options.units === undefined) {
var units = def.units;
if (units === undefined) {
if (def.to_meter !== undefined) {
if (def.to_meter !== undefined) {
if (units === undefined ||
ol.proj.METERS_PER_UNIT[units] === undefined) {
units = def.to_meter.toString();
ol.proj.METERS_PER_UNIT[units] = def.to_meter;
}