Skip to content

Update kartograph.js#70

Open
slaweet wants to merge 1 commit into
kartograph:masterfrom
adaptive-learning:null-list
Open

Update kartograph.js#70
slaweet wants to merge 1 commit into
kartograph:masterfrom
adaptive-learning:null-list

Conversation

@slaweet

@slaweet slaweet commented May 29, 2015

Copy link
Copy Markdown

I'm using this fix to make kartograph.js work in our app. Other wise it crashes with

Uncaught TypeError: Cannot read property 'length' of null

the null is contours in

 Path = (function() {
    /*
        represents complex polygons (aka multi-polygons)
    */
    function Path(type, contours, closed) {
      var cnt, self, _i, _len;

      if (closed == null) {
        closed = true;
      }
      self = this;
      self.type = type;
      self.contours = [];
      for (_i = 0, _len = contours.length; _i < _len; _i++) {
        cnt = contours[_i];
        if (!__is_clockwise(cnt)) {
          cnt.reverse();
        }
        self.contours.push(cnt);
      }
      self.closed = closed;
    }

I suppose I should make a pull request with changes in your *.coffee source files, but I don't know how to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants