Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kartograph.js #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

slaweet
Copy link

@slaweet slaweet commented May 29, 2015

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