add setExtent to ol.proj.Projection and make transform ol.geom.Point accept ol.proj.Projection (#9076)

* make transform `ol.geom.Point` accept `ol.proj.Projection`

* transform is described here: http://openlayers.org/en/v3.0.0/apidoc/ol.geom.Point.html#transform
** "Can be a string identifier or a ol.proj.Projection object."

* add `setExtent` to ol.proj.Projection

* setExtent is described here: http://openlayers.org/en/v3.0.0/apidoc/ol.proj.Projection.html#setExtent
** "Type `ol.Extent`"
This commit is contained in:
Christian Beilschmidt
2016-05-06 17:34:08 +09:00
committed by Horiuchi_H
parent 067edc80b9
commit cf059e978e
2 changed files with 9 additions and 1 deletions
+2
View File
@@ -136,6 +136,7 @@ coordinate = geometryResult.getClosestPoint(coordinate);
geometryResult.getClosestPoint(coordinate, coordinate);
extent = geometryResult.getExtent();
geometryResult.getExtent(extent);
geometryResult.transform(projection, projection);
//
//
@@ -337,6 +338,7 @@ var tileLayer: ol.layer.Tile = new ol.layer.Tile({
projection = new ol.proj.Projection({
code:stringValue,
});
projection.setExtent(projection.getExtent());
//
// ol.Map
+7 -1
View File
@@ -2936,7 +2936,7 @@ declare namespace ol {
* @param destination The desired projection. Can be a string identifier or a ol.proj.Projection object.
* @return This geometry. Note that original geometry is modified in place.
*/
transform(source: ol.proj.ProjectionLike, destination: ol.proj.ProjectionLike): ol.geom.Geometry;
transform(source: ol.proj.ProjectionLike | ol.proj.Projection, destination: ol.proj.ProjectionLike | ol.proj.Projection): ol.geom.Geometry;
}
/**
@@ -4054,6 +4054,12 @@ declare namespace ol {
constructor(options: olx.Projection);
getExtent(): Extent;
/**
* Set the validity extent for this projection.
* @param extent The new extent of the projection.
*/
setExtent(extent: Extent): void;
}
}