Rename sub-sub-namespace typedefs to sub-namespace

These sub-sub-namespace typedefs are only used internally; some of them cause problems by creating a form of circular dependency. For example, ol.style.Atlas is created in style/atlasmanager.js; if ol.style.Atlas.Block is in a separate file, ol.style.Atlas is dependent on it, so the new file must precede ol.style.Atlas. However if it precedes it then it has to create the ol.style.Atlas namespace which should be created by atlasmanager.js. To get round this, these typedefs are renamed to remove the sub-sub-namespace.

Fortunately they are all non-api, so the rename should not affect anything.
This commit is contained in:
Peter Robins
2016-05-07 21:09:48 +00:00
parent a1c86ed560
commit c7aeebed8c
10 changed files with 118 additions and 117 deletions

View File

@@ -129,7 +129,7 @@ ol.interaction.Snap = function(opt_options) {
options.pixelTolerance : 10;
/**
* @type {function(ol.interaction.Snap.SegmentDataType, ol.interaction.Snap.SegmentDataType): number}
* @type {function(ol.interaction.SnapSegmentDataType, ol.interaction.SnapSegmentDataType): number}
* @private
*/
this.sortByDistance_ = ol.interaction.Snap.sortByDistance.bind(this);
@@ -137,7 +137,7 @@ ol.interaction.Snap = function(opt_options) {
/**
* Segment RTree for each layer
* @type {ol.structs.RBush.<ol.interaction.Snap.SegmentDataType>}
* @type {ol.structs.RBush.<ol.interaction.SnapSegmentDataType>}
* @private
*/
this.rBush_ = new ol.structs.RBush();
@@ -378,7 +378,7 @@ ol.interaction.Snap.prototype.shouldStopEvent = ol.functions.FALSE;
* @param {ol.Pixel} pixel Pixel
* @param {ol.Coordinate} pixelCoordinate Coordinate
* @param {ol.Map} map Map.
* @return {ol.interaction.Snap.ResultType} Snap result
* @return {ol.interaction.SnapResultType} Snap result
*/
ol.interaction.Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) {
@@ -437,7 +437,7 @@ ol.interaction.Snap.prototype.snapTo = function(pixel, pixelCoordinate, map) {
vertexPixel = [Math.round(vertexPixel[0]), Math.round(vertexPixel[1])];
}
}
return /** @type {ol.interaction.Snap.ResultType} */ ({
return /** @type {ol.interaction.SnapResultType} */ ({
snapped: snapped,
vertex: vertex,
vertexPixel: vertexPixel
@@ -479,7 +479,7 @@ ol.interaction.Snap.prototype.writeLineStringGeometry_ = function(feature, geome
var i, ii, segment, segmentData;
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.Snap.SegmentDataType} */ ({
segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
feature: feature,
segment: segment
});
@@ -500,7 +500,7 @@ ol.interaction.Snap.prototype.writeMultiLineStringGeometry_ = function(feature,
coordinates = lines[j];
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.Snap.SegmentDataType} */ ({
segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
feature: feature,
segment: segment
});
@@ -520,7 +520,7 @@ ol.interaction.Snap.prototype.writeMultiPointGeometry_ = function(feature, geome
var coordinates, i, ii, segmentData;
for (i = 0, ii = points.length; i < ii; ++i) {
coordinates = points[i];
segmentData = /** @type {ol.interaction.Snap.SegmentDataType} */ ({
segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
feature: feature,
segment: [coordinates, coordinates]
});
@@ -543,7 +543,7 @@ ol.interaction.Snap.prototype.writeMultiPolygonGeometry_ = function(feature, geo
coordinates = rings[j];
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.Snap.SegmentDataType} */ ({
segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
feature: feature,
segment: segment
});
@@ -561,7 +561,7 @@ ol.interaction.Snap.prototype.writeMultiPolygonGeometry_ = function(feature, geo
*/
ol.interaction.Snap.prototype.writePointGeometry_ = function(feature, geometry) {
var coordinates = geometry.getCoordinates();
var segmentData = /** @type {ol.interaction.Snap.SegmentDataType} */ ({
var segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
feature: feature,
segment: [coordinates, coordinates]
});
@@ -581,7 +581,7 @@ ol.interaction.Snap.prototype.writePolygonGeometry_ = function(feature, geometry
coordinates = rings[j];
for (i = 0, ii = coordinates.length - 1; i < ii; ++i) {
segment = coordinates.slice(i, i + 2);
segmentData = /** @type {ol.interaction.Snap.SegmentDataType} */ ({
segmentData = /** @type {ol.interaction.SnapSegmentDataType} */ ({
feature: feature,
segment: segment
});
@@ -626,8 +626,8 @@ ol.interaction.Snap.handleUpEvent_ = function(evt) {
/**
* Sort segments by distance, helper function
* @param {ol.interaction.Snap.SegmentDataType} a The first segment data.
* @param {ol.interaction.Snap.SegmentDataType} b The second segment data.
* @param {ol.interaction.SnapSegmentDataType} a The first segment data.
* @param {ol.interaction.SnapSegmentDataType} b The second segment data.
* @return {number} The difference in distance.
* @this {ol.interaction.Snap}
*/