Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow cursors to be used as iterators.

  • Loading branch information...
commit 8cd4f3ba784377756777e1c1d064e5fd6aa2eea7 1 parent d8a56e6
@tschaub authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/geoscript/cursor.js
View
11 lib/geoscript/cursor.js
@@ -221,4 +221,15 @@ var Cursor = UTIL.extend(GeoObject, {
});
+/**
+ * Allow cursors to be used as iterators.
+ */
+Cursor.prototype.__iterator__ = function() {
+ var feature;
+ while (feature = this.next()) {
+ yield feature;
+ }
+ return;
+};
+
exports.Cursor = Cursor;
Please sign in to comment.
Something went wrong with that request. Please try again.