PageRenderTime 298ms CodeModel.GetById 81ms app.highlight 142ms RepoModel.GetById 18ms app.codeStats 4ms

/www/js/angular-google-maps.js

https://github.com/IBM-Bluemix/bluemix-retail
JavaScript | 8131 lines | 5539 code | 912 blank | 1680 comment | 1237 complexity | f181de0b80499e1d68469cc3f32e2b3c MD5 | raw file

Large files files are truncated, but you can click here to view the full file

   1/*! angular-google-maps 1.1.1-SNAPSHOT 2014-05-26
   2 *  AngularJS directives for Google Maps
   3 *  git: https://github.com/nlaplante/angular-google-maps.git
   4 */
   5/*
   6!
   7The MIT License
   8
   9Copyright (c) 2010-2013 Google, Inc. http://angularjs.org
  10
  11Permission is hereby granted, free of charge, to any person obtaining a copy
  12of this software and associated documentation files (the "Software"), to deal
  13in the Software without restriction, including without limitation the rights
  14to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  15copies of the Software, and to permit persons to whom the Software is
  16furnished to do so, subject to the following conditions:
  17
  18The above copyright notice and this permission notice shall be included in
  19all copies or substantial portions of the Software.
  20
  21THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  22IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  23FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  24AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  25LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  26OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  27THE SOFTWARE.
  28
  29angular-google-maps
  30https://github.com/nlaplante/angular-google-maps
  31
  32@authors
  33Nicolas Laplante - https://plus.google.com/108189012221374960701
  34Nicholas McCready - https://twitter.com/nmccready
  35*/
  36
  37
  38(function() {
  39  angular.module("google-maps.directives.api.utils", []);
  40
  41  angular.module("google-maps.directives.api.managers", []);
  42
  43  angular.module("google-maps.directives.api.models.child", ["google-maps.directives.api.utils"]);
  44
  45  angular.module("google-maps.directives.api.models.parent", ["google-maps.directives.api.managers", "google-maps.directives.api.models.child"]);
  46
  47  angular.module("google-maps.directives.api", ["google-maps.directives.api.models.parent"]);
  48
  49  angular.module("google-maps", ["google-maps.directives.api"]).factory("debounce", [
  50    "$timeout", function($timeout) {
  51      return function(fn) {
  52        var nthCall;
  53        nthCall = 0;
  54        return function() {
  55          var argz, later, that;
  56          that = this;
  57          argz = arguments;
  58          nthCall++;
  59          later = (function(version) {
  60            return function() {
  61              if (version === nthCall) {
  62                return fn.apply(that, argz);
  63              }
  64            };
  65          })(nthCall);
  66          return $timeout(later, 0, true);
  67        };
  68      };
  69    }
  70  ]);
  71
  72}).call(this);
  73
  74(function() {
  75  angular.element(document).ready(function() {
  76    if (!(google || (typeof google !== "undefined" && google !== null ? google.maps : void 0) || (google.maps.InfoWindow != null))) {
  77      return;
  78    }
  79    google.maps.InfoWindow.prototype._open = google.maps.InfoWindow.prototype.open;
  80    google.maps.InfoWindow.prototype._close = google.maps.InfoWindow.prototype.close;
  81    google.maps.InfoWindow.prototype._isOpen = false;
  82    google.maps.InfoWindow.prototype.open = function(map, anchor) {
  83      this._isOpen = true;
  84      this._open(map, anchor);
  85    };
  86    google.maps.InfoWindow.prototype.close = function() {
  87      this._isOpen = false;
  88      this._close();
  89    };
  90    google.maps.InfoWindow.prototype.isOpen = function(val) {
  91      if (val == null) {
  92        val = void 0;
  93      }
  94      if (val == null) {
  95        return this._isOpen;
  96      } else {
  97        return this._isOpen = val;
  98      }
  99    };
 100    /*
 101    Do the same for InfoBox
 102    TODO: Clean this up so the logic is defined once, wait until develop becomes master as this will be easier
 103    */
 104
 105    if (!window.InfoBox) {
 106      return;
 107    }
 108    window.InfoBox.prototype._open = window.InfoBox.prototype.open;
 109    window.InfoBox.prototype._close = window.InfoBox.prototype.close;
 110    window.InfoBox.prototype._isOpen = false;
 111    window.InfoBox.prototype.open = function(map, anchor) {
 112      this._isOpen = true;
 113      this._open(map, anchor);
 114    };
 115    window.InfoBox.prototype.close = function() {
 116      this._isOpen = false;
 117      this._close();
 118    };
 119    return window.InfoBox.prototype.isOpen = function(val) {
 120      if (val == null) {
 121        val = void 0;
 122      }
 123      if (val == null) {
 124        return this._isOpen;
 125      } else {
 126        return this._isOpen = val;
 127      }
 128    };
 129  });
 130
 131}).call(this);
 132
 133/*
 134    Author Nick McCready
 135    Intersection of Objects if the arrays have something in common each intersecting object will be returned
 136    in an new array.
 137*/
 138
 139
 140(function() {
 141  _.intersectionObjects = function(array1, array2, comparison) {
 142    var res,
 143      _this = this;
 144    if (comparison == null) {
 145      comparison = void 0;
 146    }
 147    res = _.map(array1, function(obj1) {
 148      return _.find(array2, function(obj2) {
 149        if (comparison != null) {
 150          return comparison(obj1, obj2);
 151        } else {
 152          return _.isEqual(obj1, obj2);
 153        }
 154      });
 155    });
 156    return _.filter(res, function(o) {
 157      return o != null;
 158    });
 159  };
 160
 161  _.containsObject = _.includeObject = function(obj, target, comparison) {
 162    var _this = this;
 163    if (comparison == null) {
 164      comparison = void 0;
 165    }
 166    if (obj === null) {
 167      return false;
 168    }
 169    return _.any(obj, function(value) {
 170      if (comparison != null) {
 171        return comparison(value, target);
 172      } else {
 173        return _.isEqual(value, target);
 174      }
 175    });
 176  };
 177
 178  _.differenceObjects = function(array1, array2, comparison) {
 179    if (comparison == null) {
 180      comparison = void 0;
 181    }
 182    return _.filter(array1, function(value) {
 183      return !_.containsObject(array2, value);
 184    });
 185  };
 186
 187  _.withoutObjects = function(array, array2) {
 188    return _.differenceObjects(array, array2);
 189  };
 190
 191  _.indexOfObject = function(array, item, comparison, isSorted) {
 192    var i, length;
 193    if (array == null) {
 194      return -1;
 195    }
 196    i = 0;
 197    length = array.length;
 198    if (isSorted) {
 199      if (typeof isSorted === "number") {
 200        i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted);
 201      } else {
 202        i = _.sortedIndex(array, item);
 203        return (array[i] === item ? i : -1);
 204      }
 205    }
 206    while (i < length) {
 207      if (comparison != null) {
 208        if (comparison(array[i], item)) {
 209          return i;
 210        }
 211      } else {
 212        if (_.isEqual(array[i], item)) {
 213          return i;
 214        }
 215      }
 216      i++;
 217    }
 218    return -1;
 219  };
 220
 221  _["extends"] = function(arrayOfObjectsToCombine) {
 222    return _.reduce(arrayOfObjectsToCombine, function(combined, toAdd) {
 223      return _.extend(combined, toAdd);
 224    }, {});
 225  };
 226
 227}).call(this);
 228
 229/*
 230    Author: Nicholas McCready & jfriend00
 231    _async handles things asynchronous-like :), to allow the UI to be free'd to do other things
 232    Code taken from http://stackoverflow.com/questions/10344498/best-way-to-iterate-over-an-array-without-blocking-the-ui
 233
 234    The design of any funcitonality of _async is to be like lodash/underscore and replicate it but call things
 235    asynchronously underneath. Each should be sufficient for most things to be derrived from.
 236
 237    TODO: Handle Object iteration like underscore and lodash as well.. not that important right now
 238*/
 239
 240
 241(function() {
 242  var async;
 243
 244  async = {
 245    each: function(array, callback, doneCallBack, pausedCallBack, chunk, index, pause) {
 246      var doChunk;
 247      if (chunk == null) {
 248        chunk = 20;
 249      }
 250      if (index == null) {
 251        index = 0;
 252      }
 253      if (pause == null) {
 254        pause = 1;
 255      }
 256      if (!pause) {
 257        throw "pause (delay) must be set from _async!";
 258        return;
 259      }
 260      if (array === void 0 || (array != null ? array.length : void 0) <= 0) {
 261        doneCallBack();
 262        return;
 263      }
 264      doChunk = function() {
 265        var cnt, i;
 266        cnt = chunk;
 267        i = index;
 268        while (cnt-- && i < (array ? array.length : i + 1)) {
 269          callback(array[i], i);
 270          ++i;
 271        }
 272        if (array) {
 273          if (i < array.length) {
 274            index = i;
 275            if (pausedCallBack != null) {
 276              pausedCallBack();
 277            }
 278            return setTimeout(doChunk, pause);
 279          } else {
 280            if (doneCallBack) {
 281              return doneCallBack();
 282            }
 283          }
 284        }
 285      };
 286      return doChunk();
 287    },
 288    map: function(objs, iterator, doneCallBack, pausedCallBack, chunk) {
 289      var results;
 290      results = [];
 291      if (objs == null) {
 292        return results;
 293      }
 294      return _async.each(objs, function(o) {
 295        return results.push(iterator(o));
 296      }, function() {
 297        return doneCallBack(results);
 298      }, pausedCallBack, chunk);
 299    }
 300  };
 301
 302  window._async = async;
 303
 304  angular.module("google-maps.directives.api.utils").factory("async", function() {
 305    return window._async;
 306  });
 307
 308}).call(this);
 309
 310(function() {
 311  var __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
 312
 313  angular.module("google-maps.directives.api.utils").factory("BaseObject", function() {
 314    var BaseObject, baseObjectKeywords;
 315    baseObjectKeywords = ['extended', 'included'];
 316    BaseObject = (function() {
 317      function BaseObject() {}
 318
 319      BaseObject.extend = function(obj) {
 320        var key, value, _ref;
 321        for (key in obj) {
 322          value = obj[key];
 323          if (__indexOf.call(baseObjectKeywords, key) < 0) {
 324            this[key] = value;
 325          }
 326        }
 327        if ((_ref = obj.extended) != null) {
 328          _ref.apply(this);
 329        }
 330        return this;
 331      };
 332
 333      BaseObject.include = function(obj) {
 334        var key, value, _ref;
 335        for (key in obj) {
 336          value = obj[key];
 337          if (__indexOf.call(baseObjectKeywords, key) < 0) {
 338            this.prototype[key] = value;
 339          }
 340        }
 341        if ((_ref = obj.included) != null) {
 342          _ref.apply(this);
 343        }
 344        return this;
 345      };
 346
 347      return BaseObject;
 348
 349    })();
 350    return BaseObject;
 351  });
 352
 353}).call(this);
 354
 355/*
 356    Useful function callbacks that should be defined at later time.
 357    Mainly to be used for specs to verify creation / linking.
 358
 359    This is to lead a common design in notifying child stuff.
 360*/
 361
 362
 363(function() {
 364  angular.module("google-maps.directives.api.utils").factory("ChildEvents", function() {
 365    return {
 366      onChildCreation: function(child) {}
 367    };
 368  });
 369
 370}).call(this);
 371
 372(function() {
 373  var __hasProp = {}.hasOwnProperty,
 374    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
 375
 376  angular.module("google-maps.directives.api.utils").factory("FitHelper", [
 377    "BaseObject", "Logger", function(BaseObject, $log) {
 378      var FitHelper, _ref;
 379      return FitHelper = (function(_super) {
 380        __extends(FitHelper, _super);
 381
 382        function FitHelper() {
 383          _ref = FitHelper.__super__.constructor.apply(this, arguments);
 384          return _ref;
 385        }
 386
 387        FitHelper.prototype.fit = function(gMarkers, gMap) {
 388          var bounds, everSet,
 389            _this = this;
 390          if (gMap && gMarkers && gMarkers.length > 0) {
 391            bounds = new google.maps.LatLngBounds();
 392            everSet = false;
 393            return _async.each(gMarkers, function(gMarker) {
 394              if (gMarker) {
 395                if (!everSet) {
 396                  everSet = true;
 397                }
 398                return bounds.extend(gMarker.getPosition());
 399              }
 400            }, function() {
 401              if (everSet) {
 402                return gMap.fitBounds(bounds);
 403              }
 404            });
 405          }
 406        };
 407
 408        return FitHelper;
 409
 410      })(BaseObject);
 411    }
 412  ]);
 413
 414}).call(this);
 415
 416(function() {
 417  angular.module("google-maps.directives.api.utils").service("GmapUtil", [
 418    "Logger", "$compile", function(Logger, $compile) {
 419      var getCoords, validateCoords;
 420      getCoords = function(value) {
 421        if (Array.isArray(value) && value.length === 2) {
 422          return new google.maps.LatLng(value[1], value[0]);
 423        } else if (angular.isDefined(value.type) && value.type === "Point") {
 424          return new google.maps.LatLng(value.coordinates[1], value.coordinates[0]);
 425        } else {
 426          return new google.maps.LatLng(value.latitude, value.longitude);
 427        }
 428      };
 429      validateCoords = function(coords) {
 430        if (angular.isUndefined(coords)) {
 431          return false;
 432        }
 433        if (_.isArray(coords)) {
 434          if (coords.length === 2) {
 435            return true;
 436          }
 437        } else if ((coords != null) && (coords != null ? coords.type : void 0)) {
 438          if (coords.type === "Point" && _.isArray(coords.coordinates) && coords.coordinates.length === 2) {
 439            return true;
 440          }
 441        } else {
 442          if (coords && angular.isDefined((coords != null ? coords.latitude : void 0) && angular.isDefined(coords != null ? coords.longitude : void 0))) {
 443            return true;
 444          }
 445        }
 446        return false;
 447      };
 448      return {
 449        getLabelPositionPoint: function(anchor) {
 450          var xPos, yPos;
 451          if (anchor === void 0) {
 452            return void 0;
 453          }
 454          anchor = /^([-\d\.]+)\s([-\d\.]+)$/.exec(anchor);
 455          xPos = parseFloat(anchor[1]);
 456          yPos = parseFloat(anchor[2]);
 457          if ((xPos != null) && (yPos != null)) {
 458            return new google.maps.Point(xPos, yPos);
 459          }
 460        },
 461        createMarkerOptions: function(coords, icon, defaults, map) {
 462          var opts;
 463          if (map == null) {
 464            map = void 0;
 465          }
 466          if (defaults == null) {
 467            defaults = {};
 468          }
 469          opts = angular.extend({}, defaults, {
 470            position: defaults.position != null ? defaults.position : getCoords(coords),
 471            icon: defaults.icon != null ? defaults.icon : icon,
 472            visible: defaults.visible != null ? defaults.visible : validateCoords(coords)
 473          });
 474          if (map != null) {
 475            opts.map = map;
 476          }
 477          return opts;
 478        },
 479        createWindowOptions: function(gMarker, scope, content, defaults) {
 480          if ((content != null) && (defaults != null) && ($compile != null)) {
 481            return angular.extend({}, defaults, {
 482              content: this.buildContent(scope, defaults, content),
 483              position: defaults.position != null ? defaults.position : angular.isObject(gMarker) ? gMarker.getPosition() : getCoords(scope.coords)
 484            });
 485          } else {
 486            if (!defaults) {
 487              Logger.error("infoWindow defaults not defined");
 488              if (!content) {
 489                return Logger.error("infoWindow content not defined");
 490              }
 491            } else {
 492              return defaults;
 493            }
 494          }
 495        },
 496        buildContent: function(scope, defaults, content) {
 497          var parsed, ret;
 498          if (defaults.content != null) {
 499            ret = defaults.content;
 500          } else {
 501            if ($compile != null) {
 502              parsed = $compile(content)(scope);
 503              if (parsed.length > 0) {
 504                ret = parsed[0];
 505              }
 506            } else {
 507              ret = content;
 508            }
 509          }
 510          return ret;
 511        },
 512        defaultDelay: 50,
 513        isTrue: function(val) {
 514          return angular.isDefined(val) && val !== null && val === true || val === "1" || val === "y" || val === "true";
 515        },
 516        isFalse: function(value) {
 517          return ['false', 'FALSE', 0, 'n', 'N', 'no', 'NO'].indexOf(value) !== -1;
 518        },
 519        getCoords: getCoords,
 520        validateCoords: validateCoords,
 521        validatePath: function(path) {
 522          var array, i;
 523          i = 0;
 524          if (angular.isUndefined(path.type)) {
 525            if (!Array.isArray(path) || path.length < 2) {
 526              return false;
 527            }
 528            while (i < path.length) {
 529              if (!((angular.isDefined(path[i].latitude) && angular.isDefined(path[i].longitude)) || (typeof path[i].lat === "function" && typeof path[i].lng === "function"))) {
 530                return false;
 531              }
 532              i++;
 533            }
 534            return true;
 535          } else {
 536            if (angular.isUndefined(path.coordinates)) {
 537              return false;
 538            }
 539            if (path.type === "Polygon") {
 540              if (path.coordinates[0].length < 4) {
 541                return false;
 542              }
 543              array = path.coordinates[0];
 544            } else if (path.type === "LineString") {
 545              if (path.coordinates.length < 2) {
 546                return false;
 547              }
 548              array = path.coordinates;
 549            } else {
 550              return false;
 551            }
 552            while (i < array.length) {
 553              if (array[i].length !== 2) {
 554                return false;
 555              }
 556              i++;
 557            }
 558            return true;
 559          }
 560        },
 561        convertPathPoints: function(path) {
 562          var array, i, latlng, result;
 563          i = 0;
 564          result = new google.maps.MVCArray();
 565          if (angular.isUndefined(path.type)) {
 566            while (i < path.length) {
 567              latlng;
 568              if (angular.isDefined(path[i].latitude) && angular.isDefined(path[i].longitude)) {
 569                latlng = new google.maps.LatLng(path[i].latitude, path[i].longitude);
 570              } else if (typeof path[i].lat === "function" && typeof path[i].lng === "function") {
 571                latlng = path[i];
 572              }
 573              result.push(latlng);
 574              i++;
 575            }
 576          } else {
 577            array;
 578            if (path.type === "Polygon") {
 579              array = path.coordinates[0];
 580            } else if (path.type === "LineString") {
 581              array = path.coordinates;
 582            }
 583            while (i < array.length) {
 584              result.push(new google.maps.LatLng(array[i][1], array[i][0]));
 585              i++;
 586            }
 587          }
 588          return result;
 589        },
 590        extendMapBounds: function(map, points) {
 591          var bounds, i;
 592          bounds = new google.maps.LatLngBounds();
 593          i = 0;
 594          while (i < points.length) {
 595            bounds.extend(points.getAt(i));
 596            i++;
 597          }
 598          return map.fitBounds(bounds);
 599        }
 600      };
 601    }
 602  ]);
 603
 604}).call(this);
 605
 606(function() {
 607  var __hasProp = {}.hasOwnProperty,
 608    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
 609
 610  angular.module("google-maps.directives.api.utils").factory("Linked", [
 611    "BaseObject", function(BaseObject) {
 612      var Linked;
 613      Linked = (function(_super) {
 614        __extends(Linked, _super);
 615
 616        function Linked(scope, element, attrs, ctrls) {
 617          this.scope = scope;
 618          this.element = element;
 619          this.attrs = attrs;
 620          this.ctrls = ctrls;
 621        }
 622
 623        return Linked;
 624
 625      })(BaseObject);
 626      return Linked;
 627    }
 628  ]);
 629
 630}).call(this);
 631
 632(function() {
 633  angular.module("google-maps.directives.api.utils").service("Logger", [
 634    "$log", function($log) {
 635      return {
 636        logger: $log,
 637        doLog: false,
 638        info: function(msg) {
 639          if (this.doLog) {
 640            if (this.logger != null) {
 641              return this.logger.info(msg);
 642            } else {
 643              return console.info(msg);
 644            }
 645          }
 646        },
 647        error: function(msg) {
 648          if (this.doLog) {
 649            if (this.logger != null) {
 650              return this.logger.error(msg);
 651            } else {
 652              return console.error(msg);
 653            }
 654          }
 655        },
 656        warn: function(msg) {
 657          if (this.doLog) {
 658            if (this.logger != null) {
 659              return this.logger.warn(msg);
 660            } else {
 661              return console.warn(msg);
 662            }
 663          }
 664        }
 665      };
 666    }
 667  ]);
 668
 669}).call(this);
 670
 671(function() {
 672  angular.module("google-maps.directives.api.utils").service("MarkerEventHelper", [
 673    "Logger", function($log) {
 674      return {
 675        setEvents: function(marker, scope, model) {
 676          if (angular.isDefined(scope.events) && (scope.events != null) && angular.isObject(scope.events)) {
 677            return _.compact(_.map(scope.events, function(eventHandler, eventName) {
 678              if (scope.events.hasOwnProperty(eventName) && angular.isFunction(scope.events[eventName])) {
 679                return google.maps.event.addListener(marker, eventName, function() {
 680                  return eventHandler.apply(scope, [marker, eventName, model, arguments]);
 681                });
 682              } else {
 683                return $log.info("MarkerEventHelper: invalid event listener " + eventName);
 684              }
 685            }));
 686          }
 687        }
 688      };
 689    }
 690  ]);
 691
 692}).call(this);
 693
 694(function() {
 695  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
 696    __hasProp = {}.hasOwnProperty,
 697    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
 698
 699  angular.module("google-maps.directives.api.utils").factory("ModelKey", [
 700    "BaseObject", function(BaseObject) {
 701      var ModelKey;
 702      return ModelKey = (function(_super) {
 703        __extends(ModelKey, _super);
 704
 705        function ModelKey(scope) {
 706          this.scope = scope;
 707          this.setIdKey = __bind(this.setIdKey, this);
 708          this.modelKeyComparison = __bind(this.modelKeyComparison, this);
 709          ModelKey.__super__.constructor.call(this);
 710          this.defaultIdKey = "id";
 711          this.idKey = void 0;
 712        }
 713
 714        ModelKey.prototype.evalModelHandle = function(model, modelKey) {
 715          if (model === void 0) {
 716            return void 0;
 717          }
 718          if (modelKey === 'self') {
 719            return model;
 720          } else {
 721            return model[modelKey];
 722          }
 723        };
 724
 725        ModelKey.prototype.modelKeyComparison = function(model1, model2) {
 726          var scope;
 727          scope = this.scope.coords != null ? this.scope : this.parentScope;
 728          if (scope == null) {
 729            throw "No scope or parentScope set!";
 730          }
 731          return this.evalModelHandle(model1, scope.coords).latitude === this.evalModelHandle(model2, scope.coords).latitude && this.evalModelHandle(model1, scope.coords).longitude === this.evalModelHandle(model2, scope.coords).longitude;
 732        };
 733
 734        ModelKey.prototype.setIdKey = function(scope) {
 735          return this.idKey = scope.idKey != null ? scope.idKey : this.defaultIdKey;
 736        };
 737
 738        return ModelKey;
 739
 740      })(BaseObject);
 741    }
 742  ]);
 743
 744}).call(this);
 745
 746(function() {
 747  angular.module("google-maps.directives.api.utils").factory("ModelsWatcher", [
 748    "Logger", function(Logger) {
 749      return {
 750        figureOutState: function(idKey, scope, childObjects, comparison, callBack) {
 751          var adds, mappedScopeModelIds, removals,
 752            _this = this;
 753          adds = [];
 754          mappedScopeModelIds = {};
 755          removals = [];
 756          return _async.each(scope.models, function(m) {
 757            var child;
 758            if (m[idKey] != null) {
 759              mappedScopeModelIds[m[idKey]] = {};
 760              if (childObjects[m[idKey]] == null) {
 761                return adds.push(m);
 762              } else {
 763                child = childObjects[m[idKey]];
 764                if (!comparison(m, child.model)) {
 765                  adds.push(m);
 766                  return removals.push(child.model);
 767                }
 768              }
 769            } else {
 770              return Logger.error("id missing for model " + (m.toString()) + ", can not use do comparison/insertion");
 771            }
 772          }, function() {
 773            return _async.each(childObjects.values(), function(c) {
 774              var id;
 775              if (c == null) {
 776                Logger.error("child undefined in ModelsWatcher.");
 777                return;
 778              }
 779              if (c.model == null) {
 780                Logger.error("child.model undefined in ModelsWatcher.");
 781                return;
 782              }
 783              id = c.model[idKey];
 784              if (mappedScopeModelIds[id] == null) {
 785                return removals.push(c.model[idKey]);
 786              }
 787            }, function() {
 788              return callBack({
 789                adds: adds,
 790                removals: removals
 791              });
 792            });
 793          });
 794        }
 795      };
 796    }
 797  ]);
 798
 799}).call(this);
 800
 801/*
 802    Simple Object Map with a lenght property to make it easy to track length/size
 803*/
 804
 805
 806(function() {
 807  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
 808
 809  angular.module("google-maps.directives.api.utils").factory("PropMap", function() {
 810    var PropMap, propsToPop;
 811    propsToPop = ['get', 'put', 'remove', 'values', 'keys', 'length'];
 812    PropMap = (function() {
 813      function PropMap() {
 814        this.keys = __bind(this.keys, this);
 815        this.values = __bind(this.values, this);
 816        this.remove = __bind(this.remove, this);
 817        this.put = __bind(this.put, this);
 818        this.get = __bind(this.get, this);
 819        this.length = 0;
 820      }
 821
 822      PropMap.prototype.get = function(key) {
 823        return this[key];
 824      };
 825
 826      PropMap.prototype.put = function(key, value) {
 827        if (this[key] == null) {
 828          this.length++;
 829        }
 830        return this[key] = value;
 831      };
 832
 833      PropMap.prototype.remove = function(key) {
 834        delete this[key];
 835        return this.length--;
 836      };
 837
 838      PropMap.prototype.values = function() {
 839        var all, keys,
 840          _this = this;
 841        all = [];
 842        keys = _.keys(this);
 843        _.each(keys, function(value) {
 844          if (_.indexOf(propsToPop, value) === -1) {
 845            return all.push(_this[value]);
 846          }
 847        });
 848        return all;
 849      };
 850
 851      PropMap.prototype.keys = function() {
 852        var all, keys,
 853          _this = this;
 854        keys = _.keys(this);
 855        all = [];
 856        _.each(keys, function(prop) {
 857          if (_.indexOf(propsToPop, prop) === -1) {
 858            return all.push(prop);
 859          }
 860        });
 861        return all;
 862      };
 863
 864      return PropMap;
 865
 866    })();
 867    return PropMap;
 868  });
 869
 870}).call(this);
 871
 872(function() {
 873  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
 874    __hasProp = {}.hasOwnProperty,
 875    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
 876
 877  angular.module("google-maps.directives.api.managers").factory("ClustererMarkerManager", [
 878    "Logger", "FitHelper", function($log, FitHelper) {
 879      var ClustererMarkerManager;
 880      ClustererMarkerManager = (function(_super) {
 881        __extends(ClustererMarkerManager, _super);
 882
 883        function ClustererMarkerManager(gMap, opt_markers, opt_options, opt_events) {
 884          var self;
 885          this.opt_events = opt_events;
 886          this.fit = __bind(this.fit, this);
 887          this.destroy = __bind(this.destroy, this);
 888          this.clear = __bind(this.clear, this);
 889          this.draw = __bind(this.draw, this);
 890          this.removeMany = __bind(this.removeMany, this);
 891          this.remove = __bind(this.remove, this);
 892          this.addMany = __bind(this.addMany, this);
 893          this.add = __bind(this.add, this);
 894          ClustererMarkerManager.__super__.constructor.call(this);
 895          self = this;
 896          this.opt_options = opt_options;
 897          if ((opt_options != null) && opt_markers === void 0) {
 898            this.clusterer = new MarkerClusterer(gMap, void 0, opt_options);
 899          } else if ((opt_options != null) && (opt_markers != null)) {
 900            this.clusterer = new MarkerClusterer(gMap, opt_markers, opt_options);
 901          } else {
 902            this.clusterer = new MarkerClusterer(gMap);
 903          }
 904          this.attachEvents(this.opt_events, "opt_events");
 905          this.clusterer.setIgnoreHidden(true);
 906          this.noDrawOnSingleAddRemoves = true;
 907          $log.info(this);
 908        }
 909
 910        ClustererMarkerManager.prototype.add = function(gMarker) {
 911          return this.clusterer.addMarker(gMarker, this.noDrawOnSingleAddRemoves);
 912        };
 913
 914        ClustererMarkerManager.prototype.addMany = function(gMarkers) {
 915          return this.clusterer.addMarkers(gMarkers);
 916        };
 917
 918        ClustererMarkerManager.prototype.remove = function(gMarker) {
 919          return this.clusterer.removeMarker(gMarker, this.noDrawOnSingleAddRemoves);
 920        };
 921
 922        ClustererMarkerManager.prototype.removeMany = function(gMarkers) {
 923          return this.clusterer.addMarkers(gMarkers);
 924        };
 925
 926        ClustererMarkerManager.prototype.draw = function() {
 927          return this.clusterer.repaint();
 928        };
 929
 930        ClustererMarkerManager.prototype.clear = function() {
 931          this.clusterer.clearMarkers();
 932          return this.clusterer.repaint();
 933        };
 934
 935        ClustererMarkerManager.prototype.attachEvents = function(options, optionsName) {
 936          var eventHandler, eventName, _results;
 937          if (angular.isDefined(options) && (options != null) && angular.isObject(options)) {
 938            _results = [];
 939            for (eventName in options) {
 940              eventHandler = options[eventName];
 941              if (options.hasOwnProperty(eventName) && angular.isFunction(options[eventName])) {
 942                $log.info("" + optionsName + ": Attaching event: " + eventName + " to clusterer");
 943                _results.push(google.maps.event.addListener(this.clusterer, eventName, options[eventName]));
 944              } else {
 945                _results.push(void 0);
 946              }
 947            }
 948            return _results;
 949          }
 950        };
 951
 952        ClustererMarkerManager.prototype.clearEvents = function(options) {
 953          var eventHandler, eventName, _results;
 954          if (angular.isDefined(options) && (options != null) && angular.isObject(options)) {
 955            _results = [];
 956            for (eventName in options) {
 957              eventHandler = options[eventName];
 958              if (options.hasOwnProperty(eventName) && angular.isFunction(options[eventName])) {
 959                $log.info("" + optionsName + ": Clearing event: " + eventName + " to clusterer");
 960                _results.push(google.maps.event.clearListeners(this.clusterer, eventName));
 961              } else {
 962                _results.push(void 0);
 963              }
 964            }
 965            return _results;
 966          }
 967        };
 968
 969        ClustererMarkerManager.prototype.destroy = function() {
 970          this.clearEvents(this.opt_events);
 971          this.clearEvents(this.opt_internal_events);
 972          return this.clear();
 973        };
 974
 975        ClustererMarkerManager.prototype.fit = function() {
 976          return ClustererMarkerManager.__super__.fit.call(this, this.clusterer.getMarkers(), this.clusterer.getMap());
 977        };
 978
 979        return ClustererMarkerManager;
 980
 981      })(FitHelper);
 982      return ClustererMarkerManager;
 983    }
 984  ]);
 985
 986}).call(this);
 987
 988(function() {
 989  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
 990    __hasProp = {}.hasOwnProperty,
 991    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
 992
 993  angular.module("google-maps.directives.api.managers").factory("MarkerManager", [
 994    "Logger", "FitHelper", function(Logger, FitHelper) {
 995      var MarkerManager;
 996      MarkerManager = (function(_super) {
 997        __extends(MarkerManager, _super);
 998
 999        MarkerManager.include(FitHelper);
1000
1001        function MarkerManager(gMap, opt_markers, opt_options) {
1002          this.fit = __bind(this.fit, this);
1003          this.handleOptDraw = __bind(this.handleOptDraw, this);
1004          this.clear = __bind(this.clear, this);
1005          this.draw = __bind(this.draw, this);
1006          this.removeMany = __bind(this.removeMany, this);
1007          this.remove = __bind(this.remove, this);
1008          this.addMany = __bind(this.addMany, this);
1009          this.add = __bind(this.add, this);
1010          var self;
1011          MarkerManager.__super__.constructor.call(this);
1012          self = this;
1013          this.gMap = gMap;
1014          this.gMarkers = [];
1015          this.$log = Logger;
1016          this.$log.info(this);
1017        }
1018
1019        MarkerManager.prototype.add = function(gMarker, optDraw) {
1020          this.handleOptDraw(gMarker, optDraw, true);
1021          return this.gMarkers.push(gMarker);
1022        };
1023
1024        MarkerManager.prototype.addMany = function(gMarkers) {
1025          var gMarker, _i, _len, _results;
1026          _results = [];
1027          for (_i = 0, _len = gMarkers.length; _i < _len; _i++) {
1028            gMarker = gMarkers[_i];
1029            _results.push(this.add(gMarker));
1030          }
1031          return _results;
1032        };
1033
1034        MarkerManager.prototype.remove = function(gMarker, optDraw) {
1035          var index, tempIndex;
1036          this.handleOptDraw(gMarker, optDraw, false);
1037          if (!optDraw) {
1038            return;
1039          }
1040          index = void 0;
1041          if (this.gMarkers.indexOf != null) {
1042            index = this.gMarkers.indexOf(gMarker);
1043          } else {
1044            tempIndex = 0;
1045            _.find(this.gMarkers, function(marker) {
1046              tempIndex += 1;
1047              if (marker === gMarker) {
1048                index = tempIndex;
1049              }
1050            });
1051          }
1052          if (index != null) {
1053            return this.gMarkers.splice(index, 1);
1054          }
1055        };
1056
1057        MarkerManager.prototype.removeMany = function(gMarkers) {
1058          var _this = this;
1059          return this.gMarkers.forEach(function(marker) {
1060            return _this.remove(marker);
1061          });
1062        };
1063
1064        MarkerManager.prototype.draw = function() {
1065          var deletes,
1066            _this = this;
1067          deletes = [];
1068          this.gMarkers.forEach(function(gMarker) {
1069            if (!gMarker.isDrawn) {
1070              if (gMarker.doAdd) {
1071                return gMarker.setMap(_this.gMap);
1072              } else {
1073                return deletes.push(gMarker);
1074              }
1075            }
1076          });
1077          return deletes.forEach(function(gMarker) {
1078            return _this.remove(gMarker, true);
1079          });
1080        };
1081
1082        MarkerManager.prototype.clear = function() {
1083          var gMarker, _i, _len, _ref;
1084          _ref = this.gMarkers;
1085          for (_i = 0, _len = _ref.length; _i < _len; _i++) {
1086            gMarker = _ref[_i];
1087            gMarker.setMap(null);
1088          }
1089          delete this.gMarkers;
1090          return this.gMarkers = [];
1091        };
1092
1093        MarkerManager.prototype.handleOptDraw = function(gMarker, optDraw, doAdd) {
1094          if (optDraw === true) {
1095            if (doAdd) {
1096              gMarker.setMap(this.gMap);
1097            } else {
1098              gMarker.setMap(null);
1099            }
1100            return gMarker.isDrawn = true;
1101          } else {
1102            gMarker.isDrawn = false;
1103            return gMarker.doAdd = doAdd;
1104          }
1105        };
1106
1107        MarkerManager.prototype.fit = function() {
1108          return MarkerManager.__super__.fit.call(this, this.gMarkers, this.gMap);
1109        };
1110
1111        return MarkerManager;
1112
1113      })(FitHelper);
1114      return MarkerManager;
1115    }
1116  ]);
1117
1118}).call(this);
1119
1120(function() {
1121  angular.module("google-maps").factory("array-sync", [
1122    "add-events", function(mapEvents) {
1123      return function(mapArray, scope, pathEval) {
1124        var geojsonArray, geojsonHandlers, geojsonWatcher, isSetFromScope, legacyHandlers, legacyWatcher, mapArrayListener, scopePath, watchListener;
1125        isSetFromScope = false;
1126        scopePath = scope.$eval(pathEval);
1127        if (!scope["static"]) {
1128          legacyHandlers = {
1129            set_at: function(index) {
1130              var value;
1131              if (isSetFromScope) {
1132                return;
1133              }
1134              value = mapArray.getAt(index);
1135              if (!value) {
1136                return;
1137              }
1138              if (!value.lng || !value.lat) {
1139                return scopePath[index] = value;
1140              } else {
1141                scopePath[index].latitude = value.lat();
1142                return scopePath[index].longitude = value.lng();
1143              }
1144            },
1145            insert_at: function(index) {
1146              var value;
1147              if (isSetFromScope) {
1148                return;
1149              }
1150              value = mapArray.getAt(index);
1151              if (!value) {
1152                return;
1153              }
1154              if (!value.lng || !value.lat) {
1155                return scopePath.splice(index, 0, value);
1156              } else {
1157                return scopePath.splice(index, 0, {
1158                  latitude: value.lat(),
1159                  longitude: value.lng()
1160                });
1161              }
1162            },
1163            remove_at: function(index) {
1164              if (isSetFromScope) {
1165                return;
1166              }
1167              return scopePath.splice(index, 1);
1168            }
1169          };
1170          geojsonArray;
1171          if (scopePath.type === "Polygon") {
1172            geojsonArray = scopePath.coordinates[0];
1173          } else if (scopePath.type === "LineString") {
1174            geojsonArray = scopePath.coordinates;
1175          }
1176          geojsonHandlers = {
1177            set_at: function(index) {
1178              var value;
1179              if (isSetFromScope) {
1180                return;
1181              }
1182              value = mapArray.getAt(index);
1183              if (!value) {
1184                return;
1185              }
1186              if (!value.lng || !value.lat) {
1187                return;
1188              }
1189              geojsonArray[index][1] = value.lat();
1190              return geojsonArray[index][0] = value.lng();
1191            },
1192            insert_at: function(index) {
1193              var value;
1194              if (isSetFromScope) {
1195                return;
1196              }
1197              value = mapArray.getAt(index);
1198              if (!value) {
1199                return;
1200              }
1201              if (!value.lng || !value.lat) {
1202                return;
1203              }
1204              return geojsonArray.splice(index, 0, [value.lng(), value.lat()]);
1205            },
1206            remove_at: function(index) {
1207              if (isSetFromScope) {
1208                return;
1209              }
1210              return geojsonArray.splice(index, 1);
1211            }
1212          };
1213          mapArrayListener = mapEvents(mapArray, angular.isUndefined(scopePath.type) ? legacyHandlers : geojsonHandlers);
1214        }
1215        legacyWatcher = function(newPath) {
1216          var i, l, newLength, newValue, oldArray, oldLength, oldValue;
1217          isSetFromScope = true;
1218          oldArray = mapArray;
1219          if (newPath) {
1220            i = 0;
1221            oldLength = oldArray.getLength();
1222            newLength = newPath.length;
1223            l = Math.min(oldLength, newLength);
1224            newValue = void 0;
1225            while (i < l) {
1226              oldValue = oldArray.getAt(i);
1227              newValue = newPath[i];
1228              if (typeof newValue.equals === "function") {
1229                if (!newValue.equals(oldValue)) {
1230                  oldArray.setAt(i, newValue);
1231                }
1232              } else {
1233                if ((oldValue.lat() !== newValue.latitude) || (oldValue.lng() !== newValue.longitude)) {
1234                  oldArray.setAt(i, new google.maps.LatLng(newValue.latitude, newValue.longitude));
1235                }
1236              }
1237              i++;
1238            }
1239            while (i < newLength) {
1240              newValue = newPath[i];
1241              if (typeof newValue.lat === "function" && typeof newValue.lng === "function") {
1242                oldArray.push(newValue);
1243              } else {
1244                oldArray.push(new google.maps.LatLng(newValue.latitude, newValue.longitude));
1245              }
1246              i++;
1247            }
1248            while (i < oldLength) {
1249              oldArray.pop();
1250              i++;
1251            }
1252          }
1253          return isSetFromScope = false;
1254        };
1255        geojsonWatcher = function(newPath) {
1256          var array, i, l, newLength, newValue, oldArray, oldLength, oldValue;
1257          isSetFromScope = true;
1258          oldArray = mapArray;
1259          if (newPath) {
1260            array;
1261            if (scopePath.type === "Polygon") {
1262              array = newPath.coordinates[0];
1263            } else if (scopePath.type === "LineString") {
1264              array = newPath.coordinates;
1265            }
1266            i = 0;
1267            oldLength = oldArray.getLength();
1268            newLength = array.length;
1269            l = Math.min(oldLength, newLength);
1270            newValue = void 0;
1271            while (i < l) {
1272              oldValue = oldArray.getAt(i);
1273              newValue = array[i];
1274              if ((oldValue.lat() !== newValue[1]) || (oldValue.lng() !== newValue[0])) {
1275                oldArray.setAt(i, new google.maps.LatLng(newValue[1], newValue[0]));
1276              }
1277              i++;
1278            }
1279            while (i < newLength) {
1280              newValue = array[i];
1281              oldArray.push(new google.maps.LatLng(newValue[1], newValue[0]));
1282              i++;
1283            }
1284            while (i < oldLength) {
1285              oldArray.pop();
1286              i++;
1287            }
1288          }
1289          return isSetFromScope = false;
1290        };
1291        watchListener;
1292        if (!scope["static"]) {
1293          if (angular.isUndefined(scopePath.type)) {
1294            watchListener = scope.$watchCollection(pathEval, legacyWatcher);
1295          } else {
1296            watchListener = scope.$watch(pathEval, geojsonWatcher);
1297          }
1298        }
1299        return function() {
1300          if (mapArrayListener) {
1301            mapArrayListener();
1302            mapArrayListener = null;
1303          }
1304          if (watchListener) {
1305            watchListener();
1306            return watchListener = null;
1307          }
1308        };
1309      };
1310    }
1311  ]);
1312
1313}).call(this);
1314
1315(function() {
1316  angular.module("google-maps").factory("add-events", [
1317    "$timeout", function($timeout) {
1318      var addEvent, addEvents;
1319      addEvent = function(target, eventName, handler) {
1320        return google.maps.event.addListener(target, eventName, function() {
1321          handler.apply(this, arguments);
1322          return $timeout((function() {}), true);
1323        });
1324      };
1325      addEvents = function(target, eventName, handler) {
1326        var remove;
1327        if (handler) {
1328          return addEvent(target, eventName, handler);
1329        }
1330        remove = [];
1331        angular.forEach(eventName, function(_handler, key) {
1332          return remove.push(addEvent(target, key, _handler));
1333        });
1334        return function() {
1335          angular.forEach(remove, function(listener) {
1336            return google.maps.event.removeListener(listener);
1337          });
1338          return remove = null;
1339        };
1340      };
1341      return addEvents;
1342    }
1343  ]);
1344
1345}).call(this);
1346
1347(function() {
1348  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
1349    __hasProp = {}.hasOwnProperty,
1350    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
1351
1352  angular.module("google-maps.directives.api.models.child").factory("MarkerLabelChildModel", [
1353    "BaseObject", "GmapUtil", function(BaseObject, GmapUtil) {
1354      var MarkerLabelChildModel;
1355      MarkerLabelChildModel = (function(_super) {
1356        __extends(MarkerLabelChildModel, _super);
1357
1358        MarkerLabelChildModel.include(GmapUtil);
1359
1360        function MarkerLabelChildModel(gMarker, opt_options) {
1361          this.destroy = __bind(this.destroy, this);
1362          this.draw = __bind(this.draw, this);
1363          this.setPosition = __bind(this.setPosition, this);
1364          this.setZIndex = __bind(this.setZIndex, this);
1365          this.setVisible = __bind(this.setVisible, this);
1366          this.setAnchor = __bind(this.setAnchor, this);
1367          this.setMandatoryStyles = __bind(this.setMandatoryStyles, this);
1368          this.setStyles = __bind(this.setStyles, this);
1369          this.setContent = __bind(this.setContent, this);
1370          this.setTitle = __bind(this.setTitle, this);
1371          this.getSharedCross = __bind(this.getSharedCross, this);
1372          var self, _ref, _ref1;
1373          MarkerLabelChildModel.__super__.constructor.call(this);
1374          self = this;
1375          this.marker = gMarker;
1376          this.marker.set("labelContent", opt_options.labelContent);
1377          this.marker.set("labelAnchor", this.getLabelPositionPoint(opt_options.labelAnchor));
1378          this.marker.set("labelClass", opt_options.labelClass || 'labels');
1379          this.marker.set("labelStyle", opt_options.labelStyle || {
1380            opacity: 100
1381          });
1382          this.marker.set("labelInBackground", opt_options.labelInBackground || false);
1383          if (!opt_options.labelVisible) {
1384            this.marker.set("labelVisible", true);
1385          }
1386          if (!opt_options.raiseOnDrag) {
1387            this.marker.set("raiseOnDrag", true);
1388          }
1389          if (!opt_options.clickable) {
1390            this.marker.set("clickable", true);
1391          }
1392          if (!opt_options.draggable) {
1393            this.marker.set("draggable", false);
1394          }
1395          if (!opt_options.optimized) {
1396            this.marker.set("optimized", false);
1397          }
1398          opt_options.crossImage = (_ref = opt_options.crossImage) != null ? _ref : document.location.protocol + "//maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png";
1399          opt_options.handCursor = (_ref1 = opt_options.handCursor) != null ? _ref1 : document.location.protocol + "//maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur";
1400          this.markerLabel = new MarkerLabel_(this.marker, opt_options.crossImage, opt_options.handCursor);
1401          this.marker.set("setMap", function(theMap) {
1402            google.maps.Marker.prototype.setMap.apply(this, arguments);
1403            return self.markerLabel.setMap(theMap);
1404          });
1405          this.marker.setMap(this.marker.getMap());
1406        }
1407
1408        MarkerLabelChildModel.prototype.getSharedCross = function(crossUrl) {
1409          return this.markerLabel.getSharedCross(crossUrl);
1410        };
1411
1412        MarkerLabelChildModel.prototype.setTitle = function() {
1413          return this.markerLabel.setTitle();
1414        };
1415
1416        MarkerLabelChildModel.prototype.setContent = function() {
1417          return this.markerLabel.setContent();
1418        };
1419
1420        MarkerLabelChildModel.prototype.setStyles = function() {
1421          return this.markerLabel.setStyles();
1422        };
1423
1424        MarkerLabelChildModel.prototype.setMandatoryStyles = function() {
1425          return this.markerLabel.setMandatoryStyles();
1426        };
1427
1428        MarkerLabelChildModel.prototype.setAnchor = function() {
1429          return this.markerLabel.setAnchor();
1430        };
1431
1432        MarkerLabelChildModel.prototype.setVisible = function() {
1433          return this.markerLabel.setVisible();
1434        };
1435
1436        MarkerLabelChildModel.prototype.setZIndex = function() {
1437          return this.markerLabel.setZIndex();
1438        };
1439
1440        MarkerLabelChildModel.prototype.setPosition = function() {
1441          return this.markerLabel.setPosition();
1442        };
1443
1444        MarkerLabelChildModel.prototype.draw = function() {
1445          return this.markerLabel.draw();
1446        };
1447
1448        MarkerLabelChildModel.prototype.destroy = function() {
1449          if ((this.markerLabel.labelDiv_.parentNode != null) && (this.markerLabel.eventDiv_.parentNode != null)) {
1450            return this.markerLabel.onRemove();
1451          }
1452        };
1453
1454        return MarkerLabelChildModel;
1455
1456      })(BaseObject);
1457      return MarkerLabelChildModel;
1458    }
1459  ]);
1460
1461}).call(this);
1462
1463(function() {
1464  var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
1465    __hasProp = {}.hasOwnProperty,
1466    __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
1467
1468  angular.module("google-maps.directives.api.models.child").factory("MarkerChildModel", [
1469    "ModelKey", "GmapUtil", "Logger", "$injector", "MarkerEventHelper", function(ModelKey, GmapUtil, Logger, $injector, MarkerEventHelper) {
1470      var MarkerChildModel;
1471      MarkerChildModel = (function(_super) {
1472        __extends(MarkerChildModel, _super);
1473
1474        MarkerChildModel.include(GmapUtil);
1475
1476        MarkerChildModel.include(MarkerEventHelper);
1477
1478        function MarkerChildModel(model, parentScope, gMap, $timeout, defaults, doClick, gMarkerManager, idKey) {
1479          var self,
1480            _this = this;
1481          this.model = model;
1482          this.parentScope = parentScope;
1483          this.g

Large files files are truncated, but you can click here to view the full file