Add missing goog.requires; fix types and a typo

This commit is contained in:
ahocevar
2014-03-30 16:59:22 +02:00
parent 2cb045b0b3
commit 523b51d69a
2 changed files with 10 additions and 6 deletions

View File

@@ -487,9 +487,9 @@
/**
* @typedef {Object} olx.interaction.ModifyOptions
* @property {ol.events.ConditionType} deleteCondition Condition that determines
* which event results in a vertex deletion. Default is a `singleclick`
* event with no modifier keys.
* @property {ol.events.ConditionType|undefined} deleteCondition Condition that
* determines which event results in a vertex deletion. Default is a
* `singleclick` event with no modifier keys.
* @property {number|undefined} pixelTolerance Pixel tolerance for considering
* the pointer close enough to a segment or vertex for editing. Default is
* 10 pixels.

View File

@@ -3,6 +3,7 @@ goog.provide('ol.interaction.Modify');
goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.events');
goog.require('goog.functions');
goog.require('ol.Collection');
goog.require('ol.CollectionEventType');
goog.require('ol.Feature');
@@ -50,8 +51,10 @@ ol.interaction.Modify = function(options) {
* @private
*/
this.deleteCondition_ = goog.isDef(options.deleteCondition) ?
options.pixelTolerance : goog.functions.and(
ol.events.condition.noModifierKeys, ol.events.condition.singleClick);
options.deleteCondition :
/** @type {ol.events.ConditionType} */ (goog.functions.and(
ol.events.condition.noModifierKeys,
ol.events.condition.singleClick));
/**
* Editing vertex.
@@ -643,7 +646,8 @@ ol.interaction.Modify.prototype.insertVertex_ = function(segmentData, vertex) {
ol.interaction.Modify.prototype.removeVertex_ = function() {
var dragSegments = this.dragSegments_;
var segmentsByFeature = {};
var component, coordinates, deleted, dragSegment, geometry, i, index, left;
var deleted = false;
var component, coordinates, dragSegment, geometry, i, index, left;
var newIndex, newSegment, right, segmentData, uid;
for (i = dragSegments.length - 1; i >= 0; --i) {
dragSegment = dragSegments[i];