diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 264c4aea1..68caa57de 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -53,6 +53,10 @@ module.exports = (grunt) -> grunt.registerTask "coverage", ["clean:dist", "jshint", "mkdir", "coffee", "concat:libs", "replace", "concat:dist", "copy", "uglify", "jasmine:coverage"] + grunt.registerTask 'default-no-specs', ["clean:dist", "jshint", "mkdir", "coffee", "concat:libs", "replace", "concat:dist", "copy", "uglify"] + + grunt.registerTask 'offline', ['default-no-specs', 'watch:offline'] + # Run the example page by creating a local copy of angular-google-maps.js # and running a webserver on port 3100 with livereload. Web page is opened # automatically in the default browser. diff --git a/dist/angular-google-maps.js b/dist/angular-google-maps.js index c4f74cf59..519012248 100644 --- a/dist/angular-google-maps.js +++ b/dist/angular-google-maps.js @@ -1,4 +1,4 @@ -/*! angular-google-maps 2.0.7 2014-11-04 +/*! angular-google-maps 2.0.7 2014-11-11 * AngularJS directives for Google Maps * git: https://github.com/angular-ui/angular-google-maps.git */ @@ -375,7 +375,7 @@ Nicholas McCready - https://twitter.com/nmccready }).call(this); (function() { - angular.module("uiGmapgoogle-maps.directives.api.utils").service("_sync".ns(), [ + angular.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmap_sync", [ function() { return { fakePromise: function() { @@ -1426,8 +1426,8 @@ Nicholas McCready - https://twitter.com/nmccready __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api.managers".ns()).factory("ClustererMarkerManager".ns(), [ - "Logger".ns(), "FitHelper".ns(), "PropMap".ns(), function($log, FitHelper, PropMap) { + angular.module('uiGmapgoogle-maps.directives.api.managers').factory('uiGmapClustererMarkerManager', [ + 'uiGmapLogger', 'uiGmapFitHelper', 'uiGmapPropMap', function($log, FitHelper, PropMap) { var ClustererMarkerManager; ClustererMarkerManager = (function(_super) { __extends(ClustererMarkerManager, _super); @@ -1459,7 +1459,7 @@ Nicholas McCready - https://twitter.com/nmccready this.clusterer = new NgMapMarkerClusterer(gMap); } this.propMapGMarkers = new PropMap(); - this.attachEvents(this.opt_events, "opt_events"); + this.attachEvents(this.opt_events, 'opt_events'); this.clusterer.setIgnoreHidden(true); this.noDrawOnSingleAddRemoves = true; $log.info(this); @@ -1468,15 +1468,13 @@ Nicholas McCready - https://twitter.com/nmccready ClustererMarkerManager.prototype.checkKey = function(gMarker) { var msg; if (gMarker.key == null) { - msg = "gMarker.key undefined and it is REQUIRED!!"; + msg = 'gMarker.key undefined and it is REQUIRED!!'; return Logger.error(msg); } }; ClustererMarkerManager.prototype.add = function(gMarker) { - var exists; this.checkKey(gMarker); - exists = this.propMapGMarkers.get(gMarker.key) != null; this.clusterer.addMarker(gMarker, this.noDrawOnSingleAddRemoves); this.propMapGMarkers.put(gMarker.key, gMarker); return this.checkSync(); @@ -1568,7 +1566,7 @@ Nicholas McCready - https://twitter.com/nmccready ClustererMarkerManager.prototype.checkSync = function() { if (this.getGMarkers().length !== this.propMapGMarkers.length) { - throw "GMarkers out of Sync in MarkerClusterer"; + throw 'GMarkers out of Sync in MarkerClusterer'; } }; @@ -1586,8 +1584,8 @@ Nicholas McCready - https://twitter.com/nmccready __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api.managers".ns()).factory("MarkerManager".ns(), [ - "Logger".ns(), "FitHelper".ns(), "PropMap".ns(), function(Logger, FitHelper, PropMap) { + angular.module("uiGmapgoogle-maps.directives.api.managers").factory("uiGmapMarkerManager", [ + "uiGmapLogger", "uiGmapFitHelper", "uiGmapPropMap", function(Logger, FitHelper, PropMap) { var MarkerManager; MarkerManager = (function(_super) { __extends(MarkerManager, _super); @@ -1962,7 +1960,7 @@ Nicholas McCready - https://twitter.com/nmccready }).call(this); (function() { - angular.module("google-maps.directives.api.utils".ns()).factory("ChromeFixes".ns(), [ + angular.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapChromeFixes", [ function() { return { maybeRepaint: function(el) { @@ -2194,14 +2192,11 @@ Nicholas McCready - https://twitter.com/nmccready }).call(this); (function() { - angular.module("google-maps.directives.api.options".ns()).service("MarkerOptions".ns(), [ - "Logger".ns(), "GmapUtil".ns(), function($log, GmapUtil) { + angular.module('uiGmapgoogle-maps.directives.api.options').service('uiGmapMarkerOptions', [ + 'uiGmapLogger', 'uiGmapGmapUtil', function($log, GmapUtil) { return _.extend(GmapUtil, { createOptions: function(coords, icon, defaults, map) { var opts; - if (map == null) { - map = void 0; - } if (defaults == null) { defaults = {}; } @@ -2244,8 +2239,8 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi */ (function() { - angular.module("google-maps.directives.api.models.child".ns()).factory("DrawFreeHandChildModel".ns(), [ - "Logger".ns(), '$q', function($log, $q) { + angular.module('uiGmapgoogle-maps.directives.api.models.child').factory('uiGmapDrawFreeHandChildModel', [ + 'uiGmapLogger', '$q', function($log, $q) { var drawFreeHand, freeHandMgr; drawFreeHand = function(map, polys, enable) { var move, poly; @@ -2321,8 +2316,8 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api.models.child".ns()).factory("MarkerChildModel".ns(), [ - "ModelKey".ns(), "GmapUtil".ns(), "Logger".ns(), "EventsHelper".ns(), "PropertyAction".ns(), "MarkerOptions".ns(), "IMarker".ns(), "MarkerManager".ns(), "uiGmapPromise", function(ModelKey, GmapUtil, $log, EventsHelper, PropertyAction, MarkerOptions, IMarker, MarkerManager, uiGmapPromise) { + angular.module('uiGmapgoogle-maps.directives.api.models.child').factory('uiGmapMarkerChildModel', [ + 'uiGmapModelKey', 'uiGmapGmapUtil', 'uiGmapLogger', 'uiGmapEventsHelper', 'uiGmapPropertyAction', 'uiGmapMarkerOptions', 'uiGmapIMarker', 'uiGmapMarkerManager', 'uiGmapPromise', function(ModelKey, GmapUtil, $log, EventsHelper, PropertyAction, MarkerOptions, IMarker, MarkerManager, uiGmapPromise) { var MarkerChildModel, keys; keys = ['coords', 'icon', 'options', 'fit']; MarkerChildModel = (function(_super) { @@ -2377,7 +2372,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi return _this[k + 'Key'] = _.isFunction(_this.keys[k]) ? _this.keys[k]() : _this.keys[k]; }; })(this)); - this.idKey = this.idKeyKey || "id"; + this.idKey = this.idKeyKey || 'id'; if (this.model[this.idKey] != null) { this.id = this.model[this.idKey]; } @@ -2414,7 +2409,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi return scope.$watch(k, action.sic, true); }); } - this.scope.$on("$destroy", (function(_this) { + this.scope.$on('$destroy', (function(_this) { return function() { return destroy(_this); }; @@ -2516,7 +2511,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi } if (this.getProp(this.coordsKey, this.model) != null) { if (!this.validateCoords(this.getProp(this.coordsKey, this.model))) { - $log.debug("MarkerChild does not have coords yet. They may be defined later."); + $log.debug('MarkerChild does not have coords yet. They may be defined later.'); return; } this.gMarker.setPosition(this.getCoords(this.getProp(this.coordsKey, this.model))); @@ -2583,7 +2578,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi this.deferred.resolve(this.gMarker); } else { if (!this.gMarker) { - this.deferred.reject("gMarker is null"); + this.deferred.reject('gMarker is null'); } if (!(this.gMarker.getMap() && this.gMarkerManager.type === MarkerManager.type)) { $log.warn('gMarker has no map yet'); @@ -2640,8 +2635,8 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi var __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api".ns()).factory("PolygonChildModel".ns(), [ - "PolygonOptionsBuilder".ns(), "Logger".ns(), "$timeout", "array-sync".ns(), "GmapUtil".ns(), "EventsHelper".ns(), function(Builder, $log, $timeout, arraySync, GmapUtil, EventsHelper) { + angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapPolygonChildModel', [ + 'uiGmapPolygonOptionsBuilder', 'uiGmapLogger', '$timeout', 'uiGmaparray-sync', 'uiGmapGmapUtil', 'uiGmapEventsHelper', function(Builder, $log, $timeout, arraySync, GmapUtil, EventsHelper) { var PolygonChildModel; return PolygonChildModel = (function(_super) { __extends(PolygonChildModel, _super); @@ -2659,7 +2654,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi this.model = model; this.listeners = void 0; if (angular.isUndefined(scope.path) || scope.path === null || !this.validatePath(scope.path)) { - $log.error("polygon: no valid path attribute found"); + $log.error('polygon: no valid path attribute found'); return; } pathPoints = this.convertPathPoints(scope.path); @@ -2668,28 +2663,28 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi this.extendMapBounds(this.map, pathPoints); } if (!scope["static"] && angular.isDefined(scope.editable)) { - scope.$watch("editable", function(newValue, oldValue) { + scope.$watch('editable', function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setEditable(newValue); } }); } if (angular.isDefined(scope.draggable)) { - scope.$watch("draggable", function(newValue, oldValue) { + scope.$watch('draggable', function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setDraggable(newValue); } }); } if (angular.isDefined(scope.visible)) { - scope.$watch("visible", function(newValue, oldValue) { + scope.$watch('visible', function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setVisible(newValue); } }); } if (angular.isDefined(scope.geodesic)) { - scope.$watch("geodesic", (function(_this) { + scope.$watch('geodesic', (function(_this) { return function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(_this.buildOpts(polygon.getPath())); @@ -2698,14 +2693,14 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.opacity)) { - scope.$watch("stroke.opacity", (function(_this) { + scope.$watch('stroke.opacity', (function(_this) { return function(newValue, oldValue) { return polygon.setOptions(_this.buildOpts(polygon.getPath())); }; })(this)); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.weight)) { - scope.$watch("stroke.weight", (function(_this) { + scope.$watch('stroke.weight', (function(_this) { return function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(_this.buildOpts(polygon.getPath())); @@ -2714,7 +2709,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.color)) { - scope.$watch("stroke.color", (function(_this) { + scope.$watch('stroke.color', (function(_this) { return function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(_this.buildOpts(polygon.getPath())); @@ -2723,7 +2718,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.fill) && angular.isDefined(scope.fill.color)) { - scope.$watch("fill.color", (function(_this) { + scope.$watch('fill.color', (function(_this) { return function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(_this.buildOpts(polygon.getPath())); @@ -2732,7 +2727,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.fill) && angular.isDefined(scope.fill.opacity)) { - scope.$watch("fill.opacity", (function(_this) { + scope.$watch('fill.opacity', (function(_this) { return function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(_this.buildOpts(polygon.getPath())); @@ -2741,7 +2736,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.zIndex)) { - scope.$watch("zIndex", (function(_this) { + scope.$watch('zIndex', (function(_this) { return function(newValue, oldValue) { if (newValue !== oldValue) { return polygon.setOptions(_this.buildOpts(polygon.getPath())); @@ -2752,14 +2747,14 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi if (angular.isDefined(scope.events) && scope.events !== null && angular.isObject(scope.events)) { this.listeners = EventsHelper.setEvents(polygon, scope, scope); } - arraySyncer = arraySync(polygon.getPath(), scope, "path", (function(_this) { + arraySyncer = arraySync(polygon.getPath(), scope, 'path', (function(_this) { return function(pathPoints) { if (scope.fit) { return _this.extendMapBounds(_this.map, pathPoints); } }; })(this)); - scope.$on("$destroy", (function(_this) { + scope.$on('$destroy', (function(_this) { return function() { polygon.setMap(null); _this.removeEvents(_this.listeners); @@ -2784,8 +2779,8 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api".ns()).factory("PolylineChildModel".ns(), [ - "PolylineOptionsBuilder".ns(), "Logger".ns(), "$timeout", "array-sync".ns(), "GmapUtil".ns(), "EventsHelper".ns(), function(Builder, $log, $timeout, arraySync, GmapUtil, EventsHelper) { + angular.module('uiGmapgoogle-maps.directives.api').factory('ugGmapPolylineChildModel', [ + 'uiGmapPolylineOptionsBuilder', 'uiGmapLogger', '$timeout', 'uiGmaparray-sync', 'uiGmapGmapUtil', 'uiGmapEventsHelper', function(Builder, $log, $timeout, arraySync, GmapUtil, EventsHelper) { var PolylineChildModel; return PolylineChildModel = (function(_super) { __extends(PolylineChildModel, _super); @@ -2816,7 +2811,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi if (_this.scope.fit) { _this.extendMapBounds(map, pathPoints); } - arraySync(_this.polyline.getPath(), _this.scope, "path", function(pathPoints) { + arraySync(_this.polyline.getPath(), _this.scope, 'path', function(pathPoints) { if (_this.scope.fit) { return _this.extendMapBounds(map, pathPoints); } @@ -2834,7 +2829,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi }; })(this)); if (!scope["static"] && angular.isDefined(scope.editable)) { - scope.$watch("editable", (function(_this) { + scope.$watch('editable', (function(_this) { return function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { @@ -2844,7 +2839,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.draggable)) { - scope.$watch("draggable", (function(_this) { + scope.$watch('draggable', (function(_this) { return function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { @@ -2854,7 +2849,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.visible)) { - scope.$watch("visible", (function(_this) { + scope.$watch('visible', (function(_this) { return function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { @@ -2864,7 +2859,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.geodesic)) { - scope.$watch("geodesic", (function(_this) { + scope.$watch('geodesic', (function(_this) { return function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { @@ -2874,7 +2869,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.weight)) { - scope.$watch("stroke.weight", (function(_this) { + scope.$watch('stroke.weight', (function(_this) { return function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { @@ -2884,7 +2879,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.color)) { - scope.$watch("stroke.color", (function(_this) { + scope.$watch('stroke.color', (function(_this) { return function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { @@ -2894,7 +2889,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.stroke) && angular.isDefined(scope.stroke.opacity)) { - scope.$watch("stroke.opacity", (function(_this) { + scope.$watch('stroke.opacity', (function(_this) { return function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { @@ -2904,7 +2899,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi })(this)); } if (angular.isDefined(scope.icons)) { - scope.$watch("icons", (function(_this) { + scope.$watch('icons', (function(_this) { return function(newValue, oldValue) { var _ref; if (newValue !== oldValue) { @@ -2913,7 +2908,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi }; })(this)); } - scope.$on("$destroy", (function(_this) { + scope.$on('$destroy', (function(_this) { return function() { _this.clean(); return _this.scope = null; @@ -2952,8 +2947,8 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api.models.child".ns()).factory("WindowChildModel".ns(), [ - "BaseObject".ns(), "GmapUtil".ns(), "Logger".ns(), "$compile", "$http", "$templateCache", 'uiGmapChromeFixes', function(BaseObject, GmapUtil, $log, $compile, $http, $templateCache, ChromeFixes) { + angular.module('uiGmapgoogle-maps.directives.api.models.child').factory('uiGmapWindowChildModel', [ + 'uiGmapBaseObject', 'uiGmapGmapUtil', 'uiGmapLogger', '$compile', '$http', '$templateCache', 'uiGmapChromeFixes', function(BaseObject, GmapUtil, $log, $compile, $http, $templateCache, ChromeFixes) { var WindowChildModel; WindowChildModel = (function(_super) { __extends(WindowChildModel, _super); @@ -2997,7 +2992,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi this.watchOptions(); this.watchCoords(); this.watchAndDoShow(); - this.scope.$on("$destroy", (function(_this) { + this.scope.$on('$destroy', (function(_this) { return function() { return _this.destroy(); }; @@ -3260,8 +3255,8 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi var __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api.models.parent".ns()).factory("CircleParentModel".ns(), [ - 'Logger'.ns(), '$timeout', "GmapUtil".ns(), "EventsHelper".ns(), "CircleOptionsBuilder".ns(), function($log, $timeout, GmapUtil, EventsHelper, Builder) { + angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapCircleParentModel', [ + 'uiGmapLogger', '$timeout', 'uiGmapGmapUtil', 'uiGmapEventsHelper', 'uiGmapCircleOptionsBuilder', function($log, $timeout, GmapUtil, EventsHelper, Builder) { var CircleParentModel; return CircleParentModel = (function(_super) { __extends(CircleParentModel, _super); @@ -3311,7 +3306,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi } }); }); - scope.$on("$destroy", (function(_this) { + scope.$on('$destroy', (function(_this) { return function() { _this.removeEvents(listeners); return circle.setMap(null); @@ -3329,8 +3324,8 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi }).call(this); (function() { - angular.module("google-maps.directives.api.models.parent".ns()).factory("DrawingManagerParentModel".ns(), [ - 'Logger'.ns(), '$timeout', function($log, $timeout) { + angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapDrawingManagerParentModel', [ + 'uiGmapLogger', '$timeout', function($log, $timeout) { var DrawingManagerParentModel; return DrawingManagerParentModel = (function() { function DrawingManagerParentModel(scope, element, attrs, map) { @@ -3341,25 +3336,19 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi drawingManager = new google.maps.drawing.DrawingManager(this.scope.options); drawingManager.setMap(this.map); if (this.scope.control != null) { - this.scope.control.getDrawingManager = (function(_this) { - return function() { - return drawingManager; - }; - })(this); + this.scope.control.getDrawingManager = function() { + return drawingManager; + }; } if (!this.scope["static"] && this.scope.options) { - this.scope.$watch("options", (function(_this) { - return function(newValue) { - return drawingManager != null ? drawingManager.setOptions(newValue) : void 0; - }; - })(this), true); + this.scope.$watch('options', function(newValue) { + return drawingManager != null ? drawingManager.setOptions(newValue) : void 0; + }, true); } - scope.$on("$destroy", (function(_this) { - return function() { - drawingManager.setMap(null); - return drawingManager = null; - }; - })(this)); + scope.$on('$destroy', function() { + drawingManager.setMap(null); + return drawingManager = null; + }); } return DrawingManagerParentModel; @@ -3463,17 +3452,12 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi }).call(this); - -/* - - interface directive for all window(s) to derrive from - */ - (function() { var __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api.models.parent".ns()).factory("IWindowParentModel".ns(), [ - "ModelKey".ns(), "GmapUtil".ns(), "Logger".ns(), function(ModelKey, GmapUtil, Logger) { + angular.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapIWindowParentModel", [ + "uiGmapModelKey", "uiGmapGmapUtil", "uiGmapLogger", function(ModelKey, GmapUtil, Logger) { var IWindowParentModel; IWindowParentModel = (function(_super) { __extends(IWindowParentModel, _super); @@ -3507,8 +3491,8 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api.models.parent".ns()).factory("LayerParentModel".ns(), [ - "BaseObject".ns(), "Logger".ns(), '$timeout', function(BaseObject, Logger, $timeout) { + angular.module('uiGmapgoogle-maps.directives.api.models.parent').factory('uiGmapLayerParentModel', [ + 'uiGmapBaseObject', 'uiGmapLogger', '$timeout', function(BaseObject, Logger, $timeout) { var LayerParentModel; LayerParentModel = (function(_super) { __extends(LayerParentModel, _super); @@ -3522,7 +3506,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi this.$log = $log != null ? $log : Logger; this.createGoogleLayer = __bind(this.createGoogleLayer, this); if (this.attrs.type == null) { - this.$log.info("type attribute for the layer directive is mandatory. Layer creation aborted!!"); + this.$log.info('type attribute for the layer directive is mandatory. Layer creation aborted!!'); return; } this.createGoogleLayer(); @@ -3533,7 +3517,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi if (this.doShow && (this.gMap != null)) { this.layer.setMap(this.gMap); } - this.scope.$watch("show", (function(_this) { + this.scope.$watch('show', (function(_this) { return function(newValue, oldValue) { if (newValue !== oldValue) { _this.doShow = newValue; @@ -3545,7 +3529,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi } }; })(this), true); - this.scope.$watch("options", (function(_this) { + this.scope.$watch('options', (function(_this) { return function(newValue, oldValue) { if (newValue !== oldValue) { _this.layer.setMap(null); @@ -3554,7 +3538,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi } }; })(this), true); - this.scope.$on("$destroy", (function(_this) { + this.scope.$on('$destroy', (function(_this) { return function() { return _this.layer.setMap(null); }; @@ -3562,17 +3546,14 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi } LayerParentModel.prototype.createGoogleLayer = function() { - var fn; + var _base; if (this.attrs.options == null) { this.layer = this.attrs.namespace === void 0 ? new google.maps[this.attrs.type]() : new google.maps[this.attrs.namespace][this.attrs.type](); } else { this.layer = this.attrs.namespace === void 0 ? new google.maps[this.attrs.type](this.scope.options) : new google.maps[this.attrs.namespace][this.attrs.type](this.scope.options); } if ((this.layer != null) && (this.onLayerCreated != null)) { - fn = this.onLayerCreated(this.scope, this.layer); - if (fn) { - return fn(this.layer); - } + return typeof (_base = this.onLayerCreated(this.scope, this.layer)) === "function" ? _base(this.layer) : void 0; } }; @@ -4924,15 +4905,13 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi }).call(this); (function() { - angular.module("google-maps.directives.api".ns()).factory("DrawingManager".ns(), [ - "IDrawingManager".ns(), "DrawingManagerParentModel".ns(), function(IDrawingManager, DrawingManagerParentModel) { + angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapDrawingManager", [ + "uiGmapIDrawingManager", "uiGmapDrawingManagerParentModel", function(IDrawingManager, DrawingManagerParentModel) { return _.extend(IDrawingManager, { link: function(scope, element, attrs, mapCtrl) { - return mapCtrl.getScope().deferred.promise.then((function(_this) { - return function(map) { - return new DrawingManagerParentModel(scope, element, attrs, map); - }; - })(this)); + return mapCtrl.getScope().deferred.promise.then(function(map) { + return new DrawingManagerParentModel(scope, element, attrs, map); + }); } }); } @@ -4952,8 +4931,8 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api".ns()).factory('ApiFreeDrawPolygons'.ns(), [ - "Logger".ns(), 'BaseObject'.ns(), "CtrlHandle".ns(), "DrawFreeHandChildModel".ns(), function($log, BaseObject, CtrlHandle, DrawFreeHandChildModel) { + angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapApiFreeDrawPolygons', [ + "uiGmapLogger", 'uiGmapBaseObject', "uiGmapCtrlHandle", "uiGmapDrawFreeHandChildModel", function($log, BaseObject, CtrlHandle, DrawFreeHandChildModel) { var FreeDrawPolygons; return FreeDrawPolygons = (function(_super) { __extends(FreeDrawPolygons, _super); @@ -4969,7 +4948,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi FreeDrawPolygons.prototype.replace = true; - FreeDrawPolygons.prototype.require = '^' + 'GoogleMap'.ns(); + FreeDrawPolygons.prototype.require = '^' + 'uiGmapGoogleMap'; FreeDrawPolygons.prototype.scope = { polygons: '=', @@ -5060,12 +5039,11 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi */ (function() { - var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, - __hasProp = {}.hasOwnProperty, + var __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api".ns()).factory("IControl".ns(), [ - "BaseObject".ns(), "Logger".ns(), "CtrlHandle".ns(), function(BaseObject, Logger, CtrlHandle) { + angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIControl", [ + "uiGmapBaseObject", "uiGmapLogger", "uiGmapCtrlHandle", function(BaseObject, Logger, CtrlHandle) { var IControl; return IControl = (function(_super) { __extends(IControl, _super); @@ -5073,10 +5051,9 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi IControl.extend(CtrlHandle); function IControl() { - this.link = __bind(this.link, this); this.restrict = 'EA'; this.replace = true; - this.require = '^' + 'GoogleMap'.ns(); + this.require = '^' + 'uiGmapGoogleMap'; this.scope = { template: '@template', position: '@position', @@ -5099,16 +5076,16 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi }).call(this); (function() { - angular.module("google-maps.directives.api".ns()).service("IDrawingManager".ns(), [ + angular.module('uiGmapgoogle-maps.directives.api').service('uiGmapIDrawingManager', [ function() { return { - restrict: "EA", + restrict: 'EA', replace: true, - require: '^' + 'GoogleMap'.ns(), + require: '^' + 'uiGmapGoogleMap', scope: { - "static": "@", - control: "=", - options: "=" + "static": '@', + control: '=', + options: '=' } }; } @@ -5173,8 +5150,8 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi var __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api".ns()).factory("IPolygon".ns(), [ - "GmapUtil".ns(), "BaseObject".ns(), "Logger".ns(), "CtrlHandle".ns(), function(GmapUtil, BaseObject, Logger, CtrlHandle) { + angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapIPolygon', [ + 'uiGmapGmapUtil', 'uiGmapBaseObject', 'uiGmapLogger', 'uiGmapCtrlHandle', function(GmapUtil, BaseObject, Logger, CtrlHandle) { var IPolygon; return IPolygon = (function(_super) { __extends(IPolygon, _super); @@ -5185,27 +5162,27 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi function IPolygon() {} - IPolygon.prototype.restrict = "EMA"; + IPolygon.prototype.restrict = 'EMA'; IPolygon.prototype.replace = true; - IPolygon.prototype.require = '^' + 'GoogleMap'.ns(); + IPolygon.prototype.require = '^' + 'uiGmapGoogleMap'; IPolygon.prototype.scope = { - path: "=path", - stroke: "=stroke", - clickable: "=", - draggable: "=", - editable: "=", - geodesic: "=", - fill: "=", - icons: "=icons", - visible: "=", - "static": "=", - events: "=", - zIndex: "=zindex", - fit: "=", - control: "=control" + path: '=path', + stroke: '=stroke', + clickable: '=', + draggable: '=', + editable: '=', + geodesic: '=', + fill: '=', + icons: '=icons', + visible: '=', + "static": '=', + events: '=', + zIndex: '=zindex', + fit: '=', + control: '=control' }; IPolygon.prototype.DEFAULTS = {}; @@ -5224,8 +5201,8 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi var __hasProp = {}.hasOwnProperty, __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; }; - angular.module("google-maps.directives.api".ns()).factory("IPolyline".ns(), [ - "GmapUtil".ns(), "BaseObject".ns(), "Logger".ns(), "CtrlHandle".ns(), function(GmapUtil, BaseObject, Logger, CtrlHandle) { + angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapIPolyline', [ + 'uiGmapGmapUtil', 'uiGmapBaseObject', 'uiGmapLogger', 'uiGmapCtrlHandle', function(GmapUtil, BaseObject, Logger, CtrlHandle) { var IPolyline; return IPolyline = (function(_super) { __extends(IPolyline, _super); @@ -5236,24 +5213,24 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi function IPolyline() {} - IPolyline.prototype.restrict = "EMA"; + IPolyline.prototype.restrict = 'EMA'; IPolyline.prototype.replace = true; - IPolyline.prototype.require = '^' + 'GoogleMap'.ns(); + IPolyline.prototype.require = '^' + 'uiGmapGoogleMap'; IPolyline.prototype.scope = { - path: "=", - stroke: "=", - clickable: "=", - draggable: "=", - editable: "=", - geodesic: "=", - icons: "=", - visible: "=", - "static": "=", - fit: "=", - events: "=" + path: '=', + stroke: '=', + clickable: '=', + draggable: '=', + editable: '=', + geodesic: '=', + icons: '=', + visible: '=', + "static": '=', + fit: '=', + events: '=' }; IPolyline.prototype.DEFAULTS = {}; @@ -5269,24 +5246,24 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi }).call(this); (function() { - angular.module("google-maps.directives.api".ns()).service("IRectangle".ns(), [ + angular.module('uiGmapgoogle-maps.directives.api').service('uiGmapIRectangle', [ function() { - "use strict"; + 'use strict'; var DEFAULTS; DEFAULTS = {}; return { - restrict: "EMA", - require: '^' + 'GoogleMap'.ns(), + restrict: 'EMA', + require: '^' + 'uiGmapGoogleMap', replace: true, scope: { - bounds: "=", - stroke: "=", - clickable: "=", - draggable: "=", - editable: "=", - fill: "=", - visible: "=", - events: "=" + bounds: '=', + stroke: '=', + clickable: '=', + draggable: '=', + editable: '=', + fill: '=', + visible: '=', + events: '=' } }; } @@ -5294,17 +5271,12 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi }).call(this); - -/* - - interface directive for all window(s) to derive from - */ - (function() { var __hasProp = {}.hasOwnProperty, __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; }; - angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIWindow", [ - "uiGmapBaseObject", "uiGmapChildEvents", "uiGmapLogger", "uiGmapCtrlHandle", function(BaseObject, ChildEvents, Logger, CtrlHandle) { + angular.module('uiGmapgoogle-maps.directives.api').factory('uiGmapIWindow', [ + 'uiGmapBaseObject', 'uiGmapChildEvents', 'uiGmapLogger', 'uiGmapCtrlHandle', function(BaseObject, ChildEvents, Logger, CtrlHandle) { var IWindow; return IWindow = (function(_super) { __extends(IWindow, _super); @@ -5318,7 +5290,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi this.template = void 0; this.transclude = true; this.priority = -100; - this.require = '^' + 'GoogleMap'.ns(); + this.require = '^' + 'uiGmapGoogleMap'; this.replace = true; this.scope = { coords: '=coords', @@ -5466,7 +5438,7 @@ Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawi bounds: scope.bounds }); _m = new google.maps.Map(el.find("div")[1], mapOptions); - _m['_id'.ns()] = uuid.generate(); + _m['uiGmap_id'] = uuid.generate(); dragging = false; google.maps.event.addListenerOnce(_m, 'idle', function() { scope.deferred.resolve(_m); @@ -6861,7 +6833,7 @@ angular.module('google-maps.wrapped'.ns()).service('GoogleMapsUtilV3'.ns(), func return { init: _.once(function () { //BEGIN REPLACE - /*! angular-google-maps 2.0.7 2014-11-04 + /*! angular-google-maps 2.0.7 2014-11-11 * AngularJS directives for Google Maps * git: https://github.com/angular-ui/angular-google-maps.git */ diff --git a/dist/angular-google-maps.min.js b/dist/angular-google-maps.min.js index 2912ece69..81583bdd0 100644 --- a/dist/angular-google-maps.min.js +++ b/dist/angular-google-maps.min.js @@ -1,9 +1,9 @@ -/*! angular-google-maps 2.0.7 2014-11-04 +/*! angular-google-maps 2.0.7 2014-11-11 * AngularJS directives for Google Maps * git: https://github.com/angular-ui/angular-google-maps.git */ -(function(){String.prototype.contains=function(a,b){return-1!==this.indexOf(a,b)},String.prototype.flare=function(a){return null==a&&(a="uiGmap"),a+this},String.prototype.ns=String.prototype.flare}).call(this),function(){_.intersectionObjects=function(a,b,c){var d;return null==c&&(c=void 0),d=_.map(a,function(){return function(a){return _.find(b,function(b){return null!=c?c(a,b):_.isEqual(a,b)})}}(this)),_.filter(d,function(a){return null!=a})},_.containsObject=_.includeObject=function(a,b,c){return null==c&&(c=void 0),null===a?!1:_.any(a,function(){return function(a){return null!=c?c(a,b):_.isEqual(a,b)}}(this))},_.differenceObjects=function(a,b,c){return null==c&&(c=void 0),_.filter(a,function(a){return!_.containsObject(b,a,c)})},_.withoutObjects=_.differenceObjects,_.indexOfObject=function(a,b,c,d){var e,f;if(null==a)return-1;if(e=0,f=a.length,d){if("number"!=typeof d)return e=_.sortedIndex(a,b),a[e]===b?e:-1;e=0>d?Math.max(0,f+d):d}for(;f>e;){if(null!=c){if(c(a[e],b))return e}else if(_.isEqual(a[e],b))return e;e++}return-1},_["extends"]=function(a){return _.reduce(a,function(a,b){return _.extend(a,b)},{})},_.isNullOrUndefined=function(a){return _.isNull(a||_.isUndefined(a))}}.call(this),function(){angular.module("uiGmapgoogle-maps.providers",[]),angular.module("uiGmapgoogle-maps.wrapped",[]),angular.module("uiGmapgoogle-maps.extensions",["uiGmapgoogle-maps.wrapped","uiGmapgoogle-maps.providers"]),angular.module("uiGmapgoogle-maps.directives.api.utils",["uiGmapgoogle-maps.extensions"]),angular.module("uiGmapgoogle-maps.directives.api.managers",[]),angular.module("uiGmapgoogle-maps.directives.api.options",["uiGmapgoogle-maps.directives.api.utils"]),angular.module("uiGmapgoogle-maps.directives.api.options.builders",[]),angular.module("uiGmapgoogle-maps.directives.api.models.child",["uiGmapgoogle-maps.directives.api.utils","uiGmapgoogle-maps.directives.api.options","uiGmapgoogle-maps.directives.api.options.builders"]),angular.module("uiGmapgoogle-maps.directives.api.models.parent",["uiGmapgoogle-maps.directives.api.managers","uiGmapgoogle-maps.directives.api.models.child","uiGmapgoogle-maps.providers"]),angular.module("uiGmapgoogle-maps.directives.api",["uiGmapgoogle-maps.directives.api.models.parent"]),angular.module("uiGmapgoogle-maps",["uiGmapgoogle-maps.directives.api","uiGmapgoogle-maps.providers"]).factory("uiGmapdebounce",["$timeout",function(a){return function(b){var c;return c=0,function(){var d,e,f;return f=this,d=arguments,c++,e=function(a){return function(){return a===c?b.apply(f,d):void 0}}(c),a(e,0,!0)}}}])}.call(this),function(){angular.module("google-maps.providers".ns()).factory("MapScriptLoader".ns(),["$q","uuid".ns(),function(a,b){var c,d;return d=void 0,c=function(a){return a.china?"http://maps.google.cn/maps/api/js?":"https://maps.googleapis.com/maps/api/js?"},{load:function(e){var f,g,h,i;return f=a.defer(),angular.isDefined(window.google)&&angular.isDefined(window.google.maps)?(f.resolve(window.google.maps),f.promise):(h=e.callback="onGoogleMapsReady"+Math.round(1e3*Math.random()),window[h]=function(){window[h]=null,f.resolve(window.google.maps)},g=_.map(e,function(a,b){return b+"="+a}),d&&document.getElementById(d).remove(),g=g.join("&"),i=document.createElement("script"),d="ui_gmap_map_load_"+b.generate(),i.id=d,i.type="text/javascript",i.src=c(e)+g,document.body.appendChild(i),f.promise)}}}]).provider("GoogleMapApi".ns(),function(){return this.options={china:!1,v:"3.17",libraries:"",language:"en",sensor:"false"},this.configure=function(a){angular.extend(this.options,a)},this.$get=["MapScriptLoader".ns(),function(a){return function(b){return b.load(a.options)}}(this)],this})}.call(this),function(){angular.module("google-maps.extensions".ns()).service("ExtendGWin".ns(),function(){return{init:_.once(function(){return google||("undefined"!=typeof google&&null!==google?google.maps:void 0)||null!=google.maps.InfoWindow?(google.maps.InfoWindow.prototype._open=google.maps.InfoWindow.prototype.open,google.maps.InfoWindow.prototype._close=google.maps.InfoWindow.prototype.close,google.maps.InfoWindow.prototype._isOpen=!1,google.maps.InfoWindow.prototype.open=function(a,b,c){null==c&&(this._isOpen=!0,this._open(a,b,!0))},google.maps.InfoWindow.prototype.close=function(a){null==a&&(this._isOpen=!1,this._close(!0))},google.maps.InfoWindow.prototype.isOpen=function(a){return null==a&&(a=void 0),null==a?this._isOpen:this._isOpen=a},window.InfoBox&&(window.InfoBox.prototype._open=window.InfoBox.prototype.open,window.InfoBox.prototype._close=window.InfoBox.prototype.close,window.InfoBox.prototype._isOpen=!1,window.InfoBox.prototype.open=function(a,b){this._isOpen=!0,this._open(a,b)},window.InfoBox.prototype.close=function(){this._isOpen=!1,this._close()},window.InfoBox.prototype.isOpen=function(a){return null==a&&(a=void 0),null==a?this._isOpen:this._isOpen=a}),window.MarkerLabel_?(window.MarkerLabel_.prototype.setContent=function(){var a;a=this.marker_.get("labelContent"),a&&!_.isEqual(this.oldContent,a)&&("undefined"==typeof(null!=a?a.nodeType:void 0)?(this.labelDiv_.innerHTML=a,this.eventDiv_.innerHTML=this.labelDiv_.innerHTML,this.oldContent=a):(this.labelDiv_.innerHTML="",this.labelDiv_.appendChild(a),a=a.cloneNode(!0),this.eventDiv_.appendChild(a),this.oldContent=a))},window.MarkerLabel_.prototype.onRemove=function(){null!=this.labelDiv_.parentNode&&this.labelDiv_.parentNode.removeChild(this.labelDiv_),null!=this.eventDiv_.parentNode&&this.eventDiv_.parentNode.removeChild(this.eventDiv_),this.listeners_&&this.listeners_.length&&this.listeners_.forEach(function(a){return google.maps.event.removeListener(a)})}):void 0):void 0})}})}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api.utils").service("_sync".ns(),[function(){return{fakePromise:function(){var a;return a=void 0,{then:function(b){return a=b},resolve:function(){return a.apply(void 0,arguments)}}}}}]).service("uiGmap_async",["$timeout","uiGmapPromise",function(a,b){var c,d,e,f,g;return c=20,g=function(a,b){return a.existingPieces=a.existingPieces?a.existingPieces.then(function(){return b()}):b()},d=function(b,c,e,f,g,h,i){var j,k,l;try{for(j=c&&c0?e(a,function(a){return i.push(c(a))},d,f,g,h).then(function(){return i}):b.resolve(i)},{each:e,map:f,waitOrGo:g,defaultChunkSize:c}}])}.call(this),function(){var a=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};angular.module("google-maps.directives.api.utils".ns()).factory("BaseObject".ns(),function(){var b,c;return c=["extended","included"],b=function(){function b(){}return b.extend=function(b){var d,e,f;for(d in b)e=b[d],a.call(c,d)<0&&(this[d]=e);return null!=(f=b.extended)&&f.apply(this),this},b.include=function(b){var d,e,f;for(d in b)e=b[d],a.call(c,d)<0&&(this.prototype[d]=e);return null!=(f=b.included)&&f.apply(this),this},b}()})}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).factory("ChildEvents".ns(),function(){return{onChildCreation:function(){}}})}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).service("CtrlHandle".ns(),["$q",function(a){var b;return b={handle:function(c){return c.$on("$destroy",function(){return b.handle(c)}),c.deferred=a.defer(),{getScope:function(){return c}}},mapPromise:function(a,b){var c;return c=b.getScope(),c.deferred.promise.then(function(b){return a.map=b}),c.deferred.promise}}}])}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).service("EventsHelper".ns(),["Logger".ns(),function(){return{setEvents:function(a,b,c,d){return angular.isDefined(b.events)&&null!=b.events&&angular.isObject(b.events)?_.compact(_.map(b.events,function(e,f){var g;return d&&(g=_(d).contains(f)),b.events.hasOwnProperty(f)&&angular.isFunction(b.events[f])&&!g?google.maps.event.addListener(a,f,function(){return b.$evalAsync(e.apply(b,[a,f,c,arguments]))}):void 0})):void 0},removeEvents:function(a){return null!=a?a.forEach(function(a){return google.maps.event.removeListener(a)}):void 0}}}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.utils".ns()).factory("FitHelper".ns(),["BaseObject".ns(),"Logger".ns(),"_async".ns(),function(a,c,d){var e;return e=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.fit=function(a,b){var c,e;return b&&a&&a.length>0?(c=new google.maps.LatLngBounds,e=!1,d.each(a,function(){return function(a){return a?(e||(e=!0),c.extend(a.getPosition())):void 0}}(this)).then(function(){return e?b.fitBounds(c):void 0})):void 0},c}(a)}])}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).service("GmapUtil".ns(),["Logger".ns(),"$compile",function(a,b){var c,d,e,f;return d=function(a){return Array.isArray(a)&&2===a.length?a[1]:angular.isDefined(a.type)&&"Point"===a.type?a.coordinates[1]:a.latitude},e=function(a){return Array.isArray(a)&&2===a.length?a[0]:angular.isDefined(a.type)&&"Point"===a.type?a.coordinates[0]:a.longitude},c=function(a){return a?Array.isArray(a)&&2===a.length?new google.maps.LatLng(a[1],a[0]):angular.isDefined(a.type)&&"Point"===a.type?new google.maps.LatLng(a.coordinates[1],a.coordinates[0]):new google.maps.LatLng(a.latitude,a.longitude):void 0},f=function(a){if(angular.isUndefined(a))return!1;if(_.isArray(a)){if(2===a.length)return!0}else if(null!=a&&(null!=a?a.type:void 0)&&"Point"===a.type&&_.isArray(a.coordinates)&&2===a.coordinates.length)return!0;return a&&angular.isDefined((null!=a?a.latitude:void 0)&&angular.isDefined(null!=a?a.longitude:void 0))?!0:!1},{setCoordsFromEvent:function(a,b){return a?(Array.isArray(a)&&2===a.length?(a[1]=b.lat(),a[0]=b.lng()):angular.isDefined(a.type)&&"Point"===a.type?(a.coordinates[1]=b.lat(),a.coordinates[0]=b.lng()):(a.latitude=b.lat(),a.longitude=b.lng()),a):void 0},getLabelPositionPoint:function(a){var b,c;return void 0===a?void 0:(a=/^([-\d\.]+)\s([-\d\.]+)$/.exec(a),b=parseFloat(a[1]),c=parseFloat(a[2]),null!=b&&null!=c?new google.maps.Point(b,c):void 0)},createWindowOptions:function(d,e,f,g){var h;return null!=f&&null!=g&&null!=b?(h=angular.extend({},g,{content:this.buildContent(e,g,f),position:null!=g.position?g.position:angular.isObject(d)?d.getPosition():c(e.coords)}),null!=d&&null==(null!=h?h.pixelOffset:void 0)&&(null==h.boxClass||(h.pixelOffset={height:0,width:-2})),h):g?g:(a.error("infoWindow defaults not defined"),f?void 0:a.error("infoWindow content not defined"))},buildContent:function(a,c,d){var e,f;return null!=c.content?f=c.content:null!=b?(d=d.replace(/^\s+|\s+$/g,""),e=""===d?"":b(d)(a),e.length>0&&(f=e[0])):f=d,f},defaultDelay:50,isTrue:function(a){return angular.isDefined(a)&&null!==a&&a===!0||"1"===a||"y"===a||"true"===a},isFalse:function(a){return-1!==["false","FALSE",0,"n","N","no","NO"].indexOf(a)},getCoords:c,validateCoords:f,equalCoords:function(a,b){return d(a)===d(b)&&e(a)===e(b)},validatePath:function(a){var b,c,d,e;if(c=0,angular.isUndefined(a.type)){if(!Array.isArray(a)||a.length<2)return!1;for(;cthis.max?(this.max=a[0].length,this.index=b):void 0},e),d=a.coordinates[e.index],b=d[0],b.length<4)return!1}else{if("LineString"!==a.type)return!1;if(a.coordinates.length<2)return!1;b=a.coordinates}for(;cthis.max?(this.max=a[0].length,this.index=b):void 0},f),b=a.coordinates[f.index][0]):"LineString"===a.type&&(b=a.coordinates);cd;)l=j.getAt(d),h=a[d],"function"==typeof h.equals?h.equals(l)||(j.setAt(d,h),c=!0):(l.lat()!==h.latitude||l.lng()!==h.longitude)&&(j.setAt(d,new google.maps.LatLng(h.latitude,h.longitude)),c=!0),d++;for(;g>d;)h=a[d],j.push("function"==typeof h.lat&&"function"==typeof h.lng?h:new google.maps.LatLng(h.latitude,h.longitude)),c=!0,d++;for(;k>d;)j.pop(),c=!0,d++}return i=!1,c?e(j):void 0},h=function(a){var c,d,f,g,h,j,k,l,n;if(i=!0,k=b,d=!1,a){for("Polygon"===m.type?c=a.coordinates[0]:"LineString"===m.type&&(c=a.coordinates),f=0,l=k.getLength(),h=c.length,g=Math.min(l,h),j=void 0;g>f;)n=k.getAt(f),j=c[f],(n.lat()!==j[1]||n.lng()!==j[0])&&(k.setAt(f,new google.maps.LatLng(j[1],j[0])),d=!0),f++;for(;h>f;)j=c[f],k.push(new google.maps.LatLng(j[1],j[0])),d=!0,f++;for(;l>f;)k.pop(),d=!0,f++}return i=!1,d?e(k):void 0},c["static"]||(n=angular.isUndefined(m.type)?c.$watchCollection(d,k):c.$watch(d,h,!0)),function(){return l&&(l(),l=null),n?(n(),n=null):void 0}}}])}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).factory("ChromeFixes".ns(),[function(){return{maybeRepaint:function(a){var b;return a?(b=a.style.display,a.style.display="none",_.defer(function(){return a.style.display=b})):void 0}}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.options.builders".ns()).service("CommonOptionsBuilder".ns(),["BaseObject".ns(),"Logger".ns(),function(b,d){var e;return e=function(b){function e(){return this.watchProps=a(this.watchProps,this),this.buildOpts=a(this.buildOpts,this),e.__super__.constructor.apply(this,arguments)}return c(e,b),e.prototype.props=["clickable","draggable","editable","visible",{prop:"stroke",isColl:!0}],e.prototype.buildOpts=function(a,b){var c,e,f,g,h,i;return null==a&&(a={}),null==b&&(b={}),this.scope?this.map?(c=_(this.scope).chain().keys().contains("model").value(),e=c?this.scope.model:this.scope,f=angular.extend(a,this.DEFAULTS,{map:this.map,strokeColor:null!=(g=e.stroke)?g.color:void 0,strokeOpacity:null!=(h=e.stroke)?h.opacity:void 0,strokeWeight:null!=(i=e.stroke)?i.weight:void 0}),angular.forEach(angular.extend(b,{clickable:!0,draggable:!1,editable:!1,"static":!1,fit:!1,visible:!0,zIndex:0}),function(){return function(a,b){return f[b]=angular.isUndefined(e[b]||null===e[b])?a:e[b]}}(this)),f["static"]&&(f.editable=!1),f):void d.error("this.map not defined in CommonOptionsBuilder can not buildOpts"):void d.error("this.scope not defined in CommonOptionsBuilder can not buildOpts")},e.prototype.watchProps=function(a){return null==a&&(a=this.props),a.forEach(function(a){return function(b){return null!=a.attrs[b]||null!=a.attrs[null!=b?b.prop:void 0]?(null!=b?b.isColl:void 0)?a.scope.$watchCollection(b.prop,a.setMyOptions):a.scope.$watch(b,a.setMyOptions):void 0}}(this))},e}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.options.builders".ns()).factory("PolylineOptionsBuilder".ns(),["CommonOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a){return c.__super__.buildOpts.call(this,{path:a},{geodesic:!1})},c}(a)}]).factory("ShapeOptionsBuilder".ns(),["CommonOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a,b){var d,e;return a=angular.extend(a,{fillColor:null!=(d=this.scope.fill)?d.color:void 0,fillOpacity:null!=(e=this.scope.fill)?e.opacity:void 0}),c.__super__.buildOpts.call(this,a,b)},c}(a)}]).factory("PolygonOptionsBuilder".ns(),["ShapeOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a){return c.__super__.buildOpts.call(this,{path:a},{geodesic:!1})},c}(a)}]).factory("RectangleOptionsBuilder".ns(),["ShapeOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a){return c.__super__.buildOpts.call(this,{bounds:a})},c}(a)}]).factory("CircleOptionsBuilder".ns(),["ShapeOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments) -}return b(c,a),c.prototype.buildOpts=function(a,b){return c.__super__.buildOpts.call(this,{center:a,radius:b})},c}(a)}])}.call(this),function(){angular.module("google-maps.directives.api.options".ns()).service("MarkerOptions".ns(),["Logger".ns(),"GmapUtil".ns(),function(a,b){return _.extend(b,{createOptions:function(a,c,d,e){var f;return null==e&&(e=void 0),null==d&&(d={}),f=angular.extend({},d,{position:null!=d.position?d.position:b.getCoords(a),visible:null!=d.visible?d.visible:b.validateCoords(a)}),(null!=d.icon||null!=c)&&(f=angular.extend(f,{icon:null!=d.icon?d.icon:c})),null!=e&&(f.map=e),f},isLabel:function(a){return null!=a.labelContent||null!=a.labelAnchor||null!=a.labelClass||null!=a.labelStyle||null!=a.labelVisible?!0:!1}})}])}.call(this),function(){angular.module("google-maps.directives.api.models.child".ns()).factory("DrawFreeHandChildModel".ns(),["Logger".ns(),"$q",function(a,b){var c,d;return c=function(a,b,c){var d,e;return this.polys=b,e=new google.maps.Polyline({map:a,clickable:!1}),d=google.maps.event.addListener(a,"mousemove",function(a){return e.getPath().push(a.latLng)}),void google.maps.event.addListenerOnce(a,"mouseup",function(){var f;return google.maps.event.removeListener(d),f=e.getPath(),e.setMap(null),b.push(new google.maps.Polygon({map:a,path:f})),e=null,google.maps.event.clearListeners(a.getDiv(),"mousedown"),c()})},d=function(d){var e,f;return this.map=d,f=function(a){return function(){var b;return null!=(b=a.deferred)&&b.resolve(),a.map.setOptions(a.oldOptions)}}(this),e=function(b){return function(){return a.info("disabling map move"),b.oldOptions=d.getOptions(),b.map.setOptions({draggable:!1,zoomControl:!1,scrollwheel:!1,disableDoubleClickZoom:!1})}}(this),this.engage=function(d){return function(g){return d.polys=g,d.deferred=b.defer(),e(),a.info("DrawFreeHandChildModel is engaged (drawing)."),google.maps.event.addDomListener(d.map.getDiv(),"mousedown",function(){return c(d.map,d.polys,f)}),d.deferred.promise}}(this),this}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.child".ns()).factory("MarkerChildModel".ns(),["ModelKey".ns(),"GmapUtil".ns(),"Logger".ns(),"EventsHelper".ns(),"PropertyAction".ns(),"MarkerOptions".ns(),"IMarker".ns(),"MarkerManager".ns(),"uiGmapPromise",function(b,d,e,f,g,h,i,j,k){var l,m;return m=["coords","icon","options","fit"],l=function(b){function l(b,c,d,f,h,j,n,o,p,q){var r,s;this.model=c,this.keys=d,this.gMap=f,this.defaults=h,this.doClick=j,this.gMarkerManager=n,this.doDrawSelf=null!=o?o:!0,this.trackModel=null!=p?p:!0,this.needRedraw=null!=q?q:!1,this.internalEvents=a(this.internalEvents,this),this.setLabelOptions=a(this.setLabelOptions,this),this.setOptions=a(this.setOptions,this),this.setIcon=a(this.setIcon,this),this.setCoords=a(this.setCoords,this),this.isNotValid=a(this.isNotValid,this),this.maybeSetScopeValue=a(this.maybeSetScopeValue,this),this.createMarker=a(this.createMarker,this),this.setMyScope=a(this.setMyScope,this),this.destroy=a(this.destroy,this),this.deferred=k.defer(),_.each(this.keys,function(a){return function(b,c){return a[c+"Key"]=_.isFunction(a.keys[c])?a.keys[c]():a.keys[c]}}(this)),this.idKey=this.idKeyKey||"id",null!=this.model[this.idKey]&&(this.id=this.model[this.idKey]),l.__super__.constructor.call(this,b),this.setMyScope("all",this.model,void 0,!0),this.scope.getGMarker=function(a){return function(){return a.gMarker}}(this),this.createMarker(this.model),s=!0,this.trackModel?(this.scope.model=this.model,this.scope.$watch("model",function(a){return function(b,c){var d;return b!==c?(d=a.getChanges(b,c,i.keys),_.each(d,function(d,e){return a.setMyScope(e,b,c),a.needRedraw=!0})):void 0}}(this),!0)):(r=new g(function(a){return function(c){return a.setMyScope(c,b)}}(this),!1),_.each(this.keys,function(a,c){return b.$watch(c,r.sic,!0)})),this.scope.$on("$destroy",function(a){return function(){return m(a)}}(this)),e.info(this)}var m;return c(l,b),l.include(d),l.include(f),l.include(h),m=function(a){return null!=(null!=a?a.gMarker:void 0)&&(a.removeEvents(a.externalListeners),a.removeEvents(a.internalListeners),null!=a?a.gMarker:void 0)?(a.removeFromManager&&a.gMarkerManager.remove(a.gMarker),a.gMarker.setMap(null),a.gMarker=null):void 0},l.prototype.destroy=function(a){return null==a&&(a=!0),this.removeFromManager=a,this.scope.$destroy()},l.prototype.setMyScope=function(a,b,c,d){var e;switch(null==c&&(c=void 0),null==d&&(d=!1),null==b&&(b=this.model),this.gMarker||(this.setOptions(this.scope),e=!0),a){case"all":return _.each(this.keys,function(a){return function(e,f){return a.setMyScope(f,b,c,d)}}(this));case"icon":return this.maybeSetScopeValue("icon",b,c,this.iconKey,this.evalModelHandle,d,this.setIcon);case"coords":return this.maybeSetScopeValue("coords",b,c,this.coordsKey,this.evalModelHandle,d,this.setCoords);case"options":if(!e)return this.createMarker(b,c,d)}},l.prototype.createMarker=function(a,b,c){return null==b&&(b=void 0),null==c&&(c=!1),this.maybeSetScopeValue("options",a,b,this.optionsKey,this.evalModelHandle,c,this.setOptions)},l.prototype.maybeSetScopeValue=function(a,b,c,d,e,f,g){var h,i;return null==g&&(g=void 0),void 0===c?(this.scope[a]=e(b,d),void(null!=g&&g(this.scope))):(i=e(c,d),h=e(b,d),h!==i&&(this.scope[a]=h,!f&&(null!=g&&g(this.scope),this.doDrawSelf))?this.gMarkerManager.draw():void 0)},l.prototype.isNotValid=function(a,b){var c,d;return null==b&&(b=!0),d=b?void 0===this.gMarker:!1,c=this.trackModel?!1:a.$id!==this.scope.$id,c||d},l.prototype.setCoords=function(a){return this.isNotValid(a)||null==this.gMarker?void 0:null!=this.getProp(this.coordsKey,this.model)?this.validateCoords(this.getProp(this.coordsKey,this.model))?(this.gMarker.setPosition(this.getCoords(this.getProp(this.coordsKey,this.model))),this.gMarker.setVisible(this.validateCoords(this.getProp(this.coordsKey,this.model))),this.gMarkerManager.add(this.gMarker)):void e.debug("MarkerChild does not have coords yet. They may be defined later."):this.gMarkerManager.remove(this.gMarker)},l.prototype.setIcon=function(a){return this.isNotValid(a)||null==this.gMarker?void 0:(this.gMarker.setIcon(this.getProp(this.iconKey,this.model)),this.gMarkerManager.add(this.gMarker),this.gMarker.setPosition(this.getCoords(this.getProp(this.coordsKey,this.model))),this.gMarker.setVisible(this.validateCoords(this.getProp(this.coordsKey,this.model))))},l.prototype.setOptions=function(a){var b,c,d;if(!this.isNotValid(a,!1)&&null!=a.coords)return b=this.getProp(this.coordsKey,this.model),c=this.getProp(this.iconKey,this.model),d=this.getProp(this.optionsKey,this.model),this.opts=this.createOptions(b,c,d),null!=this.gMarker&&this.isLabel(this.gMarker===this.isLabel(this.opts))?this.gMarker.setOptions(this.opts):null!=this.gMarker&&(this.gMarkerManager.remove(this.gMarker),this.gMarker=null),this.gMarker||(this.gMarker=this.isLabel(this.opts)?new MarkerWithLabel(this.setLabelOptions(this.opts)):new google.maps.Marker(this.opts)),this.externalListeners&&this.removeEvents(this.externalListeners),this.internalListeners&&this.removeEvents(this.internalListeners),this.externalListeners=this.setEvents(this.gMarker,this.scope,this.model,["dragend"]),this.internalListeners=this.setEvents(this.gMarker,{events:this.internalEvents(),$evalAsync:function(){}},this.model),null!=this.id&&(this.gMarker.key=this.id),this.gMarkerManager.add(this.gMarker),this.gMarker&&(this.gMarker.getMap()||this.gMarkerManager.type!==j.type)?this.deferred.resolve(this.gMarker):(this.gMarker||this.deferred.reject("gMarker is null"),this.gMarker.getMap()&&this.gMarkerManager.type===j.type||(e.warn("gMarker has no map yet"),this.deferred.resolve(this.gMarker))),this.model[this.fitKey]?this.gMarkerManager.fit():void 0},l.prototype.setLabelOptions=function(a){return a.labelAnchor=this.getLabelPositionPoint(a.labelAnchor),a},l.prototype.internalEvents=function(){return{dragend:function(a){return function(b,c,d,e){var f,g,h;return g=a.trackModel?a.scope.model:a.model,h=a.setCoordsFromEvent(a.modelOrKey(g,a.coordsKey),a.gMarker.getPosition()),g=a.setVal(d,a.coordsKey,h),f=a.scope.events,null!=(null!=f?f.dragend:void 0)&&f.dragend(b,c,g,e),a.scope.$apply()}}(this),click:function(a){return function(b,c,d,e){var f;return f=_.isFunction(a.clickKey)?a.clickKey:a.getProp(a.clickKey,a.model),a.doClick&&null!=f?a.scope.$evalAsync(f(b,c,a.model,e)):void 0}}(this)}},l}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api".ns()).factory("PolygonChildModel".ns(),["PolygonOptionsBuilder".ns(),"Logger".ns(),"$timeout","array-sync".ns(),"GmapUtil".ns(),"EventsHelper".ns(),function(a,c,d,e,f,g){var h;return h=function(a){function d(a,b,d,f,h){var i,j,k;return this.scope=a,this.attrs=b,this.map=d,this.defaults=f,this.model=h,this.listeners=void 0,angular.isUndefined(a.path)||null===a.path||!this.validatePath(a.path)?void c.error("polygon: no valid path attribute found"):(j=this.convertPathPoints(a.path),k=new google.maps.Polygon(this.buildOpts(j)),a.fit&&this.extendMapBounds(this.map,j),!a["static"]&&angular.isDefined(a.editable)&&a.$watch("editable",function(a,b){return a!==b?k.setEditable(a):void 0}),angular.isDefined(a.draggable)&&a.$watch("draggable",function(a,b){return a!==b?k.setDraggable(a):void 0}),angular.isDefined(a.visible)&&a.$watch("visible",function(a,b){return a!==b?k.setVisible(a):void 0}),angular.isDefined(a.geodesic)&&a.$watch("geodesic",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.stroke)&&angular.isDefined(a.stroke.opacity)&&a.$watch("stroke.opacity",function(a){return function(){return k.setOptions(a.buildOpts(k.getPath()))}}(this)),angular.isDefined(a.stroke)&&angular.isDefined(a.stroke.weight)&&a.$watch("stroke.weight",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.stroke)&&angular.isDefined(a.stroke.color)&&a.$watch("stroke.color",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.fill)&&angular.isDefined(a.fill.color)&&a.$watch("fill.color",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.fill)&&angular.isDefined(a.fill.opacity)&&a.$watch("fill.opacity",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.zIndex)&&a.$watch("zIndex",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.events)&&null!==a.events&&angular.isObject(a.events)&&(this.listeners=g.setEvents(k,a,a)),i=e(k.getPath(),a,"path",function(b){return function(c){return a.fit?b.extendMapBounds(b.map,c):void 0}}(this)),void a.$on("$destroy",function(a){return function(){return k.setMap(null),a.removeEvents(a.listeners),i?(i(),i=null):void 0}}(this)))}return b(d,a),d.include(f),d.include(g),d}(a)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("PolylineChildModel".ns(),["PolylineOptionsBuilder".ns(),"Logger".ns(),"$timeout","array-sync".ns(),"GmapUtil".ns(),"EventsHelper".ns(),function(b,d,e,f,g,h){var i;return i=function(b){function e(b,c,e,g,h){var i;this.scope=b,this.attrs=c,this.map=e,this.defaults=g,this.model=h,this.clean=a(this.clean,this),i=function(a){return function(){var b;return b=a.convertPathPoints(a.scope.path),null!=a.polyline&&a.clean(),b.length>0&&(a.polyline=new google.maps.Polyline(a.buildOpts(b))),a.polyline?(a.scope.fit&&a.extendMapBounds(e,b),f(a.polyline.getPath(),a.scope,"path",function(b){return a.scope.fit?a.extendMapBounds(e,b):void 0}),a.listeners=a.model?a.setEvents(a.polyline,a.scope,a.model):a.setEvents(a.polyline,a.scope,a.scope)):void 0}}(this),i(),b.$watch("path",function(a){return function(b,c){return _.isEqual(b,c)&&a.polyline?void 0:i()}}(this)),!b["static"]&&angular.isDefined(b.editable)&&b.$watch("editable",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setEditable(b):void 0}}(this)),angular.isDefined(b.draggable)&&b.$watch("draggable",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setDraggable(b):void 0}}(this)),angular.isDefined(b.visible)&&b.$watch("visible",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setVisible(b):void 0}}(this)),angular.isDefined(b.geodesic)&&b.$watch("geodesic",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.stroke)&&angular.isDefined(b.stroke.weight)&&b.$watch("stroke.weight",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.stroke)&&angular.isDefined(b.stroke.color)&&b.$watch("stroke.color",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.stroke)&&angular.isDefined(b.stroke.opacity)&&b.$watch("stroke.opacity",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.icons)&&b.$watch("icons",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),b.$on("$destroy",function(a){return function(){return a.clean(),a.scope=null}}(this)),d.info(this)}return c(e,b),e.include(g),e.include(h),e.prototype.clean=function(){var a,b;return this.removeEvents(this.listeners),null!=(b=this.polyline)&&b.setMap(null),this.polyline=null,a?(a(),a=null):void 0},e.prototype.destroy=function(){return this.scope.$destroy()},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.child".ns()).factory("WindowChildModel".ns(),["BaseObject".ns(),"GmapUtil".ns(),"Logger".ns(),"$compile","$http","$templateCache","uiGmapChromeFixes",function(b,d,e,f,g,h,i){var j;return j=function(b){function j(b,c,d,f,g,h,i,j,k){this.model=b,this.scope=c,this.opts=d,this.isIconVisibleOnClick=f,this.mapCtrl=g,this.markerScope=h,this.element=i,this.needToManualDestroy=null!=j?j:!1,this.markerIsVisibleAfterWindowClose=null!=k?k:!0,this.destroy=a(this.destroy,this),this.remove=a(this.remove,this),this.getLatestPosition=a(this.getLatestPosition,this),this.hideWindow=a(this.hideWindow,this),this.showWindow=a(this.showWindow,this),this.handleClick=a(this.handleClick,this),this.watchOptions=a(this.watchOptions,this),this.watchCoords=a(this.watchCoords,this),this.createGWin=a(this.createGWin,this),this.watchElement=a(this.watchElement,this),this.watchAndDoShow=a(this.watchAndDoShow,this),this.doShow=a(this.doShow,this),this.getGmarker=function(){var a,b;return null!=(null!=(a=this.markerScope)?a.getGMarker:void 0)&&null!=(b=this.markerScope)?b.getGMarker():void 0},this.googleMapsHandles=[],this.createGWin(),null!=this.getGmarker()&&this.getGmarker().setClickable(!0),this.watchElement(),this.watchOptions(),this.watchCoords(),this.watchAndDoShow(),this.scope.$on("$destroy",function(a){return function(){return a.destroy()}}(this)),e.info(this)}return c(j,b),j.include(d),j.prototype.doShow=function(){return this.scope.show?this.showWindow():this.hideWindow()},j.prototype.watchAndDoShow=function(){return null!=this.model.show&&(this.scope.show=this.model.show),this.scope.$watch("show",this.doShow,!0),this.doShow()},j.prototype.watchElement=function(){return this.scope.$watch(function(a){return function(){var b;if(a.element||a.html)return a.html!==a.element.html()&&a.gWin?(null!=(b=a.opts)&&(b.content=void 0),a.remove(),a.createGWin()):void 0}}(this))},j.prototype.createGWin=function(){var a,b,c,d;return null==this.gWin&&(a={},null!=this.opts&&(this.scope.coords&&(this.opts.position=this.getCoords(this.scope.coords)),a=this.opts),this.element&&(this.html=_.isObject(this.element)?this.element.html():this.element),b=this.scope.options?this.scope.options:a,this.opts=this.createWindowOptions(this.getGmarker(),this.markerScope||this.scope,this.html,b)),null==this.opts||this.gWin?void 0:(this.gWin=this.opts.boxClass&&window.InfoBox&&"function"==typeof window.InfoBox?new window.InfoBox(this.opts):new google.maps.InfoWindow(this.opts),this.handleClick(null!=(c=this.scope)&&null!=(d=c.options)?d.forceClick:void 0),this.doShow(),this.googleMapsHandles.push(google.maps.event.addListener(this.gWin,"closeclick",function(a){return function(){return a.getGmarker()&&(a.getGmarker().setAnimation(a.oldMarkerAnimation),a.markerIsVisibleAfterWindowClose&&_.delay(function(){return a.getGmarker().setVisible(!1),a.getGmarker().setVisible(a.markerIsVisibleAfterWindowClose)},250)),a.gWin.isOpen(!1),a.model.show=!1,null!=a.scope.closeClick?a.scope.$apply(a.scope.closeClick()):a.scope.$apply()}}(this))))},j.prototype.watchCoords=function(){var a;return a=null!=this.markerScope?this.markerScope:this.scope,a.$watch("coords",function(a){return function(b,c){var d;if(b!==c){if(null==b)a.hideWindow();else if(!a.validateCoords(b))return void e.error("WindowChildMarker cannot render marker as scope.coords as no position on marker: "+JSON.stringify(a.model));if(d=a.getCoords(b),a.gWin.setPosition(d),a.opts)return a.opts.position=d}}}(this),!0)},j.prototype.watchOptions=function(){return this.scope.$watch("options",function(a){return function(b,c){if(b!==c&&(a.opts=b,null!=a.gWin)){if(a.gWin.setOptions(a.opts),null!=a.opts.visible&&a.opts.visible)return a.showWindow();if(null!=a.opts.visible)return a.hideWindow()}}}(this),!0)},j.prototype.handleClick=function(a){var b;if(null!=this.gWin)return b=function(a){return function(){var b,c,d;return null==a.gWin&&a.createGWin(),(b=null!=a.scope.coords?null!=(c=a.gWin)?c.getPosition():void 0:null!=(d=a.getGmarker())?d.getPosition():void 0)?(null!=a.gWin&&(a.gWin.setPosition(b),a.opts&&(a.opts.position=b),a.showWindow()),null!=a.getGmarker()?(a.initialMarkerVisibility=a.getGmarker().getVisible(),a.oldMarkerAnimation=a.getGmarker().getAnimation(),a.getGmarker().setVisible(a.isIconVisibleOnClick)):void 0):void 0}}(this),a&&b(),this.getGmarker()?this.googleMapsHandles.push(google.maps.event.addListener(this.getGmarker(),"click",b)):void 0},j.prototype.showWindow=function(){var a,b,c;return null!=this.gWin?(b=function(a){return function(){return _.defer(function(){return a.gWin.isOpen()?void 0:(a.gWin.open(a.mapCtrl,a.getGmarker()?a.getGmarker():void 0),a.model.show=a.gWin.isOpen(),_.defer(function(){return i.maybeRepaint(a.gWin.content)}))})}}(this),this.scope.templateUrl?g.get(this.scope.templateUrl,{cache:h}).then(function(a){return function(c){var d,e;return e=a.scope.$new(),angular.isDefined(a.scope.templateParameter)&&(e.parameter=a.scope.templateParameter),d=f(c.data)(e),a.gWin.setContent(d[0]),b()}}(this)):this.scope.template?(c=this.scope.$new(),angular.isDefined(this.scope.templateParameter)&&(c.parameter=this.scope.templateParameter),a=f(this.scope.template)(c),this.gWin.setContent(a[0]),b()):b()):void 0},j.prototype.hideWindow=function(){return null!=this.gWin&&this.gWin.isOpen()?this.gWin.close():void 0},j.prototype.getLatestPosition=function(a){return null==this.gWin||null==this.getGmarker()||a?a?this.gWin.setPosition(a):void 0:this.gWin.setPosition(this.getGmarker().getPosition())},j.prototype.remove=function(){return this.hideWindow(),_.each(this.googleMapsHandles,function(a){return google.maps.event.removeListener(a)}),this.googleMapsHandles.length=0,delete this.gWin,delete this.opts},j.prototype.destroy=function(a){var b,c;return null==a&&(a=!1),this.remove(),null!=this.scope&&(null!=(c=this.scope)?c.$$destroyed:void 0)&&(this.needToManualDestroy||a)&&this.scope.$destroy(),b=void 0},j}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.models.parent".ns()).factory("CircleParentModel".ns(),["Logger".ns(),"$timeout","GmapUtil".ns(),"EventsHelper".ns(),"CircleOptionsBuilder".ns(),function(a,c,d,e,f){var g;return g=function(c){function f(b,c,e,f,g){var h,i;this.scope=b,this.attrs=e,this.map=f,this.DEFAULTS=g,h=new google.maps.Circle(this.buildOpts(d.getCoords(b.center),b.radius)),this.setMyOptions=function(a){return function(c,e){return _.isEqual(c,e)?void 0:h.setOptions(a.buildOpts(d.getCoords(b.center),b.radius))}}(this),this.props=this.props.concat([{prop:"center",isColl:!0},{prop:"fill",isColl:!0},"radius"]),this.watchProps(),i=this.setEvents(h,b,b),google.maps.event.addListener(h,"radius_changed",function(){return b.$evalAsync(function(){return b.radius=h.getRadius()})}),google.maps.event.addListener(h,"center_changed",function(){return b.$evalAsync(function(){return angular.isDefined(b.center.type)?(b.center.coordinates[1]=h.getCenter().lat(),b.center.coordinates[0]=h.getCenter().lng()):(b.center.latitude=h.getCenter().lat(),b.center.longitude=h.getCenter().lng())})}),b.$on("$destroy",function(a){return function(){return a.removeEvents(i),h.setMap(null)}}(this)),a.info(this)}return b(f,c),f.include(d),f.include(e),f}(f)}])}.call(this),function(){angular.module("google-maps.directives.api.models.parent".ns()).factory("DrawingManagerParentModel".ns(),["Logger".ns(),"$timeout",function(){var a;return a=function(){function a(a,b,c,d){var e;this.scope=a,this.attrs=c,this.map=d,e=new google.maps.drawing.DrawingManager(this.scope.options),e.setMap(this.map),null!=this.scope.control&&(this.scope.control.getDrawingManager=function(){return function(){return e}}(this)),!this.scope["static"]&&this.scope.options&&this.scope.$watch("options",function(){return function(a){return null!=e?e.setOptions(a):void 0}}(this),!0),a.$on("$destroy",function(){return function(){return e.setMap(null),e=null}}(this))}return a}()}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapIMarkerParentModel",["uiGmapModelKey","uiGmapLogger",function(b,d){var e;return e=function(b){function e(b,c,f,g){if(this.scope=b,this.element=c,this.attrs=f,this.map=g,this.onDestroy=a(this.onDestroy,this),this.onWatch=a(this.onWatch,this),this.watch=a(this.watch,this),this.validateScope=a(this.validateScope,this),e.__super__.constructor.call(this,this.scope),this.$log=d,!this.validateScope(b))throw new String("Unable to construct IMarkerParentModel due to invalid scope");this.doClick=angular.isDefined(f.click),null!=b.options&&(this.DEFAULTS=b.options),this.watch("coords",this.scope),this.watch("icon",this.scope),this.watch("options",this.scope),b.$on("$destroy",function(a){return function(){return a.onDestroy(b)}}(this))}return c(e,b),e.prototype.DEFAULTS={},e.prototype.validateScope=function(a){var b;return null==a?(this.$log.error(this.constructor.name+": invalid scope used"),!1):(b=null!=a.coords,b?b:(this.$log.error(this.constructor.name+": no valid coords attribute found"),!1))},e.prototype.watch=function(a,b,c){return null==c&&(c=!0),b.$watch(a,function(c){return function(d,e){return _.isEqual(d,e)?void 0:c.onWatch(a,b,d,e)}}(this),c)},e.prototype.onWatch=function(){},e.prototype.onDestroy=function(){throw new String("OnDestroy Not Implemented!!")},e}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.models.parent".ns()).factory("IWindowParentModel".ns(),["ModelKey".ns(),"GmapUtil".ns(),"Logger".ns(),function(a,c,d){var e;return e=function(a){function e(a,b,c,f,g,h,i,j){e.__super__.constructor.call(this,a),this.$log=d,this.$timeout=g,this.$compile=h,this.$http=i,this.$templateCache=j,this.DEFAULTS={},null!=a.options&&(this.DEFAULTS=a.options)}return b(e,a),e.include(c),e}(a)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("LayerParentModel".ns(),["BaseObject".ns(),"Logger".ns(),"$timeout",function(b,d){var e;return e=function(b){function e(b,c,e,f,g,h){return this.scope=b,this.element=c,this.attrs=e,this.gMap=f,this.onLayerCreated=null!=g?g:void 0,this.$log=null!=h?h:d,this.createGoogleLayer=a(this.createGoogleLayer,this),null==this.attrs.type?void this.$log.info("type attribute for the layer directive is mandatory. Layer creation aborted!!"):(this.createGoogleLayer(),this.doShow=!0,angular.isDefined(this.attrs.show)&&(this.doShow=this.scope.show),this.doShow&&null!=this.gMap&&this.layer.setMap(this.gMap),this.scope.$watch("show",function(a){return function(b,c){return b!==c?(a.doShow=b,a.layer.setMap(b?a.gMap:null)):void 0}}(this),!0),this.scope.$watch("options",function(a){return function(b,c){return b!==c?(a.layer.setMap(null),a.layer=null,a.createGoogleLayer()):void 0}}(this),!0),void this.scope.$on("$destroy",function(a){return function(){return a.layer.setMap(null)}}(this)))}return c(e,b),e.prototype.createGoogleLayer=function(){var a;return this.layer=null==this.attrs.options?void 0===this.attrs.namespace?new google.maps[this.attrs.type]:new google.maps[this.attrs.namespace][this.attrs.type]:void 0===this.attrs.namespace?new google.maps[this.attrs.type](this.scope.options):new google.maps[this.attrs.namespace][this.attrs.type](this.scope.options),null!=this.layer&&null!=this.onLayerCreated&&(a=this.onLayerCreated(this.scope,this.layer))?a(this.layer):void 0},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("MapTypeParentModel".ns(),["BaseObject".ns(),"Logger".ns(),"$timeout",function(b,d){var e;return e=function(b){function e(b,c,e,f,g){return this.scope=b,this.element=c,this.attrs=e,this.gMap=f,this.$log=null!=g?g:d,this.hideOverlay=a(this.hideOverlay,this),this.showOverlay=a(this.showOverlay,this),this.refreshMapType=a(this.refreshMapType,this),this.createMapType=a(this.createMapType,this),null==this.attrs.options?void this.$log.info("options attribute for the map-type directive is mandatory. Map type creation aborted!!"):(this.id=this.gMap.overlayMapTypesCount=this.gMap.overlayMapTypesCount+1||0,this.doShow=!0,this.createMapType(),angular.isDefined(this.attrs.show)&&(this.doShow=this.scope.show),this.doShow&&null!=this.gMap&&this.showOverlay(),this.scope.$watch("show",function(a){return function(b,c){return b!==c?(a.doShow=b,b?a.showOverlay():a.hideOverlay()):void 0}}(this),!0),this.scope.$watch("options",function(a){return function(b,c){return _.isEqual(b,c)?void 0:a.refreshMapType()}}(this),!0),angular.isDefined(this.attrs.refresh)&&this.scope.$watch("refresh",function(a){return function(b,c){return _.isEqual(b,c)?void 0:a.refreshMapType()}}(this),!0),void this.scope.$on("$destroy",function(a){return function(){return a.hideOverlay(),a.mapType=null}}(this)))}return c(e,b),e.prototype.createMapType=function(){if(null!=this.scope.options.getTile)this.mapType=this.scope.options;else{if(null==this.scope.options.getTileUrl)return void this.$log.info("options should provide either getTile or getTileUrl methods. Map type creation aborted!!");this.mapType=new google.maps.ImageMapType(this.scope.options)}return this.attrs.id&&this.scope.id&&(this.gMap.mapTypes.set(this.scope.id,this.mapType),angular.isDefined(this.attrs.show)||(this.doShow=!1)),this.mapType.layerId=this.id},e.prototype.refreshMapType=function(){return this.hideOverlay(),this.mapType=null,this.createMapType(),this.doShow&&null!=this.gMap?this.showOverlay():void 0},e.prototype.showOverlay=function(){return this.gMap.overlayMapTypes.push(this.mapType)},e.prototype.hideOverlay=function(){var a;return a=!1,this.gMap.overlayMapTypes.forEach(function(b){return function(c,d){a||c.layerId!==b.id||(a=!0,b.gMap.overlayMapTypes.removeAt(d))}}(this))},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapMarkersParentModel",["uiGmapIMarkerParentModel","uiGmapModelsWatcher","uiGmapPropMap","uiGmapMarkerChildModel","uiGmap_async","uiGmapClustererMarkerManager","uiGmapMarkerManager","$timeout","uiGmapIMarker","uiGmapPromise","uiGmapGmapUtil",function(b,d,e,f,g,h,i,j,k,l,m){var n;return n=function(b){function j(b,c,d,f){this.onDestroy=a(this.onDestroy,this),this.newChildMarker=a(this.newChildMarker,this),this.updateChild=a(this.updateChild,this),this.pieceMeal=a(this.pieceMeal,this),this.reBuildMarkers=a(this.reBuildMarkers,this),this.createMarkersFromScratch=a(this.createMarkersFromScratch,this),this.validateScope=a(this.validateScope,this),this.onWatch=a(this.onWatch,this);var g;j.__super__.constructor.call(this,b,c,d,f),g=this,this.scope.markerModels=new e,this.$log.info(this),this.doRebuildAll=null!=this.scope.doRebuildAll?this.scope.doRebuildAll:!1,this.setIdKey(b),this.scope.$watch("doRebuildAll",function(a){return function(b,c){return b!==c?a.doRebuildAll=b:void 0}}(this)),this.watch("models",b,!this.isTrue(d.modelsbyref)),this.watch("doCluster",b),this.watch("clusterOptions",b),this.watch("clusterEvents",b),this.watch("fit",b),this.watch("idKey",b),this.gMarkerManager=void 0,this.createMarkersFromScratch(b)}return c(j,b),j.include(m),j.include(d),j.prototype.onWatch=function(a,b,c,d){return"idKey"===a&&c!==d&&(this.idKey=c),this.doRebuildAll?this.reBuildMarkers(b):this.pieceMeal(b)},j.prototype.validateScope=function(a){var b;return b=angular.isUndefined(a.models)||void 0===a.models,b&&this.$log.error(this.constructor.name+": no valid models attribute found"),j.__super__.validateScope.call(this,a)||b},j.prototype.createMarkersFromScratch=function(a){return a.doCluster?(a.clusterEvents&&(this.clusterInternalOptions=_.once(function(b){return function(){var c,d,e,f;return c=b,b.origClusterEvents?void 0:(b.origClusterEvents={click:null!=(d=a.clusterEvents)?d.click:void 0,mouseout:null!=(e=a.clusterEvents)?e.mouseout:void 0,mouseover:null!=(f=a.clusterEvents)?f.mouseover:void 0},_.extend(a.clusterEvents,{click:function(a){return c.maybeExecMappedEvent(a,"click") -},mouseout:function(a){return c.maybeExecMappedEvent(a,"mouseout")},mouseover:function(a){return c.maybeExecMappedEvent(a,"mouseover")}}))}}(this))()),a.clusterOptions||a.clusterEvents?void 0===this.gMarkerManager?this.gMarkerManager=new h(this.map,void 0,a.clusterOptions,this.clusterInternalOptions):this.gMarkerManager.opt_options!==a.clusterOptions&&(this.gMarkerManager=new h(this.map,void 0,a.clusterOptions,this.clusterInternalOptions)):this.gMarkerManager=new h(this.map)):this.gMarkerManager=new i(this.map),g.waitOrGo(this,function(b){return function(){return g.each(a.models,function(c){return b.newChildMarker(c,a)},!1).then(function(){return b.gMarkerManager.draw(),a.fit?b.gMarkerManager.fit():void 0})}}(this)).then(function(a){return function(){return a.existingPieces=void 0}}(this))},j.prototype.reBuildMarkers=function(a){var b;if(a.doRebuild||void 0===a.doRebuild)return(null!=(b=this.scope.markerModels)?b.length:void 0)&&this.onDestroy(a),this.createMarkersFromScratch(a)},j.prototype.pieceMeal=function(a){var b;return b=null!=this.existingPieces?!1:g.defaultChunkSize,null!=this.scope.models&&this.scope.models.length>0&&this.scope.markerModels.length>0?this.figureOutState(this.idKey,a,this.scope.markerModels,this.modelKeyComparison,function(c){return function(d){var e;return e=d,g.waitOrGo(c,function(){return g.each(e.removals,function(a){return null!=a?(null!=a.destroy&&a.destroy(),c.scope.markerModels.remove(a.id)):void 0},b).then(function(){return g.each(e.adds,function(b){return c.newChildMarker(b,a)},b)}).then(function(){return g.each(e.updates,function(a){return c.updateChild(a.child,a.model)},b)}).then(function(){return(e.adds.length>0||e.removals.length>0||e.updates.length>0)&&(c.gMarkerManager.draw(),a.markerModels=c.scope.markerModels,a.fit)?c.gMarkerManager.fit():void 0})}).then(function(){return c.existingPieces=void 0})}}(this)):this.reBuildMarkers(a)},j.prototype.updateChild=function(a,b){return null==b[this.idKey]?void this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):a.setMyScope(b,a.model,!1)},j.prototype.newChildMarker=function(a,b){var c,d,e,g;return null==a[this.idKey]?void this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.$log.info("child",c,"markers",this.scope.markerModels),d=b.$new(!0),d.events=b.events,g={},_.each(k.scopeKeys,function(a,c){return g[c]=b[c]}),c=new f(d,a,g,this.map,this.DEFAULTS,this.doClick,this.gMarkerManager,e=!1),this.scope.markerModels.put(a[this.idKey],c),c)},j.prototype.onDestroy=function(){return g.waitOrGo(this,function(a){return function(){return _.each(a.scope.markerModels.values(),function(a){return null!=a?a.destroy(!1):void 0}),delete a.scope.markerModels,null!=a.gMarkerManager&&a.gMarkerManager.clear(),a.scope.markerModels=new e,l.resolve()}}(this))},j.prototype.maybeExecMappedEvent=function(a,b){var c,d;return _.isFunction(null!=(d=this.scope.clusterEvents)?d[b]:void 0)&&(c=this.mapClusterToMarkerModels(a),this.origClusterEvents[b])?this.origClusterEvents[b](c.cluster,c.mapped):void 0},j.prototype.mapClusterToMarkerModels=function(a){var b,c;return b=a.getMarkers().values(),c=b.map(function(a){return function(b){return a.scope.markerModels[b.key].model}}(this)),{cluster:a,mapped:c}},j}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapPolylinesParentModel",["$timeout","uiGmapLogger","uiGmapModelKey","uiGmapModelsWatcher","uiGmapPropMap","uiGmapPolylineChildModel","uiGmap_async",function(b,d,e,f,g,h,i){var j;return j=function(b){function e(b,c,f,h,i){var j;this.scope=b,this.element=c,this.attrs=f,this.gMap=h,this.defaults=i,this.modelKeyComparison=a(this.modelKeyComparison,this),this.setChildScope=a(this.setChildScope,this),this.createChild=a(this.createChild,this),this.pieceMeal=a(this.pieceMeal,this),this.createAllNew=a(this.createAllNew,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopes=a(this.createChildScopes,this),this.watchOurScope=a(this.watchOurScope,this),this.watchDestroy=a(this.watchDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),this.watch=a(this.watch,this),e.__super__.constructor.call(this,b),j=this,this.$log=d,this.plurals=new g,this.scopePropNames=["path","stroke","clickable","draggable","editable","geodesic","icons","visible"],_.each(this.scopePropNames,function(a){return function(b){return a[b+"Key"]=void 0}}(this)),this.models=void 0,this.firstTime=!0,this.$log.info(this),this.watchOurScope(b),this.createChildScopes()}return c(e,b),e.include(f),e.prototype.watch=function(a,b,c){return a.$watch(b,function(a){return function(d,e){return d!==e?(a[c]="function"==typeof d?d():d,i.waitOrGo(a,function(){return i.each(_.values(a.plurals),function(d){return d.scope[b]="self"===a[c]?d:d[a[c]]})})):void 0}}(this))},e.prototype.watchModels=function(a){return a.$watch("models",function(b){return function(c,d){return _.isEqual(c,d)?void 0:b.doINeedToWipe(c)?b.rebuildAll(a,!0,!0):b.createChildScopes(!1)}}(this),!0)},e.prototype.doINeedToWipe=function(a){var b;return b=null!=a?0===a.length:!0,this.plurals.length>0&&b},e.prototype.rebuildAll=function(a,b,c){return i.waitOrGo(this,function(a){return function(){return i.each(a.plurals.values(),function(a){return a.destroy()}).then(function(){return c&&delete a.plurals,a.plurals=new g,b?a.createChildScopes():void 0})}}(this))},e.prototype.watchDestroy=function(a){return a.$on("$destroy",function(b){return function(){return b.rebuildAll(a,!1,!0)}}(this))},e.prototype.watchOurScope=function(a){return _.each(this.scopePropNames,function(b){return function(c){var d;return d=c+"Key",b[d]="function"==typeof a[c]?a[c]():a[c],b.watch(a,c,d)}}(this))},e.prototype.createChildScopes=function(a){return null==a&&(a=!0),angular.isUndefined(this.scope.models)?void this.$log.error("No models to create polylines from! I Need direct models!"):null!=this.gMap&&null!=this.scope.models?(this.watchIdKey(this.scope),a?this.createAllNew(this.scope,!1):this.pieceMeal(this.scope,!1)):void 0},e.prototype.watchIdKey=function(a){return this.setIdKey(a),a.$watch("idKey",function(b){return function(c,d){return c!==d&&null==c?(b.idKey=c,b.rebuildAll(a,!0,!0)):void 0}}(this))},e.prototype.createAllNew=function(a,b){return null==b&&(b=!1),this.models=a.models,this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),i.waitOrGo(this,function(b){return function(){return i.each(a.models,function(a){return b.createChild(a,b.gMap)})}}(this)).then(function(a){return function(){return a.firstTime=!1,a.existingPieces=void 0}}(this))},e.prototype.pieceMeal=function(a,b){var c;return null==b&&(b=!0),c=null!=this.existingPieces?!1:i.defaultChunkSize,this.models=a.models,null!=a&&null!=a.models&&a.models.length>0&&this.plurals.length>0?this.figureOutState(this.idKey,a,this.plurals,this.modelKeyComparison,function(a){return function(b){var c;return c=b,i.waitOrGo(a,function(){return i.each(c.removals,function(b){var c;return c=a.plurals[b],null!=c?(c.destroy(),a.plurals.remove(b)):void 0}).then(function(){return i.each(c.adds,function(b){return a.createChild(b,a.gMap)})}).then(function(){return a.existingPieces=void 0})})}}(this)):this.rebuildAll(this.scope,!0,!0)},e.prototype.createChild=function(a,b){var c,d;return d=this.scope.$new(!1),this.setChildScope(d,a),d.$watch("model",function(a){return function(b,c){return b!==c?a.setChildScope(d,b):void 0}}(this),!0),d["static"]=this.scope["static"],c=new h(d,this.attrs,b,this.defaults,a),null==a[this.idKey]?void this.$log.error("Polyline model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.plurals.put(a[this.idKey],c),c)},e.prototype.setChildScope=function(a,b){return _.each(this.scopePropNames,function(c){return function(d){var e,f;return e=d+"Key",f="self"===c[e]?b:b[c[e]],f!==a[d]?a[d]=f:void 0}}(this)),a.model=b},e.prototype.modelKeyComparison=function(a,b){return _.isEqual(this.evalModelHandle(a,this.scope.path),this.evalModelHandle(b,this.scope.path))},e}(e)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.models.parent".ns()).factory("RectangleParentModel".ns(),["Logger".ns(),"GmapUtil".ns(),"EventsHelper".ns(),"RectangleOptionsBuilder".ns(),function(a,c,d,e){var f;return f=function(e){function f(b,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q;this.scope=b,this.attrs=d,this.map=e,this.DEFAULTS=f,g=void 0,j=!1,n=[],m=void 0,k=function(a){return function(){return a.isTrue(d.fit)?a.fitMapBounds(a.map,g):void 0}}(this),i=function(c){return function(){var d,e;return null!=b.bounds&&null!=(null!=(d=b.bounds)?d.sw:void 0)&&null!=(null!=(e=b.bounds)?e.ne:void 0)&&c.validateBoundPoints(b.bounds)?(g=c.convertBoundPoints(b.bounds),a.info("new new bounds created: "+o)):null!=b.bounds.getNorthEast&&null!=b.bounds.getSouthWest?g=b.bounds:"undefined"!=typeof bound&&null!==bound?a.error("Invalid bounds for newValue: "+JSON.stringify(b.bounds)):void 0}}(this),i(),o=new google.maps.Rectangle(this.buildOpts(g)),a.info("rectangle created: "+o),p=!1,q=function(){return function(){var a,c,d;return a=o.getBounds(),c=a.getNorthEast(),d=a.getSouthWest(),p?void 0:b.$evalAsync(function(b){return null!=b.bounds&&null!=b.bounds.sw&&null!=b.bounds.ne&&(b.bounds.ne={latitude:c.lat(),longitude:c.lng()},b.bounds.sw={latitude:d.lat(),longitude:d.lng()}),null!=b.bounds.getNorthEast&&null!=b.bounds.getSouthWest?b.bounds=a:void 0})}}(this),l=function(a){return function(){return k(),a.removeEvents(n),n.push(google.maps.event.addListener(o,"dragstart",function(){return j=!0})),n.push(google.maps.event.addListener(o,"dragend",function(){return j=!1,q()})),n.push(google.maps.event.addListener(o,"bounds_changed",function(){return j?void 0:q()}))}}(this),h=function(a){return function(){return a.removeEvents(n),null!=m&&a.removeEvents(m),o.setMap(null)}}(this),null!=g&&l(),b.$watch("bounds",function(a,b){var c;if(!(_.isEqual(a,b)&&null!=g||j))return p=!0,null==a?void h():(null==g?c=!0:k(),i(),o.setBounds(g),p=!1,c&&null!=g?l():void 0)},!0),this.setMyOptions=function(a){return function(b,c){return _.isEqual(b,c)||null==g||null==b?void 0:o.setOptions(a.buildOpts(g))}}(this),this.props.push("bounds"),this.watchProps(this.props),null!=d.events&&(m=this.setEvents(o,b,b),b.$watch("events",function(a){return function(c,d){return _.isEqual(c,d)?void 0:(null!=m&&a.removeEvents(m),m=a.setEvents(o,b,b))}}(this))),b.$on("$destroy",function(){return function(){return h()}}(this)),a.info(this)}return b(f,e),f.include(c),f.include(d),f}(e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("SearchBoxParentModel".ns(),["BaseObject".ns(),"Logger".ns(),"EventsHelper".ns(),"$timeout","$http","$templateCache",function(b,d,e){var f;return f=function(b){function f(b,c,e,f,g,h,i){var j;return this.scope=b,this.element=c,this.attrs=e,this.gMap=f,this.ctrlPosition=g,this.template=h,this.$log=null!=i?i:d,this.getBounds=a(this.getBounds,this),this.setBounds=a(this.setBounds,this),this.createSearchBox=a(this.createSearchBox,this),this.addToParentDiv=a(this.addToParentDiv,this),this.addAsMapControl=a(this.addAsMapControl,this),this.init=a(this.init,this),null==this.attrs.template?void this.$log.error("template attribute for the search-box directive is mandatory. Places Search Box creation aborted!!"):(j=angular.element("
"),j.append(this.template),this.input=j.find("input")[0],void this.init())}return c(f,b),f.include(e),f.prototype.init=function(){return this.createSearchBox(),null!=this.attrs.parentdiv?this.addToParentDiv():this.addAsMapControl(),this.listener=google.maps.event.addListener(this.searchBox,"places_changed",function(a){return function(){return a.places=a.searchBox.getPlaces()}}(this)),this.listeners=this.setEvents(this.searchBox,this.scope,this.scope),this.$log.info(this),this.scope.$watch("options",function(a){return function(b){return angular.isObject(b)&&null!=b.bounds?a.setBounds(b.bounds):void 0}}(this),!0),this.scope.$on("$destroy",function(a){return function(){return a.searchBox=null}}(this))},f.prototype.addAsMapControl=function(){return this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].push(this.input)},f.prototype.addToParentDiv=function(){return this.parentDiv=angular.element(document.getElementById(this.scope.parentdiv)),this.parentDiv.append(this.input)},f.prototype.createSearchBox=function(){return this.searchBox=new google.maps.places.SearchBox(this.input,this.scope.options)},f.prototype.setBounds=function(a){if(angular.isUndefined(a.isEmpty))this.$log.error("Error: SearchBoxParentModel setBounds. Bounds not an instance of LatLngBounds.");else if(a.isEmpty()===!1&&null!=this.searchBox)return this.searchBox.setBounds(a)},f.prototype.getBounds=function(){return this.searchBox.getBounds()},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("WindowsParentModel".ns(),["IWindowParentModel".ns(),"ModelsWatcher".ns(),"PropMap".ns(),"WindowChildModel".ns(),"Linked".ns(),"_async".ns(),"Logger".ns(),"$timeout","$compile","$http","$templateCache","$interpolate","uiGmapPromise",function(b,d,e,f,g,h,i,j,k,l,m,n,o){var p;return p=function(b){function p(b,c,d,f,h,i){var n;this.gMap=h,this.markersScope=i,this.interpolateContent=a(this.interpolateContent,this),this.setChildScope=a(this.setChildScope,this),this.createWindow=a(this.createWindow,this),this.setContentKeys=a(this.setContentKeys,this),this.pieceMealWindows=a(this.pieceMealWindows,this),this.createAllNewWindows=a(this.createAllNewWindows,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopesWindows=a(this.createChildScopesWindows,this),this.watchOurScope=a(this.watchOurScope,this),this.watchDestroy=a(this.watchDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),this.go=a(this.go,this),p.__super__.constructor.call(this,b,c,d,f,j,k,l,m),n=this,this.windows=new e,this.scopePropNames=["coords","template","templateUrl","templateParameter","isIconVisibleOnClick","closeClick","options","show"],_.each(this.scopePropNames,function(a){return function(b){return a[b+"Key"]=void 0}}(this)),this.linked=new g(b,c,d,f),this.models=void 0,this.contentKeys=void 0,this.isIconVisibleOnClick=void 0,this.firstTime=!0,this.firstWatchModels=!0,this.$log.info(n),this.parentScope=void 0,this.go(b)}return c(p,b),p.include(d),p.prototype.go=function(a){return this.watchOurScope(a),this.doRebuildAll=null!=this.scope.doRebuildAll?this.scope.doRebuildAll:!1,a.$watch("doRebuildAll",function(a){return function(b,c){return b!==c?a.doRebuildAll=b:void 0}}(this)),this.createChildScopesWindows()},p.prototype.watchModels=function(a){return a.$watch("models",function(b){return function(c,d){var e;return!_.isEqual(c,d)||b.firstWatchModels?(b.firstWatchModels=!1,b.doRebuildAll||b.doINeedToWipe(c)?b.rebuildAll(a,!0,!0):(e=0===b.windows.length,null!=b.existingPieces?b.existingPieces.then(function(){return b.createChildScopesWindows(e)}):b.createChildScopesWindows(e))):void 0}}(this),!0)},p.prototype.doINeedToWipe=function(a){var b;return b=null!=a?0===a.length:!0,this.windows.length>0&&b},p.prototype.rebuildAll=function(a,b,c){return h.waitOrGo(this,function(a){return function(){return h.each(a.windows.values(),function(a){return a.destroy()}).then(function(){return c&&delete a.windows,a.windows=new e,b&&a.createChildScopesWindows(),o.resolve()})}}(this))},p.prototype.watchDestroy=function(a){return a.$on("$destroy",function(b){return function(){return b.firstWatchModels=!0,b.firstTime=!0,b.rebuildAll(a,!1,!0)}}(this))},p.prototype.watchOurScope=function(a){return _.each(this.scopePropNames,function(b){return function(c){var d;return d=c+"Key",b[d]="function"==typeof a[c]?a[c]():a[c]}}(this))},p.prototype.createChildScopesWindows=function(a){var b,c,d;return null==a&&(a=!0),this.isIconVisibleOnClick=!0,angular.isDefined(this.linked.attrs.isiconvisibleonclick)&&(this.isIconVisibleOnClick=this.linked.scope.isIconVisibleOnClick),b=angular.isUndefined(this.linked.scope.models),!b||void 0!==this.markersScope&&void 0!==(null!=(c=this.markersScope)?c.markerModels:void 0)&&void 0!==(null!=(d=this.markersScope)?d.models:void 0)?null!=this.gMap?null!=this.linked.scope.models?(this.watchIdKey(this.linked.scope),a?this.createAllNewWindows(this.linked.scope,!1):this.pieceMealWindows(this.linked.scope,!1)):(this.parentScope=this.markersScope,this.watchIdKey(this.parentScope),a?this.createAllNewWindows(this.markersScope,!0,"markerModels",!1):this.pieceMealWindows(this.markersScope,!0,"markerModels",!1)):void 0:void this.$log.error("No models to create windows from! Need direct models or models derrived from markers!")},p.prototype.watchIdKey=function(a){return this.setIdKey(a),a.$watch("idKey",function(b){return function(c,d){return c!==d&&null==c?(b.idKey=c,b.rebuildAll(a,!0,!0)):void 0}}(this))},p.prototype.createAllNewWindows=function(a,b,c,d){return null==c&&(c="models"),null==d&&(d=!1),this.models=a.models,this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),this.setContentKeys(a.models),h.waitOrGo(this,function(d){return function(){return h.each(a.models,function(e){var f,g;return f=b&&null!=(g=a[c][[e[d.idKey]]])?g.gMarker:void 0,d.createWindow(e,f,d.gMap)})}}(this)).then(function(a){return function(){return a.firstTime=!1}}(this))},p.prototype.pieceMealWindows=function(a,b,c,d){var e;return null==c&&(c="models"),null==d&&(d=!0),e=null!=this.existingPieces?!1:h.defaultChunkSize,this.models=a.models,null!=a&&null!=a.models&&a.models.length>0&&this.windows.length>0?this.figureOutState(this.idKey,a,this.windows,this.modelKeyComparison,function(b){return function(d){var f;return f=d,h.waitOrGo(b,function(){return h.each(f.removals,function(a){return null!=a&&(b.windows.remove(a.id),null!=a.destroy)?a.destroy(!0):void 0},e).then(function(){return h.each(f.adds,function(d){var e,f;if(e=null!=(f=a[c][d[b.idKey]])?f.gMarker:void 0,!e)throw"Gmarker undefined";return b.createWindow(d,e,b.gMap)},e)})}).then(function(){return b.existingPieces=void 0})["catch"](function(){return i.error("Error while pieceMealing Windows!")})}}(this)):this.rebuildAll(this.scope,!0,!0)},p.prototype.setContentKeys=function(a){return a.length>0?this.contentKeys=Object.keys(a[0]):void 0},p.prototype.createWindow=function(a,b,c){var d,e,g,h,i,j;return e=this.linked.scope.$new(!1),this.setChildScope(e,a),e.$watch("model",function(a){return function(b,c){return b!==c?a.setChildScope(e,b):void 0}}(this),!0),g={html:function(b){return function(){return b.interpolateContent(b.linked.element.html(),a)}}(this)},this.DEFAULTS=this.markersScope?a[this.optionsKey]||{}:this.DEFAULTS,h=this.createWindowOptions(b,e,g.html(),this.DEFAULTS),d=new f(a,e,h,this.isIconVisibleOnClick,c,null!=(i=this.markersScope)&&null!=(j=i.markerModels[a[this.idKey]])?j.scope:void 0,g,!1,!0),null==a[this.idKey]?void this.$log.error("Window model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.windows.put(a[this.idKey],d),d)},p.prototype.setChildScope=function(a,b){return _.each(this.scopePropNames,function(c){return function(d){var e,f;return e=d+"Key",f="self"===c[e]?b:b[c[e]],f!==a[d]?a[d]=f:void 0}}(this)),a.model=b},p.prototype.interpolateContent=function(a,b){var c,d,e,f,g,h;if(void 0!==this.contentKeys&&0!==this.contentKeys.length){for(c=n(a),d={},h=this.contentKeys,f=0,g=h.length;g>f;f++)e=h[f],d[e]=b[e];return c(d)}},p}(b)}])}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapCircle",["uiGmapICircle","uiGmapCircleParentModel",function(a,b){return _.extend(a,{link:function(a,c,d,e){return e.getScope().deferred.promise.then(function(){return function(e){return new b(a,c,d,e)}}(this))}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapControl",["uiGmapIControl","$http","$templateCache","$compile","$controller","uiGmapGoogleMapApi",function(b,d,e,f,g,h){var i;return i=function(i){function j(){this.link=a(this.link,this),j.__super__.constructor.call(this)}return c(j,i),j.prototype.link=function(a,c,i,j){return h.then(function(c){return function(h){var i,k;return angular.isUndefined(a.template)?void c.$log.error("mapControl: could not find a valid template property"):(i=angular.isDefined(a.index&&!isNaN(parseInt(a.index)))?parseInt(a.index):void 0,k=angular.isDefined(a.position)?a.position.toUpperCase().replace(/-/g,"_"):"TOP_CENTER",h.ControlPosition[k]?b.mapPromise(a,j).then(function(b){var h,j;return h=void 0,j=angular.element("
"),d.get(a.template,{cache:e}).success(function(b){var c,d;return d=a.$new(),j.append(b),i&&(j[0].index=i),angular.isDefined(a.controller)&&(c=g(a.controller,{$scope:d}),j.children().data("$ngControllerController",c)),h=f(j.children())(d)}).error(function(){return c.$log.error("mapControl: template could not be found")}).then(function(){return b.controls[google.maps.ControlPosition[k]].push(h[0])})}):void c.$log.error("mapControl: invalid position property"))}}(this))},j}(b)}])}.call(this),function(){angular.module("google-maps.directives.api".ns()).factory("DrawingManager".ns(),["IDrawingManager".ns(),"DrawingManagerParentModel".ns(),function(a,b){return _.extend(a,{link:function(a,c,d,e){return e.getScope().deferred.promise.then(function(){return function(e){return new b(a,c,d,e)}}(this))}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("ApiFreeDrawPolygons".ns(),["Logger".ns(),"BaseObject".ns(),"CtrlHandle".ns(),"DrawFreeHandChildModel".ns(),function(b,d,e,f){var g;return g=function(d){function g(){return this.link=a(this.link,this),g.__super__.constructor.apply(this,arguments)}return c(g,d),g.include(e),g.prototype.restrict="EMA",g.prototype.replace=!0,g.prototype.require="^"+"GoogleMap".ns(),g.prototype.scope={polygons:"=",draw:"="},g.prototype.link=function(a,c,d,e){return this.mapPromise(a,e).then(function(){return function(c){var d,e;return a.polygons?_.isArray(a.polygons)?(d=new f(c,a.originalMapOpts),e=void 0,a.draw=function(){return"function"==typeof e&&e(),d.engage(a.polygons).then(function(){var b;return b=!0,e=a.$watch("polygons",function(a,c){var d;return b?void(b=!1):(d=_.differenceObjects(c,a),d.forEach(function(a){return a.setMap(null)}))})})}):b.error("Free Draw Polygons must be of type Array!"):b.error("No polygons to bind to!")}}(this))},g}(d)}])}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api").service("uiGmapICircle",[function(){var a;return a={},{restrict:"EA",replace:!0,require:"^uiGmapGoogleMap",scope:{center:"=center",radius:"=radius",stroke:"=stroke",fill:"=fill",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=icons",visible:"=",events:"="}}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("IControl".ns(),["BaseObject".ns(),"Logger".ns(),"CtrlHandle".ns(),function(b,d,e){var f;return f=function(b){function f(){this.link=a(this.link,this),this.restrict="EA",this.replace=!0,this.require="^"+"GoogleMap".ns(),this.scope={template:"@template",position:"@position",controller:"@controller",index:"@index"},this.$log=d}return c(f,b),f.extend(e),f.prototype.link=function(){throw new Exception("Not implemented!!")},f}(b)}])}.call(this),function(){angular.module("google-maps.directives.api".ns()).service("IDrawingManager".ns(),[function(){return{restrict:"EA",replace:!0,require:"^"+"GoogleMap".ns(),scope:{"static":"@",control:"=",options:"="}}}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api".ns()).factory("IMarker".ns(),["Logger".ns(),"BaseObject".ns(),"CtrlHandle".ns(),function(a,c,d){var e;return e=function(c){function e(){this.$log=a,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.replace=!0,this.scope=e.scopeKeys}return b(e,c),e.scopeKeys={coords:"=coords",icon:"=icon",click:"&click",options:"=options",events:"=events",fit:"=fit",idKey:"=idkey",control:"=control"},e.keys=_.keys(e.scopeKeys),e.extend(d),e}(c)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api".ns()).factory("IPolygon".ns(),["GmapUtil".ns(),"BaseObject".ns(),"Logger".ns(),"CtrlHandle".ns(),function(a,c,d,e){var f;return f=function(c){function f(){}return b(f,c),f.include(a),f.extend(e),f.prototype.restrict="EMA",f.prototype.replace=!0,f.prototype.require="^"+"GoogleMap".ns(),f.prototype.scope={path:"=path",stroke:"=stroke",clickable:"=",draggable:"=",editable:"=",geodesic:"=",fill:"=",icons:"=icons",visible:"=","static":"=",events:"=",zIndex:"=zindex",fit:"=",control:"=control"},f.prototype.DEFAULTS={},f.prototype.$log=d,f}(c)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api".ns()).factory("IPolyline".ns(),["GmapUtil".ns(),"BaseObject".ns(),"Logger".ns(),"CtrlHandle".ns(),function(a,c,d,e){var f;return f=function(c){function f(){}return b(f,c),f.include(a),f.extend(e),f.prototype.restrict="EMA",f.prototype.replace=!0,f.prototype.require="^"+"GoogleMap".ns(),f.prototype.scope={path:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=",visible:"=","static":"=",fit:"=",events:"="},f.prototype.DEFAULTS={},f.prototype.$log=d,f}(c)}])}.call(this),function(){angular.module("google-maps.directives.api".ns()).service("IRectangle".ns(),[function(){"use strict";var a;return a={},{restrict:"EMA",require:"^"+"GoogleMap".ns(),replace:!0,scope:{bounds:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",fill:"=",visible:"=",events:"="}}}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIWindow",["uiGmapBaseObject","uiGmapChildEvents","uiGmapLogger","uiGmapCtrlHandle",function(a,c,d,e){var f;return f=function(a){function f(){this.restrict="EMA",this.template=void 0,this.transclude=!0,this.priority=-100,this.require="^"+"GoogleMap".ns(),this.replace=!0,this.scope={coords:"=coords",template:"=template",templateUrl:"=templateurl",templateParameter:"=templateparameter",isIconVisibleOnClick:"=isiconvisibleonclick",closeClick:"&closeclick",options:"=options",control:"=control",show:"=show"},this.$log=d}return b(f,a),f.include(c),f.extend(e),f}(a)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMap",["$timeout","$q","uiGmapLogger","uiGmapGmapUtil","uiGmapBaseObject","uiGmapCtrlHandle","uiGmapIsReady","uiGmapuuid","uiGmapExtendGWin","uiGmapExtendMarkerClusterer","uiGmapGoogleMapsUtilV3","uiGmapGoogleMapApi",function(b,d,e,f,g,h,i,j,k,l,m,n){"use strict";var o,p,q;return o=void 0,q=[m,k,l],p=function(d){function g(){this.link=a(this.link,this);var b,c;b=function(a){var b,c;return c=void 0,a.$on("$destroy",function(){return i.reset()}),b=h.handle(a),a.ctrlType="Map",a.deferred.promise.then(function(){return q.forEach(function(a){return a.init()})}),b.getMap=function(){return a.map},c=_.extend(this,b)},this.controller=["$scope",b],c=this}return c(g,d),g.include(f),g.prototype.restrict="EMA",g.prototype.transclude=!0,g.prototype.replace=!1,g.prototype.template='
',g.prototype.scope={center:"=",zoom:"=",dragging:"=",control:"=",options:"=",events:"=",eventOpts:"=",styles:"=",bounds:"=",update:"="},g.prototype.link=function(a,c,d){var f;return a.idleAndZoomChanged=!1,null==a.center?void(f=a.$watch("center",function(b){return function(){return a.center?(f(),b.link(a,c,d)):void 0}}(this))):n.then(function(f){return function(g){var h,k,l,m,n,p,q,r,s,t,u;if(o={mapTypeId:g.MapTypeId.ROADMAP},s=i.spawn(),q=function(){return s.deferred.resolve({instance:s.instance,map:u})},!f.validateCoords(a.center))return void e.error("angular-google-maps: could not find a valid center property");if(!angular.isDefined(a.zoom))return void e.error("angular-google-maps: map zoom property not set");if(k=angular.element(c),k.addClass("angular-google-map"),p={options:{}},d.options&&(p.options=a.options),d.styles&&(p.styles=a.styles),d.type&&(t=d.type.toUpperCase(),google.maps.MapTypeId.hasOwnProperty(t)?p.mapTypeId=google.maps.MapTypeId[d.type.toUpperCase()]:e.error("angular-google-maps: invalid map type '"+d.type+"'")),n=angular.extend({},o,p,{center:f.getCoords(a.center),zoom:a.zoom,bounds:a.bounds}),u=new google.maps.Map(k.find("div")[1],n),u["_id".ns()]=j.generate(),h=!1,google.maps.event.addListenerOnce(u,"idle",function(){return a.deferred.resolve(u),q()}),google.maps.event.addListener(u,"dragstart",function(){var b;return(null!=(b=a.update)?b.lazy:void 0)?void 0:(h=!0,a.$evalAsync(function(a){return null!=a.dragging?a.dragging=h:void 0}))}),google.maps.event.addListener(u,"dragend",function(){var b;return(null!=(b=a.update)?b.lazy:void 0)?void 0:(h=!1,a.$evalAsync(function(a){return null!=a.dragging?a.dragging=h:void 0}))}),google.maps.event.addListener(u,"drag",function(){var c,d,e,f,g;return(null!=(d=a.update)?d.lazy:void 0)?void 0:(c=u.center,b(function(){var b; -return b=a,angular.isDefined(b.center.type)?(b.center.coordinates[1]=c.lat(),b.center.coordinates[0]=c.lng()):(b.center.latitude=c.lat(),b.center.longitude=c.lng())},null!=(e=a.eventOpts)&&null!=(f=e.debounce)&&null!=(g=f.debounce)?g.dragMs:void 0))}),google.maps.event.addListener(u,"zoom_changed",function(){var c,d,e;return(null!=(c=a.update)?c.lazy:void 0)||a.zoom===u.zoom?void 0:b(function(){return a.zoom=u.zoom},null!=(d=a.eventOpts)&&null!=(e=d.debounce)?e.zoomMs:void 0)}),r=!1,google.maps.event.addListener(u,"center_changed",function(){var c,d,e,f;if(!(null!=(d=a.update)?d.lazy:void 0)){if(c=u.center,r)return;return b(function(){var b;if(b=a,!u.dragging)if(angular.isDefined(b.center.type)){if(b.center.coordinates[1]!==c.lat()&&(b.center.coordinates[1]=c.lat()),b.center.coordinates[0]!==c.lng())return b.center.coordinates[0]=c.lng()}else if(b.center.latitude!==c.lat()&&(b.center.latitude=c.lat()),b.center.longitude!==c.lng())return b.center.longitude=c.lng()},null!=(e=a.eventOpts)&&null!=(f=e.debounce)?f.centerMs:void 0)}}),google.maps.event.addListener(u,"idle",function(){var b,c,d;return b=u.getBounds(),c=b.getNorthEast(),d=b.getSouthWest(),a.$evalAsync(function(b){var e,f;return(null!=(f=b.update)?f.lazy:void 0)&&(e=u.center,angular.isDefined(b.center.type)?(b.center.coordinates[1]!==e.lat()&&(b.center.coordinates[1]=e.lat()),b.center.coordinates[0]!==e.lng()&&(b.center.coordinates[0]=e.lng())):(b.center.latitude!==e.lat()&&(b.center.latitude=e.lat()),b.center.longitude!==e.lng()&&(b.center.longitude=e.lng()))),null!==b.bounds&&void 0!==b.bounds&&void 0!==b.bounds&&(b.bounds.northeast={latitude:c.lat(),longitude:c.lng()},b.bounds.southwest={latitude:d.lat(),longitude:d.lng()}),b.zoom=u.zoom,a.idleAndZoomChanged=!a.idleAndZoomChanged})}),angular.isDefined(a.events)&&null!==a.events&&angular.isObject(a.events)){m=function(b){return function(){return a.events[b].apply(a,[u,b,arguments])}};for(l in a.events)a.events.hasOwnProperty(l)&&angular.isFunction(a.events[l])&&google.maps.event.addListener(u,l,m(l))}return u.getOptions=function(){return n},a.map=u,null!=d.control&&null!=a.control&&(a.control.refresh=function(a){var b;if(null!=u)return google.maps.event.trigger(u,"resize"),null!=(null!=a?a.latitude:void 0)&&null!=(null!=a?a.latitude:void 0)?(b=f.getCoords(a),f.isTrue(d.pan)?u.panTo(b):u.setCenter(b)):void 0},a.control.getGMap=function(){return u},a.control.getMapOptions=function(){return n}),a.$watch("center",function(b){var c;return c=f.getCoords(b),c.lat()!==u.center.lat()||c.lng()!==u.center.lng()?(r=!0,h||(f.validateCoords(b)||e.error("Invalid center for newValue: "+JSON.stringify(b)),f.isTrue(d.pan)&&a.zoom===u.zoom?u.panTo(c):u.setCenter(c)),r=!1):void 0},!0),a.$watch("zoom",function(a,c){return _.isEqual(a,c)?void 0:b(function(){return u.setZoom(a)},0,!1)}),a.$watch("bounds",function(a,b){var c,d,f;if(a!==b)return null==a.northeast.latitude||null==a.northeast.longitude||null==a.southwest.latitude||null==a.southwest.longitude?void e.error("Invalid map bounds for new value: "+JSON.stringify(a)):(d=new google.maps.LatLng(a.northeast.latitude,a.northeast.longitude),f=new google.maps.LatLng(a.southwest.latitude,a.southwest.longitude),c=new google.maps.LatLngBounds(f,d),u.fitBounds(c))}),["options","styles"].forEach(function(b){return a.$watch(b,function(a,b){var c;return c=this.exp,_.isEqual(a,b)?void 0:(p.options=a,null!=u?u.setOptions(p):void 0)})},!0)}}(this))},g}(g)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMarker",["uiGmapIMarker","uiGmapMarkerChildModel","uiGmapMarkerManager",function(b,d,e){var f;return f=function(f){function g(){this.link=a(this.link,this),g.__super__.constructor.call(this),this.template='',this.$log.info(this)}return c(g,f),g.prototype.controller=["$scope","$element",function(a,c){return a.ctrlType="Marker",_.extend(this,b.handle(a,c))}],g.prototype.link=function(a,c,f,g){return this.mapPromise=b.mapPromise(a,g),this.mapPromise.then(function(c){return function(f){var g,h,i,j,k;return c.gMarkerManager||(c.gMarkerManager=new e(f)),i=_.object(b.keys,b.keys),j=new d(a,a,i,f,{},g=!0,c.gMarkerManager,h=!1,k=!1),j.deferred.promise.then(function(b){return a.deferred.resolve(b)}),null!=a.control?a.control.getGMarkers=c.gMarkerManager.getGMarkers:void 0}}(this)),a.$on("$destroy",function(a){return function(){var b;return null!=(b=a.gMarkerManager)&&b.clear(),a.gMarkerManager=null}}(this))},g}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMarkers",["uiGmapIMarker","uiGmapMarkersParentModel","uiGmap_sync",function(b,d){var e;return e=function(e){function f(b){this.link=a(this.link,this),f.__super__.constructor.call(this,b),this.template='',this.scope=_.extend(this.scope||{},{idKey:"=idkey",doRebuildAll:"=dorebuildall",models:"=models",doCluster:"=docluster",clusterOptions:"=clusteroptions",clusterEvents:"=clusterevents",modelsByRef:"=modelsbyref"}),this.$log.info(this)}return c(f,e),f.prototype.controller=["$scope","$element",function(a,c){return a.ctrlType="Markers",_.extend(this,b.handle(a,c))}],f.prototype.link=function(a,c,e,f){var g,h;return g=void 0,h=function(){return function(){return null!=a.control&&(a.control.getGMarkers=function(){var a;return null!=(a=g.gMarkerManager)?a.getGMarkers():void 0},a.control.getChildMarkers=function(){return g.markerModels}),a.deferred.resolve()}}(this),b.mapPromise(a,f).then(function(){return function(b){var i;return i=f.getScope(),i.$watch("idleAndZoomChanged",function(){return _.defer(g.gMarkerManager.draw)}),g=new d(a,c,e,b),g.existingPieces.then(function(){return h()})}}(this))},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Polygon".ns(),["IPolygon".ns(),"$timeout","array-sync".ns(),"PolygonChildModel".ns(),function(b,d,e,f){var g;return g=function(d){function e(){return this.link=a(this.link,this),e.__super__.constructor.apply(this,arguments)}return c(e,d),e.prototype.link=function(a,c,d,e){var g,h;return g=[],h=b.mapPromise(a,e),null!=a.control&&(a.control.getInstance=this,a.control.polygons=g,a.control.promise=h),h.then(function(b){return function(c){return g.push(new f(a,d,c,b.DEFAULTS))}}(this))},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Polyline".ns(),["IPolyline".ns(),"$timeout","array-sync".ns(),"PolylineChildModel".ns(),function(b,d,e,f){var g;return g=function(d){function e(){return this.link=a(this.link,this),e.__super__.constructor.apply(this,arguments)}return c(e,d),e.prototype.link=function(a,c,d,e){return angular.isUndefined(a.path)||null===a.path||!this.validatePath(a.path)?void this.$log.error("polyline: no valid path attribute found"):b.mapPromise(a,e).then(function(b){return function(c){return new f(a,d,c,b.DEFAULTS)}}(this))},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Polylines".ns(),["IPolyline".ns(),"$timeout","array-sync".ns(),"PolylinesParentModel".ns(),function(b,d,e,f){var g;return g=function(b){function d(){this.link=a(this.link,this),d.__super__.constructor.call(this),this.scope.idKey="=idkey",this.scope.models="=models",this.$log.info(this)}return c(d,b),d.prototype.link=function(a,b,c,d){return angular.isUndefined(a.path)||null===a.path?void this.$log.error("polylines: no valid path attribute found"):a.models?d.getScope().deferred.promise.then(function(d){return function(e){return new f(a,b,c,e,d.DEFAULTS)}}(this)):void this.$log.error("polylines: no models found to create from")},d}(b)}])}.call(this),function(){angular.module("google-maps.directives.api".ns()).factory("Rectangle".ns(),["Logger".ns(),"GmapUtil".ns(),"IRectangle".ns(),"RectangleParentModel".ns(),function(a,b,c,d){return _.extend(c,{link:function(a,b,c,e){return e.getScope().deferred.promise.then(function(){return function(e){return new d(a,b,c,e)}}(this))}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapWindow",["uiGmapIWindow","uiGmapGmapUtil","uiGmapWindowChildModel",function(b,d,e){var f;return f=function(f){function g(){this.link=a(this.link,this),g.__super__.constructor.call(this),this.require=["^uiGmapGoogleMap","^?uiGmapMarker"],this.template='',this.$log.info(this),this.childWindows=[]}return c(g,f),g.include(d),g.prototype.link=function(a,c,d,e){var f,g;return f=e.length>1&&null!=e[1]?e[1]:void 0,g=null!=f?f.getScope():void 0,this.mapPromise=b.mapPromise(a,e[0]),this.mapPromise.then(function(b){return function(e){var h;return h=!0,angular.isDefined(d.isiconvisibleonclick)&&(h=a.isIconVisibleOnClick),f?g.deferred.promise.then(function(){return b.init(a,c,h,e,g)}):void b.init(a,c,h,e)}}(this))},g.prototype.init=function(a,b,c,d,f){var g,h,i,j,k;return h=null!=a.options?a.options:{},j=null!=a&&this.validateCoords(a.coords),null!=(null!=f?f.getGMarker:void 0)&&(i=f.getGMarker()),k=j?this.createWindowOptions(i,a,b.html(),h):h,null!=d&&(g=new e({},a,k,c,d,f,b),this.childWindows.push(g),a.$on("$destroy",function(a){return function(){return a.childWindows=_.withoutObjects(a.childWindows,[g],function(a,b){return a.scope.$id===b.scope.$id}),a.childWindows.length=0}}(this))),null!=a.control&&(a.control.getGWindows=function(a){return function(){return a.childWindows.map(function(a){return a.gWin})}}(this),a.control.getChildWindows=function(a){return function(){return a.childWindows}}(this),a.control.showWindow=function(a){return function(){return a.childWindows.map(function(a){return a.showWindow()})}}(this),a.control.hideWindow=function(a){return function(){return a.childWindows.map(function(a){return a.hideWindow()})}}(this)),null!=this.onChildCreation&&null!=g?this.onChildCreation(g):void 0},g}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapWindows",["uiGmapIWindow","uiGmapWindowsParentModel","uiGmapPromise",function(b,d,e){var f;return f=function(b){function f(){this.init=a(this.init,this),this.link=a(this.link,this),f.__super__.constructor.call(this),this.require=["^uiGmapGoogleMap","^?uiGmapMarkers"],this.template='',this.scope.idKey="=idkey",this.scope.doRebuildAll="=dorebuildall",this.scope.models="=models",this.$log.debug(this)}return c(f,b),f.prototype.link=function(a,b,c,d){var f,g,h;return f=d[0].getScope(),g=d.length>1&&null!=d[1]?d[1]:void 0,h=null!=g?g.getScope():void 0,f.deferred.promise.then(function(f){return function(g){var i,j;return i=(null!=h&&null!=(j=h.deferred)?j.promise:void 0)||e.resolve(),i.then(function(){var e,i;return e=null!=(i=f.parentModel)?i.existingPieces:void 0,e?e.then(function(){return f.init(a,b,c,d,g,h)}):f.init(a,b,c,d,g,h)})}}(this))},f.prototype.init=function(a,b,c,e,f,g){var h;return h=new d(a,b,c,e,f,g),null!=a.control?(a.control.getGWindows=function(){return function(){return h.windows.map(function(a){return a.gWin})}}(this),a.control.getChildWindows=function(){return function(){return h.windows}}(this)):void 0},f}(b)}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapGoogleMap",["uiGmapMap",function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("Marker".ns(),["$timeout","Marker".ns(),function(a,b){return new b(a)}])}.call(this),function(){angular.module("google-maps".ns()).directive("Markers".ns(),["$timeout","Markers".ns(),function(a,b){return new b(a)}])}.call(this),function(){angular.module("google-maps".ns()).directive("Polygon".ns(),["Polygon".ns(),function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("Circle".ns(),["Circle".ns(),function(a){return a}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapPolyline",["uiGmapPolyline",function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("Polylines".ns(),["Polylines".ns(),function(a){return new a}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapRectangle",["uiGmapLogger","uiGmapRectangle",function(a,b){return b}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapWindow",["$timeout","$compile","$http","$templateCache","uiGmapWindow",function(a,b,c,d,e){return new e(a,b,c,d)}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapWindows",["$timeout","$compile","$http","$templateCache","$interpolate","uiGmapWindows",function(a,b,c,d,e,f){return new f(a,b,c,d,e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};angular.module("uiGmapgoogle-maps").directive("uiGmapLayer",["$timeout","uiGmapLogger","uiGmapLayerParentModel",function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.template='',this.replace=!0,this.scope={show:"=show",type:"=type",namespace:"=namespace",options:"=options",onCreated:"&oncreated"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(){return function(e){return null!=a.onCreated?new d(a,b,c,e,a.onCreated):new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapMapControl",["uiGmapControl",function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("DrawingManager".ns(),["DrawingManager".ns(),function(a){return a}])}.call(this),function(){angular.module("google-maps".ns()).directive("FreeDrawPolygons".ns(),["ApiFreeDrawPolygons".ns(),function(a){return new a}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};angular.module("uiGmapgoogle-maps").directive("uiGmapMapType",["$timeout","uiGmapLogger","uiGmapMapTypeParentModel",function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.template='',this.replace=!0,this.scope={show:"=show",options:"=options",refresh:"=refresh",id:"@"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(){return function(e){return new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};angular.module("google-maps".ns()).directive("SearchBox".ns(),["GoogleMapApi".ns(),"Logger".ns(),"SearchBoxParentModel".ns(),"$http","$templateCache",function(b,c,d,e,f){var g;return new(g=function(){function g(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.template='',this.replace=!0,this.scope={template:"=template",position:"=position",options:"=options",events:"=events",parentdiv:"=parentdiv"}}return g.prototype.link=function(a,c,g,h){return b.then(function(b){return function(i){return e.get(a.template,{cache:f}).success(function(e){return h.getScope().deferred.promise.then(function(f){var h;return h=angular.isDefined(a.position)?a.position.toUpperCase().replace(/-/g,"_"):"TOP_LEFT",i.ControlPosition[h]?new d(a,c,g,f,h,e):void b.$log.error("searchBox: invalid position property")})})}}(this))},g}())}])}.call(this),angular.module("google-maps.wrapped".ns()).service("uuid".ns(),function(){function a(){}return a.generate=function(){var b=a._gri,c=a._ha;return c(b(32),8)+"-"+c(b(16),4)+"-"+c(16384|b(12),4)+"-"+c(32768|b(14),4)+"-"+c(b(48),12)},a._gri=function(a){return 0>a?0/0:30>=a?0|Math.random()*(1<=a?(0|1073741824*Math.random())+1073741824*(0|Math.random()*(1<0;d>>>=1,e+=e)1&d&&(c=e+c);return c},a}),angular.module("google-maps.wrapped".ns()).service("GoogleMapsUtilV3".ns(),function(){return{init:_.once(function(){function a(a){a=a||{},google.maps.OverlayView.apply(this,arguments),this.content_=a.content||"",this.disableAutoPan_=a.disableAutoPan||!1,this.maxWidth_=a.maxWidth||0,this.pixelOffset_=a.pixelOffset||new google.maps.Size(0,0),this.position_=a.position||new google.maps.LatLng(0,0),this.zIndex_=a.zIndex||null,this.boxClass_=a.boxClass||"infoBox",this.boxStyle_=a.boxStyle||{},this.closeBoxMargin_=a.closeBoxMargin||"2px",this.closeBoxURL_=a.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===a.closeBoxURL&&(this.closeBoxURL_=""),this.infoBoxClearance_=a.infoBoxClearance||new google.maps.Size(1,1),"undefined"==typeof a.visible&&(a.visible="undefined"==typeof a.isHidden?!0:!a.isHidden),this.isHidden_=!a.visible,this.alignBottom_=a.alignBottom||!1,this.pane_=a.pane||"floatPane",this.enableEventPropagation_=a.enableEventPropagation||!1,this.div_=null,this.closeListener_=null,this.moveListener_=null,this.contextListener_=null,this.eventListeners_=null,this.fixedWidthSet_=null}function b(a,c){a.getMarkerClusterer().extend(b,google.maps.OverlayView),this.cluster_=a,this.className_=a.getMarkerClusterer().getClusterClass(),this.styles_=c,this.center_=null,this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(a.getMap())}function c(a){this.markerClusterer_=a,this.map_=a.getMap(),this.gridSize_=a.getGridSize(),this.minClusterSize_=a.getMinimumClusterSize(),this.averageCenter_=a.getAverageCenter(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new b(this,a.getStyles())}function d(a,b,c){this.extend(d,google.maps.OverlayView),b=b||[],c=c||{},this.markers_=[],this.clusters_=[],this.listeners_=[],this.activeMap_=null,this.ready_=!1,this.gridSize_=c.gridSize||60,this.minClusterSize_=c.minimumClusterSize||2,this.maxZoom_=c.maxZoom||null,this.styles_=c.styles||[],this.title_=c.title||"",this.zoomOnClick_=!0,void 0!==c.zoomOnClick&&(this.zoomOnClick_=c.zoomOnClick),this.averageCenter_=!1,void 0!==c.averageCenter&&(this.averageCenter_=c.averageCenter),this.ignoreHidden_=!1,void 0!==c.ignoreHidden&&(this.ignoreHidden_=c.ignoreHidden),this.enableRetinaIcons_=!1,void 0!==c.enableRetinaIcons&&(this.enableRetinaIcons_=c.enableRetinaIcons),this.imagePath_=c.imagePath||d.IMAGE_PATH,this.imageExtension_=c.imageExtension||d.IMAGE_EXTENSION,this.imageSizes_=c.imageSizes||d.IMAGE_SIZES,this.calculator_=c.calculator||d.CALCULATOR,this.batchSize_=c.batchSize||d.BATCH_SIZE,this.batchSizeIE_=c.batchSizeIE||d.BATCH_SIZE_IE,this.clusterClass_=c.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(this.batchSize_=this.batchSizeIE_),this.setupStyles_(),this.addMarkers(b,!0),this.setMap(a)}function e(a,b){function c(){}c.prototype=b.prototype,a.superClass_=b.prototype,a.prototype=new c,a.prototype.constructor=a}function f(a,b){this.marker_=a,this.handCursorURL_=a.handCursorURL,this.labelDiv_=document.createElement("div"),this.labelDiv_.style.cssText="position: absolute; overflow: hidden;",this.eventDiv_=document.createElement("div"),this.eventDiv_.style.cssText=this.labelDiv_.style.cssText,this.eventDiv_.setAttribute("onselectstart","return false;"),this.eventDiv_.setAttribute("ondragstart","return false;"),this.crossDiv_=f.getSharedCross(b)}function g(a){a=a||{},a.labelContent=a.labelContent||"",a.labelAnchor=a.labelAnchor||new google.maps.Point(0,0),a.labelClass=a.labelClass||"markerLabels",a.labelStyle=a.labelStyle||{},a.labelInBackground=a.labelInBackground||!1,"undefined"==typeof a.labelVisible&&(a.labelVisible=!0),"undefined"==typeof a.raiseOnDrag&&(a.raiseOnDrag=!0),"undefined"==typeof a.clickable&&(a.clickable=!0),"undefined"==typeof a.draggable&&(a.draggable=!1),"undefined"==typeof a.optimized&&(a.optimized=!1),a.crossImage=a.crossImage||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png",a.handCursor=a.handCursor||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur",a.optimized=!1,this.label=new f(this,a.crossImage,a.handCursor),google.maps.Marker.apply(this,arguments)}a.prototype=new google.maps.OverlayView,a.prototype.createInfoBoxDiv_=function(){var a,b,c,d=this,e=function(a){a.cancelBubble=!0,a.stopPropagation&&a.stopPropagation()},f=function(a){a.returnValue=!1,a.preventDefault&&a.preventDefault(),d.enableEventPropagation_||e(a)};if(!this.div_){if(this.div_=document.createElement("div"),this.setBoxStyle_(),"undefined"==typeof this.content_.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+this.content_:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(this.content_)),this.getPanes()[this.pane_].appendChild(this.div_),this.addClickHandler_(),this.div_.style.width?this.fixedWidthSet_=!0:0!==this.maxWidth_&&this.div_.offsetWidth>this.maxWidth_?(this.div_.style.width=this.maxWidth_,this.div_.style.overflow="auto",this.fixedWidthSet_=!0):(c=this.getBoxWidths_(),this.div_.style.width=this.div_.offsetWidth-c.left-c.right+"px",this.fixedWidthSet_=!1),this.panBox_(this.disableAutoPan_),!this.enableEventPropagation_){for(this.eventListeners_=[],b=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],a=0;ag&&(d=o.x+k+i+m-g),this.alignBottom_?o.y<-j+n+l?e=o.y+j-n-l:o.y+j+n>h&&(e=o.y+j+n-h):o.y<-j+n?e=o.y+j-n:o.y+l+j+n>h&&(e=o.y+l+j+n-h),0!==d||0!==e){{b.getCenter()}b.panBy(d,e)}}},a.prototype.setBoxStyle_=function(){var a,b;if(this.div_){this.div_.className=this.boxClass_,this.div_.style.cssText="",b=this.boxStyle_;for(a in b)b.hasOwnProperty(a)&&(this.div_.style[a]=b[a]);"undefined"!=typeof this.div_.style.opacity&&""!==this.div_.style.opacity&&(this.div_.style.filter="alpha(opacity="+100*this.div_.style.opacity+")"),this.div_.style.position="absolute",this.div_.style.visibility="hidden",null!==this.zIndex_&&(this.div_.style.zIndex=this.zIndex_)}},a.prototype.getBoxWidths_=function(){var a,b={top:0,bottom:0,left:0,right:0},c=this.div_;return document.defaultView&&document.defaultView.getComputedStyle?(a=c.ownerDocument.defaultView.getComputedStyle(c,""),a&&(b.top=parseInt(a.borderTopWidth,10)||0,b.bottom=parseInt(a.borderBottomWidth,10)||0,b.left=parseInt(a.borderLeftWidth,10)||0,b.right=parseInt(a.borderRightWidth,10)||0)):document.documentElement.currentStyle&&c.currentStyle&&(b.top=parseInt(c.currentStyle.borderTopWidth,10)||0,b.bottom=parseInt(c.currentStyle.borderBottomWidth,10)||0,b.left=parseInt(c.currentStyle.borderLeftWidth,10)||0,b.right=parseInt(c.currentStyle.borderRightWidth,10)||0),b},a.prototype.onRemove=function(){this.div_&&(this.div_.parentNode.removeChild(this.div_),this.div_=null)},a.prototype.draw=function(){this.createInfoBoxDiv_();var a=this.getProjection().fromLatLngToDivPixel(this.position_);this.div_.style.left=a.x+this.pixelOffset_.width+"px",this.alignBottom_?this.div_.style.bottom=-(a.y+this.pixelOffset_.height)+"px":this.div_.style.top=a.y+this.pixelOffset_.height+"px",this.div_.style.visibility=this.isHidden_?"hidden":"visible"},a.prototype.setOptions=function(a){"undefined"!=typeof a.boxClass&&(this.boxClass_=a.boxClass,this.setBoxStyle_()),"undefined"!=typeof a.boxStyle&&(this.boxStyle_=a.boxStyle,this.setBoxStyle_()),"undefined"!=typeof a.content&&this.setContent(a.content),"undefined"!=typeof a.disableAutoPan&&(this.disableAutoPan_=a.disableAutoPan),"undefined"!=typeof a.maxWidth&&(this.maxWidth_=a.maxWidth),"undefined"!=typeof a.pixelOffset&&(this.pixelOffset_=a.pixelOffset),"undefined"!=typeof a.alignBottom&&(this.alignBottom_=a.alignBottom),"undefined"!=typeof a.position&&this.setPosition(a.position),"undefined"!=typeof a.zIndex&&this.setZIndex(a.zIndex),"undefined"!=typeof a.closeBoxMargin&&(this.closeBoxMargin_=a.closeBoxMargin),"undefined"!=typeof a.closeBoxURL&&(this.closeBoxURL_=a.closeBoxURL),"undefined"!=typeof a.infoBoxClearance&&(this.infoBoxClearance_=a.infoBoxClearance),"undefined"!=typeof a.isHidden&&(this.isHidden_=a.isHidden),"undefined"!=typeof a.visible&&(this.isHidden_=!a.visible),"undefined"!=typeof a.enableEventPropagation&&(this.enableEventPropagation_=a.enableEventPropagation),this.div_&&this.draw()},a.prototype.setContent=function(a){this.content_=a,this.div_&&(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.fixedWidthSet_||(this.div_.style.width=""),"undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a)),this.fixedWidthSet_||(this.div_.style.width=this.div_.offsetWidth+"px","undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a))),this.addClickHandler_()),google.maps.event.trigger(this,"content_changed")},a.prototype.setPosition=function(a){this.position_=a,this.div_&&this.draw(),google.maps.event.trigger(this,"position_changed")},a.prototype.setZIndex=function(a){this.zIndex_=a,this.div_&&(this.div_.style.zIndex=a),google.maps.event.trigger(this,"zindex_changed")},a.prototype.setVisible=function(a){this.isHidden_=!a,this.div_&&(this.div_.style.visibility=this.isHidden_?"hidden":"visible")},a.prototype.getContent=function(){return this.content_},a.prototype.getPosition=function(){return this.position_},a.prototype.getZIndex=function(){return this.zIndex_},a.prototype.getVisible=function(){var a;return a="undefined"==typeof this.getMap()||null===this.getMap()?!1:!this.isHidden_},a.prototype.show=function(){this.isHidden_=!1,this.div_&&(this.div_.style.visibility="visible")},a.prototype.hide=function(){this.isHidden_=!0,this.div_&&(this.div_.style.visibility="hidden")},a.prototype.open=function(a,b){var c=this;b&&(this.position_=b.getPosition(),this.moveListener_=google.maps.event.addListener(b,"position_changed",function(){c.setPosition(this.getPosition())})),this.setMap(a),this.div_&&this.panBox_()},a.prototype.close=function(){var a;if(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.eventListeners_){for(a=0;af&&g.getMap().setZoom(f+1)},100)),d.cancelBubble=!0,d.stopPropagation&&d.stopPropagation()}}),google.maps.event.addDomListener(this.div_,"mouseover",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseover",c.cluster_)}),google.maps.event.addDomListener(this.div_,"mouseout",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseout",c.cluster_)})},b.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},b.prototype.draw=function(){if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.top=a.y+"px",this.div_.style.left=a.x+"px"}},b.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},b.prototype.show=function(){if(this.div_){var a="",b=this.backgroundPosition_.split(" "),c=parseInt(b[0].trim(),10),d=parseInt(b[1].trim(),10),e=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(e),a="",this.div_.innerHTML=a+"
"+this.sums_.text+"
",this.div_.title="undefined"==typeof this.sums_.title||""===this.sums_.title?this.cluster_.getMarkerClusterer().getTitle():this.sums_.title,this.div_.style.display="" +(function(){String.prototype.contains=function(a,b){return-1!==this.indexOf(a,b)},String.prototype.flare=function(a){return null==a&&(a="uiGmap"),a+this},String.prototype.ns=String.prototype.flare}).call(this),function(){_.intersectionObjects=function(a,b,c){var d;return null==c&&(c=void 0),d=_.map(a,function(){return function(a){return _.find(b,function(b){return null!=c?c(a,b):_.isEqual(a,b)})}}(this)),_.filter(d,function(a){return null!=a})},_.containsObject=_.includeObject=function(a,b,c){return null==c&&(c=void 0),null===a?!1:_.any(a,function(){return function(a){return null!=c?c(a,b):_.isEqual(a,b)}}(this))},_.differenceObjects=function(a,b,c){return null==c&&(c=void 0),_.filter(a,function(a){return!_.containsObject(b,a,c)})},_.withoutObjects=_.differenceObjects,_.indexOfObject=function(a,b,c,d){var e,f;if(null==a)return-1;if(e=0,f=a.length,d){if("number"!=typeof d)return e=_.sortedIndex(a,b),a[e]===b?e:-1;e=0>d?Math.max(0,f+d):d}for(;f>e;){if(null!=c){if(c(a[e],b))return e}else if(_.isEqual(a[e],b))return e;e++}return-1},_["extends"]=function(a){return _.reduce(a,function(a,b){return _.extend(a,b)},{})},_.isNullOrUndefined=function(a){return _.isNull(a||_.isUndefined(a))}}.call(this),function(){angular.module("uiGmapgoogle-maps.providers",[]),angular.module("uiGmapgoogle-maps.wrapped",[]),angular.module("uiGmapgoogle-maps.extensions",["uiGmapgoogle-maps.wrapped","uiGmapgoogle-maps.providers"]),angular.module("uiGmapgoogle-maps.directives.api.utils",["uiGmapgoogle-maps.extensions"]),angular.module("uiGmapgoogle-maps.directives.api.managers",[]),angular.module("uiGmapgoogle-maps.directives.api.options",["uiGmapgoogle-maps.directives.api.utils"]),angular.module("uiGmapgoogle-maps.directives.api.options.builders",[]),angular.module("uiGmapgoogle-maps.directives.api.models.child",["uiGmapgoogle-maps.directives.api.utils","uiGmapgoogle-maps.directives.api.options","uiGmapgoogle-maps.directives.api.options.builders"]),angular.module("uiGmapgoogle-maps.directives.api.models.parent",["uiGmapgoogle-maps.directives.api.managers","uiGmapgoogle-maps.directives.api.models.child","uiGmapgoogle-maps.providers"]),angular.module("uiGmapgoogle-maps.directives.api",["uiGmapgoogle-maps.directives.api.models.parent"]),angular.module("uiGmapgoogle-maps",["uiGmapgoogle-maps.directives.api","uiGmapgoogle-maps.providers"]).factory("uiGmapdebounce",["$timeout",function(a){return function(b){var c;return c=0,function(){var d,e,f;return f=this,d=arguments,c++,e=function(a){return function(){return a===c?b.apply(f,d):void 0}}(c),a(e,0,!0)}}}])}.call(this),function(){angular.module("google-maps.providers".ns()).factory("MapScriptLoader".ns(),["$q","uuid".ns(),function(a,b){var c,d;return d=void 0,c=function(a){return a.china?"http://maps.google.cn/maps/api/js?":"https://maps.googleapis.com/maps/api/js?"},{load:function(e){var f,g,h,i;return f=a.defer(),angular.isDefined(window.google)&&angular.isDefined(window.google.maps)?(f.resolve(window.google.maps),f.promise):(h=e.callback="onGoogleMapsReady"+Math.round(1e3*Math.random()),window[h]=function(){window[h]=null,f.resolve(window.google.maps)},g=_.map(e,function(a,b){return b+"="+a}),d&&document.getElementById(d).remove(),g=g.join("&"),i=document.createElement("script"),d="ui_gmap_map_load_"+b.generate(),i.id=d,i.type="text/javascript",i.src=c(e)+g,document.body.appendChild(i),f.promise)}}}]).provider("GoogleMapApi".ns(),function(){return this.options={china:!1,v:"3.17",libraries:"",language:"en",sensor:"false"},this.configure=function(a){angular.extend(this.options,a)},this.$get=["MapScriptLoader".ns(),function(a){return function(b){return b.load(a.options)}}(this)],this})}.call(this),function(){angular.module("google-maps.extensions".ns()).service("ExtendGWin".ns(),function(){return{init:_.once(function(){return google||("undefined"!=typeof google&&null!==google?google.maps:void 0)||null!=google.maps.InfoWindow?(google.maps.InfoWindow.prototype._open=google.maps.InfoWindow.prototype.open,google.maps.InfoWindow.prototype._close=google.maps.InfoWindow.prototype.close,google.maps.InfoWindow.prototype._isOpen=!1,google.maps.InfoWindow.prototype.open=function(a,b,c){null==c&&(this._isOpen=!0,this._open(a,b,!0))},google.maps.InfoWindow.prototype.close=function(a){null==a&&(this._isOpen=!1,this._close(!0))},google.maps.InfoWindow.prototype.isOpen=function(a){return null==a&&(a=void 0),null==a?this._isOpen:this._isOpen=a},window.InfoBox&&(window.InfoBox.prototype._open=window.InfoBox.prototype.open,window.InfoBox.prototype._close=window.InfoBox.prototype.close,window.InfoBox.prototype._isOpen=!1,window.InfoBox.prototype.open=function(a,b){this._isOpen=!0,this._open(a,b)},window.InfoBox.prototype.close=function(){this._isOpen=!1,this._close()},window.InfoBox.prototype.isOpen=function(a){return null==a&&(a=void 0),null==a?this._isOpen:this._isOpen=a}),window.MarkerLabel_?(window.MarkerLabel_.prototype.setContent=function(){var a;a=this.marker_.get("labelContent"),a&&!_.isEqual(this.oldContent,a)&&("undefined"==typeof(null!=a?a.nodeType:void 0)?(this.labelDiv_.innerHTML=a,this.eventDiv_.innerHTML=this.labelDiv_.innerHTML,this.oldContent=a):(this.labelDiv_.innerHTML="",this.labelDiv_.appendChild(a),a=a.cloneNode(!0),this.eventDiv_.appendChild(a),this.oldContent=a))},window.MarkerLabel_.prototype.onRemove=function(){null!=this.labelDiv_.parentNode&&this.labelDiv_.parentNode.removeChild(this.labelDiv_),null!=this.eventDiv_.parentNode&&this.eventDiv_.parentNode.removeChild(this.eventDiv_),this.listeners_&&this.listeners_.length&&this.listeners_.forEach(function(a){return google.maps.event.removeListener(a)})}):void 0):void 0})}})}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api.utils").service("uiGmap_sync",[function(){return{fakePromise:function(){var a;return a=void 0,{then:function(b){return a=b},resolve:function(){return a.apply(void 0,arguments)}}}}}]).service("uiGmap_async",["$timeout","uiGmapPromise",function(a,b){var c,d,e,f,g;return c=20,g=function(a,b){return a.existingPieces=a.existingPieces?a.existingPieces.then(function(){return b()}):b()},d=function(b,c,e,f,g,h,i){var j,k,l;try{for(j=c&&c0?e(a,function(a){return i.push(c(a))},d,f,g,h).then(function(){return i}):b.resolve(i)},{each:e,map:f,waitOrGo:g,defaultChunkSize:c}}])}.call(this),function(){var a=[].indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(b in this&&this[b]===a)return b;return-1};angular.module("google-maps.directives.api.utils".ns()).factory("BaseObject".ns(),function(){var b,c;return c=["extended","included"],b=function(){function b(){}return b.extend=function(b){var d,e,f;for(d in b)e=b[d],a.call(c,d)<0&&(this[d]=e);return null!=(f=b.extended)&&f.apply(this),this},b.include=function(b){var d,e,f;for(d in b)e=b[d],a.call(c,d)<0&&(this.prototype[d]=e);return null!=(f=b.included)&&f.apply(this),this},b}()})}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).factory("ChildEvents".ns(),function(){return{onChildCreation:function(){}}})}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).service("CtrlHandle".ns(),["$q",function(a){var b;return b={handle:function(c){return c.$on("$destroy",function(){return b.handle(c)}),c.deferred=a.defer(),{getScope:function(){return c}}},mapPromise:function(a,b){var c;return c=b.getScope(),c.deferred.promise.then(function(b){return a.map=b}),c.deferred.promise}}}])}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).service("EventsHelper".ns(),["Logger".ns(),function(){return{setEvents:function(a,b,c,d){return angular.isDefined(b.events)&&null!=b.events&&angular.isObject(b.events)?_.compact(_.map(b.events,function(e,f){var g;return d&&(g=_(d).contains(f)),b.events.hasOwnProperty(f)&&angular.isFunction(b.events[f])&&!g?google.maps.event.addListener(a,f,function(){return b.$evalAsync(e.apply(b,[a,f,c,arguments]))}):void 0})):void 0},removeEvents:function(a){return null!=a?a.forEach(function(a){return google.maps.event.removeListener(a)}):void 0}}}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.utils".ns()).factory("FitHelper".ns(),["BaseObject".ns(),"Logger".ns(),"_async".ns(),function(a,c,d){var e;return e=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.fit=function(a,b){var c,e;return b&&a&&a.length>0?(c=new google.maps.LatLngBounds,e=!1,d.each(a,function(){return function(a){return a?(e||(e=!0),c.extend(a.getPosition())):void 0}}(this)).then(function(){return e?b.fitBounds(c):void 0})):void 0},c}(a)}])}.call(this),function(){angular.module("google-maps.directives.api.utils".ns()).service("GmapUtil".ns(),["Logger".ns(),"$compile",function(a,b){var c,d,e,f;return d=function(a){return Array.isArray(a)&&2===a.length?a[1]:angular.isDefined(a.type)&&"Point"===a.type?a.coordinates[1]:a.latitude},e=function(a){return Array.isArray(a)&&2===a.length?a[0]:angular.isDefined(a.type)&&"Point"===a.type?a.coordinates[0]:a.longitude},c=function(a){return a?Array.isArray(a)&&2===a.length?new google.maps.LatLng(a[1],a[0]):angular.isDefined(a.type)&&"Point"===a.type?new google.maps.LatLng(a.coordinates[1],a.coordinates[0]):new google.maps.LatLng(a.latitude,a.longitude):void 0},f=function(a){if(angular.isUndefined(a))return!1;if(_.isArray(a)){if(2===a.length)return!0}else if(null!=a&&(null!=a?a.type:void 0)&&"Point"===a.type&&_.isArray(a.coordinates)&&2===a.coordinates.length)return!0;return a&&angular.isDefined((null!=a?a.latitude:void 0)&&angular.isDefined(null!=a?a.longitude:void 0))?!0:!1},{setCoordsFromEvent:function(a,b){return a?(Array.isArray(a)&&2===a.length?(a[1]=b.lat(),a[0]=b.lng()):angular.isDefined(a.type)&&"Point"===a.type?(a.coordinates[1]=b.lat(),a.coordinates[0]=b.lng()):(a.latitude=b.lat(),a.longitude=b.lng()),a):void 0},getLabelPositionPoint:function(a){var b,c;return void 0===a?void 0:(a=/^([-\d\.]+)\s([-\d\.]+)$/.exec(a),b=parseFloat(a[1]),c=parseFloat(a[2]),null!=b&&null!=c?new google.maps.Point(b,c):void 0)},createWindowOptions:function(d,e,f,g){var h;return null!=f&&null!=g&&null!=b?(h=angular.extend({},g,{content:this.buildContent(e,g,f),position:null!=g.position?g.position:angular.isObject(d)?d.getPosition():c(e.coords)}),null!=d&&null==(null!=h?h.pixelOffset:void 0)&&(null==h.boxClass||(h.pixelOffset={height:0,width:-2})),h):g?g:(a.error("infoWindow defaults not defined"),f?void 0:a.error("infoWindow content not defined"))},buildContent:function(a,c,d){var e,f;return null!=c.content?f=c.content:null!=b?(d=d.replace(/^\s+|\s+$/g,""),e=""===d?"":b(d)(a),e.length>0&&(f=e[0])):f=d,f},defaultDelay:50,isTrue:function(a){return angular.isDefined(a)&&null!==a&&a===!0||"1"===a||"y"===a||"true"===a},isFalse:function(a){return-1!==["false","FALSE",0,"n","N","no","NO"].indexOf(a)},getCoords:c,validateCoords:f,equalCoords:function(a,b){return d(a)===d(b)&&e(a)===e(b)},validatePath:function(a){var b,c,d,e;if(c=0,angular.isUndefined(a.type)){if(!Array.isArray(a)||a.length<2)return!1;for(;cthis.max?(this.max=a[0].length,this.index=b):void 0},e),d=a.coordinates[e.index],b=d[0],b.length<4)return!1}else{if("LineString"!==a.type)return!1;if(a.coordinates.length<2)return!1;b=a.coordinates}for(;cthis.max?(this.max=a[0].length,this.index=b):void 0},f),b=a.coordinates[f.index][0]):"LineString"===a.type&&(b=a.coordinates);cd;)l=j.getAt(d),h=a[d],"function"==typeof h.equals?h.equals(l)||(j.setAt(d,h),c=!0):(l.lat()!==h.latitude||l.lng()!==h.longitude)&&(j.setAt(d,new google.maps.LatLng(h.latitude,h.longitude)),c=!0),d++;for(;g>d;)h=a[d],j.push("function"==typeof h.lat&&"function"==typeof h.lng?h:new google.maps.LatLng(h.latitude,h.longitude)),c=!0,d++;for(;k>d;)j.pop(),c=!0,d++}return i=!1,c?e(j):void 0},h=function(a){var c,d,f,g,h,j,k,l,n;if(i=!0,k=b,d=!1,a){for("Polygon"===m.type?c=a.coordinates[0]:"LineString"===m.type&&(c=a.coordinates),f=0,l=k.getLength(),h=c.length,g=Math.min(l,h),j=void 0;g>f;)n=k.getAt(f),j=c[f],(n.lat()!==j[1]||n.lng()!==j[0])&&(k.setAt(f,new google.maps.LatLng(j[1],j[0])),d=!0),f++;for(;h>f;)j=c[f],k.push(new google.maps.LatLng(j[1],j[0])),d=!0,f++;for(;l>f;)k.pop(),d=!0,f++}return i=!1,d?e(k):void 0},c["static"]||(n=angular.isUndefined(m.type)?c.$watchCollection(d,k):c.$watch(d,h,!0)),function(){return l&&(l(),l=null),n?(n(),n=null):void 0}}}])}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api.utils").factory("uiGmapChromeFixes",[function(){return{maybeRepaint:function(a){var b;return a?(b=a.style.display,a.style.display="none",_.defer(function(){return a.style.display=b})):void 0}}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.options.builders".ns()).service("CommonOptionsBuilder".ns(),["BaseObject".ns(),"Logger".ns(),function(b,d){var e;return e=function(b){function e(){return this.watchProps=a(this.watchProps,this),this.buildOpts=a(this.buildOpts,this),e.__super__.constructor.apply(this,arguments)}return c(e,b),e.prototype.props=["clickable","draggable","editable","visible",{prop:"stroke",isColl:!0}],e.prototype.buildOpts=function(a,b){var c,e,f,g,h,i;return null==a&&(a={}),null==b&&(b={}),this.scope?this.map?(c=_(this.scope).chain().keys().contains("model").value(),e=c?this.scope.model:this.scope,f=angular.extend(a,this.DEFAULTS,{map:this.map,strokeColor:null!=(g=e.stroke)?g.color:void 0,strokeOpacity:null!=(h=e.stroke)?h.opacity:void 0,strokeWeight:null!=(i=e.stroke)?i.weight:void 0}),angular.forEach(angular.extend(b,{clickable:!0,draggable:!1,editable:!1,"static":!1,fit:!1,visible:!0,zIndex:0}),function(){return function(a,b){return f[b]=angular.isUndefined(e[b]||null===e[b])?a:e[b]}}(this)),f["static"]&&(f.editable=!1),f):void d.error("this.map not defined in CommonOptionsBuilder can not buildOpts"):void d.error("this.scope not defined in CommonOptionsBuilder can not buildOpts")},e.prototype.watchProps=function(a){return null==a&&(a=this.props),a.forEach(function(a){return function(b){return null!=a.attrs[b]||null!=a.attrs[null!=b?b.prop:void 0]?(null!=b?b.isColl:void 0)?a.scope.$watchCollection(b.prop,a.setMyOptions):a.scope.$watch(b,a.setMyOptions):void 0}}(this))},e}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.options.builders".ns()).factory("PolylineOptionsBuilder".ns(),["CommonOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a){return c.__super__.buildOpts.call(this,{path:a},{geodesic:!1})},c}(a)}]).factory("ShapeOptionsBuilder".ns(),["CommonOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a,b){var d,e;return a=angular.extend(a,{fillColor:null!=(d=this.scope.fill)?d.color:void 0,fillOpacity:null!=(e=this.scope.fill)?e.opacity:void 0}),c.__super__.buildOpts.call(this,a,b)},c}(a)}]).factory("PolygonOptionsBuilder".ns(),["ShapeOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a){return c.__super__.buildOpts.call(this,{path:a},{geodesic:!1})},c}(a)}]).factory("RectangleOptionsBuilder".ns(),["ShapeOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a){return c.__super__.buildOpts.call(this,{bounds:a})},c}(a)}]).factory("CircleOptionsBuilder".ns(),["ShapeOptionsBuilder".ns(),function(a){var c;return c=function(a){function c(){return c.__super__.constructor.apply(this,arguments)}return b(c,a),c.prototype.buildOpts=function(a,b){return c.__super__.buildOpts.call(this,{center:a,radius:b}) +},c}(a)}])}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api.options").service("uiGmapMarkerOptions",["uiGmapLogger","uiGmapGmapUtil",function(a,b){return _.extend(b,{createOptions:function(a,c,d,e){var f;return null==d&&(d={}),f=angular.extend({},d,{position:null!=d.position?d.position:b.getCoords(a),visible:null!=d.visible?d.visible:b.validateCoords(a)}),(null!=d.icon||null!=c)&&(f=angular.extend(f,{icon:null!=d.icon?d.icon:c})),null!=e&&(f.map=e),f},isLabel:function(a){return null!=a.labelContent||null!=a.labelAnchor||null!=a.labelClass||null!=a.labelStyle||null!=a.labelVisible?!0:!1}})}])}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api.models.child").factory("uiGmapDrawFreeHandChildModel",["uiGmapLogger","$q",function(a,b){var c,d;return c=function(a,b,c){var d,e;return this.polys=b,e=new google.maps.Polyline({map:a,clickable:!1}),d=google.maps.event.addListener(a,"mousemove",function(a){return e.getPath().push(a.latLng)}),void google.maps.event.addListenerOnce(a,"mouseup",function(){var f;return google.maps.event.removeListener(d),f=e.getPath(),e.setMap(null),b.push(new google.maps.Polygon({map:a,path:f})),e=null,google.maps.event.clearListeners(a.getDiv(),"mousedown"),c()})},d=function(d){var e,f;return this.map=d,f=function(a){return function(){var b;return null!=(b=a.deferred)&&b.resolve(),a.map.setOptions(a.oldOptions)}}(this),e=function(b){return function(){return a.info("disabling map move"),b.oldOptions=d.getOptions(),b.map.setOptions({draggable:!1,zoomControl:!1,scrollwheel:!1,disableDoubleClickZoom:!1})}}(this),this.engage=function(d){return function(g){return d.polys=g,d.deferred=b.defer(),e(),a.info("DrawFreeHandChildModel is engaged (drawing)."),google.maps.event.addDomListener(d.map.getDiv(),"mousedown",function(){return c(d.map,d.polys,f)}),d.deferred.promise}}(this),this}}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api.models.child").factory("uiGmapMarkerChildModel",["uiGmapModelKey","uiGmapGmapUtil","uiGmapLogger","uiGmapEventsHelper","uiGmapPropertyAction","uiGmapMarkerOptions","uiGmapIMarker","uiGmapMarkerManager","uiGmapPromise",function(b,d,e,f,g,h,i,j,k){var l,m;return m=["coords","icon","options","fit"],l=function(b){function l(b,c,d,f,h,j,n,o,p,q){var r,s;this.model=c,this.keys=d,this.gMap=f,this.defaults=h,this.doClick=j,this.gMarkerManager=n,this.doDrawSelf=null!=o?o:!0,this.trackModel=null!=p?p:!0,this.needRedraw=null!=q?q:!1,this.internalEvents=a(this.internalEvents,this),this.setLabelOptions=a(this.setLabelOptions,this),this.setOptions=a(this.setOptions,this),this.setIcon=a(this.setIcon,this),this.setCoords=a(this.setCoords,this),this.isNotValid=a(this.isNotValid,this),this.maybeSetScopeValue=a(this.maybeSetScopeValue,this),this.createMarker=a(this.createMarker,this),this.setMyScope=a(this.setMyScope,this),this.destroy=a(this.destroy,this),this.deferred=k.defer(),_.each(this.keys,function(a){return function(b,c){return a[c+"Key"]=_.isFunction(a.keys[c])?a.keys[c]():a.keys[c]}}(this)),this.idKey=this.idKeyKey||"id",null!=this.model[this.idKey]&&(this.id=this.model[this.idKey]),l.__super__.constructor.call(this,b),this.setMyScope("all",this.model,void 0,!0),this.scope.getGMarker=function(a){return function(){return a.gMarker}}(this),this.createMarker(this.model),s=!0,this.trackModel?(this.scope.model=this.model,this.scope.$watch("model",function(a){return function(b,c){var d;return b!==c?(d=a.getChanges(b,c,i.keys),_.each(d,function(d,e){return a.setMyScope(e,b,c),a.needRedraw=!0})):void 0}}(this),!0)):(r=new g(function(a){return function(c){return a.setMyScope(c,b)}}(this),!1),_.each(this.keys,function(a,c){return b.$watch(c,r.sic,!0)})),this.scope.$on("$destroy",function(a){return function(){return m(a)}}(this)),e.info(this)}var m;return c(l,b),l.include(d),l.include(f),l.include(h),m=function(a){return null!=(null!=a?a.gMarker:void 0)&&(a.removeEvents(a.externalListeners),a.removeEvents(a.internalListeners),null!=a?a.gMarker:void 0)?(a.removeFromManager&&a.gMarkerManager.remove(a.gMarker),a.gMarker.setMap(null),a.gMarker=null):void 0},l.prototype.destroy=function(a){return null==a&&(a=!0),this.removeFromManager=a,this.scope.$destroy()},l.prototype.setMyScope=function(a,b,c,d){var e;switch(null==c&&(c=void 0),null==d&&(d=!1),null==b&&(b=this.model),this.gMarker||(this.setOptions(this.scope),e=!0),a){case"all":return _.each(this.keys,function(a){return function(e,f){return a.setMyScope(f,b,c,d)}}(this));case"icon":return this.maybeSetScopeValue("icon",b,c,this.iconKey,this.evalModelHandle,d,this.setIcon);case"coords":return this.maybeSetScopeValue("coords",b,c,this.coordsKey,this.evalModelHandle,d,this.setCoords);case"options":if(!e)return this.createMarker(b,c,d)}},l.prototype.createMarker=function(a,b,c){return null==b&&(b=void 0),null==c&&(c=!1),this.maybeSetScopeValue("options",a,b,this.optionsKey,this.evalModelHandle,c,this.setOptions)},l.prototype.maybeSetScopeValue=function(a,b,c,d,e,f,g){var h,i;return null==g&&(g=void 0),void 0===c?(this.scope[a]=e(b,d),void(null!=g&&g(this.scope))):(i=e(c,d),h=e(b,d),h!==i&&(this.scope[a]=h,!f&&(null!=g&&g(this.scope),this.doDrawSelf))?this.gMarkerManager.draw():void 0)},l.prototype.isNotValid=function(a,b){var c,d;return null==b&&(b=!0),d=b?void 0===this.gMarker:!1,c=this.trackModel?!1:a.$id!==this.scope.$id,c||d},l.prototype.setCoords=function(a){return this.isNotValid(a)||null==this.gMarker?void 0:null!=this.getProp(this.coordsKey,this.model)?this.validateCoords(this.getProp(this.coordsKey,this.model))?(this.gMarker.setPosition(this.getCoords(this.getProp(this.coordsKey,this.model))),this.gMarker.setVisible(this.validateCoords(this.getProp(this.coordsKey,this.model))),this.gMarkerManager.add(this.gMarker)):void e.debug("MarkerChild does not have coords yet. They may be defined later."):this.gMarkerManager.remove(this.gMarker)},l.prototype.setIcon=function(a){return this.isNotValid(a)||null==this.gMarker?void 0:(this.gMarker.setIcon(this.getProp(this.iconKey,this.model)),this.gMarkerManager.add(this.gMarker),this.gMarker.setPosition(this.getCoords(this.getProp(this.coordsKey,this.model))),this.gMarker.setVisible(this.validateCoords(this.getProp(this.coordsKey,this.model))))},l.prototype.setOptions=function(a){var b,c,d;if(!this.isNotValid(a,!1)&&null!=a.coords)return b=this.getProp(this.coordsKey,this.model),c=this.getProp(this.iconKey,this.model),d=this.getProp(this.optionsKey,this.model),this.opts=this.createOptions(b,c,d),null!=this.gMarker&&this.isLabel(this.gMarker===this.isLabel(this.opts))?this.gMarker.setOptions(this.opts):null!=this.gMarker&&(this.gMarkerManager.remove(this.gMarker),this.gMarker=null),this.gMarker||(this.gMarker=this.isLabel(this.opts)?new MarkerWithLabel(this.setLabelOptions(this.opts)):new google.maps.Marker(this.opts)),this.externalListeners&&this.removeEvents(this.externalListeners),this.internalListeners&&this.removeEvents(this.internalListeners),this.externalListeners=this.setEvents(this.gMarker,this.scope,this.model,["dragend"]),this.internalListeners=this.setEvents(this.gMarker,{events:this.internalEvents(),$evalAsync:function(){}},this.model),null!=this.id&&(this.gMarker.key=this.id),this.gMarkerManager.add(this.gMarker),this.gMarker&&(this.gMarker.getMap()||this.gMarkerManager.type!==j.type)?this.deferred.resolve(this.gMarker):(this.gMarker||this.deferred.reject("gMarker is null"),this.gMarker.getMap()&&this.gMarkerManager.type===j.type||(e.warn("gMarker has no map yet"),this.deferred.resolve(this.gMarker))),this.model[this.fitKey]?this.gMarkerManager.fit():void 0},l.prototype.setLabelOptions=function(a){return a.labelAnchor=this.getLabelPositionPoint(a.labelAnchor),a},l.prototype.internalEvents=function(){return{dragend:function(a){return function(b,c,d,e){var f,g,h;return g=a.trackModel?a.scope.model:a.model,h=a.setCoordsFromEvent(a.modelOrKey(g,a.coordsKey),a.gMarker.getPosition()),g=a.setVal(d,a.coordsKey,h),f=a.scope.events,null!=(null!=f?f.dragend:void 0)&&f.dragend(b,c,g,e),a.scope.$apply()}}(this),click:function(a){return function(b,c,d,e){var f;return f=_.isFunction(a.clickKey)?a.clickKey:a.getProp(a.clickKey,a.model),a.doClick&&null!=f?a.scope.$evalAsync(f(b,c,a.model,e)):void 0}}(this)}},l}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapPolygonChildModel",["uiGmapPolygonOptionsBuilder","uiGmapLogger","$timeout","uiGmaparray-sync","uiGmapGmapUtil","uiGmapEventsHelper",function(a,c,d,e,f,g){var h;return h=function(a){function d(a,b,d,f,h){var i,j,k;return this.scope=a,this.attrs=b,this.map=d,this.defaults=f,this.model=h,this.listeners=void 0,angular.isUndefined(a.path)||null===a.path||!this.validatePath(a.path)?void c.error("polygon: no valid path attribute found"):(j=this.convertPathPoints(a.path),k=new google.maps.Polygon(this.buildOpts(j)),a.fit&&this.extendMapBounds(this.map,j),!a["static"]&&angular.isDefined(a.editable)&&a.$watch("editable",function(a,b){return a!==b?k.setEditable(a):void 0}),angular.isDefined(a.draggable)&&a.$watch("draggable",function(a,b){return a!==b?k.setDraggable(a):void 0}),angular.isDefined(a.visible)&&a.$watch("visible",function(a,b){return a!==b?k.setVisible(a):void 0}),angular.isDefined(a.geodesic)&&a.$watch("geodesic",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.stroke)&&angular.isDefined(a.stroke.opacity)&&a.$watch("stroke.opacity",function(a){return function(){return k.setOptions(a.buildOpts(k.getPath()))}}(this)),angular.isDefined(a.stroke)&&angular.isDefined(a.stroke.weight)&&a.$watch("stroke.weight",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.stroke)&&angular.isDefined(a.stroke.color)&&a.$watch("stroke.color",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.fill)&&angular.isDefined(a.fill.color)&&a.$watch("fill.color",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.fill)&&angular.isDefined(a.fill.opacity)&&a.$watch("fill.opacity",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.zIndex)&&a.$watch("zIndex",function(a){return function(b,c){return b!==c?k.setOptions(a.buildOpts(k.getPath())):void 0}}(this)),angular.isDefined(a.events)&&null!==a.events&&angular.isObject(a.events)&&(this.listeners=g.setEvents(k,a,a)),i=e(k.getPath(),a,"path",function(b){return function(c){return a.fit?b.extendMapBounds(b.map,c):void 0}}(this)),void a.$on("$destroy",function(a){return function(){return k.setMap(null),a.removeEvents(a.listeners),i?(i(),i=null):void 0}}(this)))}return b(d,a),d.include(f),d.include(g),d}(a)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("ugGmapPolylineChildModel",["uiGmapPolylineOptionsBuilder","uiGmapLogger","$timeout","uiGmaparray-sync","uiGmapGmapUtil","uiGmapEventsHelper",function(b,d,e,f,g,h){var i;return i=function(b){function e(b,c,e,g,h){var i;this.scope=b,this.attrs=c,this.map=e,this.defaults=g,this.model=h,this.clean=a(this.clean,this),i=function(a){return function(){var b;return b=a.convertPathPoints(a.scope.path),null!=a.polyline&&a.clean(),b.length>0&&(a.polyline=new google.maps.Polyline(a.buildOpts(b))),a.polyline?(a.scope.fit&&a.extendMapBounds(e,b),f(a.polyline.getPath(),a.scope,"path",function(b){return a.scope.fit?a.extendMapBounds(e,b):void 0}),a.listeners=a.model?a.setEvents(a.polyline,a.scope,a.model):a.setEvents(a.polyline,a.scope,a.scope)):void 0}}(this),i(),b.$watch("path",function(a){return function(b,c){return _.isEqual(b,c)&&a.polyline?void 0:i()}}(this)),!b["static"]&&angular.isDefined(b.editable)&&b.$watch("editable",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setEditable(b):void 0}}(this)),angular.isDefined(b.draggable)&&b.$watch("draggable",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setDraggable(b):void 0}}(this)),angular.isDefined(b.visible)&&b.$watch("visible",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setVisible(b):void 0}}(this)),angular.isDefined(b.geodesic)&&b.$watch("geodesic",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.stroke)&&angular.isDefined(b.stroke.weight)&&b.$watch("stroke.weight",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.stroke)&&angular.isDefined(b.stroke.color)&&b.$watch("stroke.color",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.stroke)&&angular.isDefined(b.stroke.opacity)&&b.$watch("stroke.opacity",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),angular.isDefined(b.icons)&&b.$watch("icons",function(a){return function(b,c){var d;return b!==c&&null!=(d=a.polyline)?d.setOptions(a.buildOpts(a.polyline.getPath())):void 0}}(this)),b.$on("$destroy",function(a){return function(){return a.clean(),a.scope=null}}(this)),d.info(this)}return c(e,b),e.include(g),e.include(h),e.prototype.clean=function(){var a,b;return this.removeEvents(this.listeners),null!=(b=this.polyline)&&b.setMap(null),this.polyline=null,a?(a(),a=null):void 0},e.prototype.destroy=function(){return this.scope.$destroy()},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api.models.child").factory("uiGmapWindowChildModel",["uiGmapBaseObject","uiGmapGmapUtil","uiGmapLogger","$compile","$http","$templateCache","uiGmapChromeFixes",function(b,d,e,f,g,h,i){var j;return j=function(b){function j(b,c,d,f,g,h,i,j,k){this.model=b,this.scope=c,this.opts=d,this.isIconVisibleOnClick=f,this.mapCtrl=g,this.markerScope=h,this.element=i,this.needToManualDestroy=null!=j?j:!1,this.markerIsVisibleAfterWindowClose=null!=k?k:!0,this.destroy=a(this.destroy,this),this.remove=a(this.remove,this),this.getLatestPosition=a(this.getLatestPosition,this),this.hideWindow=a(this.hideWindow,this),this.showWindow=a(this.showWindow,this),this.handleClick=a(this.handleClick,this),this.watchOptions=a(this.watchOptions,this),this.watchCoords=a(this.watchCoords,this),this.createGWin=a(this.createGWin,this),this.watchElement=a(this.watchElement,this),this.watchAndDoShow=a(this.watchAndDoShow,this),this.doShow=a(this.doShow,this),this.getGmarker=function(){var a,b;return null!=(null!=(a=this.markerScope)?a.getGMarker:void 0)&&null!=(b=this.markerScope)?b.getGMarker():void 0},this.googleMapsHandles=[],this.createGWin(),null!=this.getGmarker()&&this.getGmarker().setClickable(!0),this.watchElement(),this.watchOptions(),this.watchCoords(),this.watchAndDoShow(),this.scope.$on("$destroy",function(a){return function(){return a.destroy()}}(this)),e.info(this)}return c(j,b),j.include(d),j.prototype.doShow=function(){return this.scope.show?this.showWindow():this.hideWindow()},j.prototype.watchAndDoShow=function(){return null!=this.model.show&&(this.scope.show=this.model.show),this.scope.$watch("show",this.doShow,!0),this.doShow()},j.prototype.watchElement=function(){return this.scope.$watch(function(a){return function(){var b;if(a.element||a.html)return a.html!==a.element.html()&&a.gWin?(null!=(b=a.opts)&&(b.content=void 0),a.remove(),a.createGWin()):void 0}}(this))},j.prototype.createGWin=function(){var a,b,c,d;return null==this.gWin&&(a={},null!=this.opts&&(this.scope.coords&&(this.opts.position=this.getCoords(this.scope.coords)),a=this.opts),this.element&&(this.html=_.isObject(this.element)?this.element.html():this.element),b=this.scope.options?this.scope.options:a,this.opts=this.createWindowOptions(this.getGmarker(),this.markerScope||this.scope,this.html,b)),null==this.opts||this.gWin?void 0:(this.gWin=this.opts.boxClass&&window.InfoBox&&"function"==typeof window.InfoBox?new window.InfoBox(this.opts):new google.maps.InfoWindow(this.opts),this.handleClick(null!=(c=this.scope)&&null!=(d=c.options)?d.forceClick:void 0),this.doShow(),this.googleMapsHandles.push(google.maps.event.addListener(this.gWin,"closeclick",function(a){return function(){return a.getGmarker()&&(a.getGmarker().setAnimation(a.oldMarkerAnimation),a.markerIsVisibleAfterWindowClose&&_.delay(function(){return a.getGmarker().setVisible(!1),a.getGmarker().setVisible(a.markerIsVisibleAfterWindowClose)},250)),a.gWin.isOpen(!1),a.model.show=!1,null!=a.scope.closeClick?a.scope.$apply(a.scope.closeClick()):a.scope.$apply()}}(this))))},j.prototype.watchCoords=function(){var a;return a=null!=this.markerScope?this.markerScope:this.scope,a.$watch("coords",function(a){return function(b,c){var d;if(b!==c){if(null==b)a.hideWindow();else if(!a.validateCoords(b))return void e.error("WindowChildMarker cannot render marker as scope.coords as no position on marker: "+JSON.stringify(a.model));if(d=a.getCoords(b),a.gWin.setPosition(d),a.opts)return a.opts.position=d}}}(this),!0)},j.prototype.watchOptions=function(){return this.scope.$watch("options",function(a){return function(b,c){if(b!==c&&(a.opts=b,null!=a.gWin)){if(a.gWin.setOptions(a.opts),null!=a.opts.visible&&a.opts.visible)return a.showWindow();if(null!=a.opts.visible)return a.hideWindow()}}}(this),!0)},j.prototype.handleClick=function(a){var b;if(null!=this.gWin)return b=function(a){return function(){var b,c,d;return null==a.gWin&&a.createGWin(),(b=null!=a.scope.coords?null!=(c=a.gWin)?c.getPosition():void 0:null!=(d=a.getGmarker())?d.getPosition():void 0)?(null!=a.gWin&&(a.gWin.setPosition(b),a.opts&&(a.opts.position=b),a.showWindow()),null!=a.getGmarker()?(a.initialMarkerVisibility=a.getGmarker().getVisible(),a.oldMarkerAnimation=a.getGmarker().getAnimation(),a.getGmarker().setVisible(a.isIconVisibleOnClick)):void 0):void 0}}(this),a&&b(),this.getGmarker()?this.googleMapsHandles.push(google.maps.event.addListener(this.getGmarker(),"click",b)):void 0},j.prototype.showWindow=function(){var a,b,c;return null!=this.gWin?(b=function(a){return function(){return _.defer(function(){return a.gWin.isOpen()?void 0:(a.gWin.open(a.mapCtrl,a.getGmarker()?a.getGmarker():void 0),a.model.show=a.gWin.isOpen(),_.defer(function(){return i.maybeRepaint(a.gWin.content)}))})}}(this),this.scope.templateUrl?g.get(this.scope.templateUrl,{cache:h}).then(function(a){return function(c){var d,e;return e=a.scope.$new(),angular.isDefined(a.scope.templateParameter)&&(e.parameter=a.scope.templateParameter),d=f(c.data)(e),a.gWin.setContent(d[0]),b()}}(this)):this.scope.template?(c=this.scope.$new(),angular.isDefined(this.scope.templateParameter)&&(c.parameter=this.scope.templateParameter),a=f(this.scope.template)(c),this.gWin.setContent(a[0]),b()):b()):void 0},j.prototype.hideWindow=function(){return null!=this.gWin&&this.gWin.isOpen()?this.gWin.close():void 0},j.prototype.getLatestPosition=function(a){return null==this.gWin||null==this.getGmarker()||a?a?this.gWin.setPosition(a):void 0:this.gWin.setPosition(this.getGmarker().getPosition())},j.prototype.remove=function(){return this.hideWindow(),_.each(this.googleMapsHandles,function(a){return google.maps.event.removeListener(a)}),this.googleMapsHandles.length=0,delete this.gWin,delete this.opts},j.prototype.destroy=function(a){var b,c;return null==a&&(a=!1),this.remove(),null!=this.scope&&(null!=(c=this.scope)?c.$$destroyed:void 0)&&(this.needToManualDestroy||a)&&this.scope.$destroy(),b=void 0},j}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapCircleParentModel",["uiGmapLogger","$timeout","uiGmapGmapUtil","uiGmapEventsHelper","uiGmapCircleOptionsBuilder",function(a,c,d,e,f){var g;return g=function(c){function f(b,c,e,f,g){var h,i;this.scope=b,this.attrs=e,this.map=f,this.DEFAULTS=g,h=new google.maps.Circle(this.buildOpts(d.getCoords(b.center),b.radius)),this.setMyOptions=function(a){return function(c,e){return _.isEqual(c,e)?void 0:h.setOptions(a.buildOpts(d.getCoords(b.center),b.radius))}}(this),this.props=this.props.concat([{prop:"center",isColl:!0},{prop:"fill",isColl:!0},"radius"]),this.watchProps(),i=this.setEvents(h,b,b),google.maps.event.addListener(h,"radius_changed",function(){return b.$evalAsync(function(){return b.radius=h.getRadius()})}),google.maps.event.addListener(h,"center_changed",function(){return b.$evalAsync(function(){return angular.isDefined(b.center.type)?(b.center.coordinates[1]=h.getCenter().lat(),b.center.coordinates[0]=h.getCenter().lng()):(b.center.latitude=h.getCenter().lat(),b.center.longitude=h.getCenter().lng())})}),b.$on("$destroy",function(a){return function(){return a.removeEvents(i),h.setMap(null)}}(this)),a.info(this)}return b(f,c),f.include(d),f.include(e),f}(f)}])}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapDrawingManagerParentModel",["uiGmapLogger","$timeout",function(){var a;return a=function(){function a(a,b,c,d){var e;this.scope=a,this.attrs=c,this.map=d,e=new google.maps.drawing.DrawingManager(this.scope.options),e.setMap(this.map),null!=this.scope.control&&(this.scope.control.getDrawingManager=function(){return e}),!this.scope["static"]&&this.scope.options&&this.scope.$watch("options",function(a){return null!=e?e.setOptions(a):void 0},!0),a.$on("$destroy",function(){return e.setMap(null),e=null})}return a}()}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapIMarkerParentModel",["uiGmapModelKey","uiGmapLogger",function(b,d){var e;return e=function(b){function e(b,c,f,g){if(this.scope=b,this.element=c,this.attrs=f,this.map=g,this.onDestroy=a(this.onDestroy,this),this.onWatch=a(this.onWatch,this),this.watch=a(this.watch,this),this.validateScope=a(this.validateScope,this),e.__super__.constructor.call(this,this.scope),this.$log=d,!this.validateScope(b))throw new String("Unable to construct IMarkerParentModel due to invalid scope");this.doClick=angular.isDefined(f.click),null!=b.options&&(this.DEFAULTS=b.options),this.watch("coords",this.scope),this.watch("icon",this.scope),this.watch("options",this.scope),b.$on("$destroy",function(a){return function(){return a.onDestroy(b)}}(this))}return c(e,b),e.prototype.DEFAULTS={},e.prototype.validateScope=function(a){var b;return null==a?(this.$log.error(this.constructor.name+": invalid scope used"),!1):(b=null!=a.coords,b?b:(this.$log.error(this.constructor.name+": no valid coords attribute found"),!1))},e.prototype.watch=function(a,b,c){return null==c&&(c=!0),b.$watch(a,function(c){return function(d,e){return _.isEqual(d,e)?void 0:c.onWatch(a,b,d,e)}}(this),c)},e.prototype.onWatch=function(){},e.prototype.onDestroy=function(){throw new String("OnDestroy Not Implemented!!")},e}(b)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapIWindowParentModel",["uiGmapModelKey","uiGmapGmapUtil","uiGmapLogger",function(a,c,d){var e;return e=function(a){function e(a,b,c,f,g,h,i,j){e.__super__.constructor.call(this,a),this.$log=d,this.$timeout=g,this.$compile=h,this.$http=i,this.$templateCache=j,this.DEFAULTS={},null!=a.options&&(this.DEFAULTS=a.options)}return b(e,a),e.include(c),e}(a)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapLayerParentModel",["uiGmapBaseObject","uiGmapLogger","$timeout",function(b,d){var e;return e=function(b){function e(b,c,e,f,g,h){return this.scope=b,this.element=c,this.attrs=e,this.gMap=f,this.onLayerCreated=null!=g?g:void 0,this.$log=null!=h?h:d,this.createGoogleLayer=a(this.createGoogleLayer,this),null==this.attrs.type?void this.$log.info("type attribute for the layer directive is mandatory. Layer creation aborted!!"):(this.createGoogleLayer(),this.doShow=!0,angular.isDefined(this.attrs.show)&&(this.doShow=this.scope.show),this.doShow&&null!=this.gMap&&this.layer.setMap(this.gMap),this.scope.$watch("show",function(a){return function(b,c){return b!==c?(a.doShow=b,a.layer.setMap(b?a.gMap:null)):void 0}}(this),!0),this.scope.$watch("options",function(a){return function(b,c){return b!==c?(a.layer.setMap(null),a.layer=null,a.createGoogleLayer()):void 0}}(this),!0),void this.scope.$on("$destroy",function(a){return function(){return a.layer.setMap(null)}}(this)))}return c(e,b),e.prototype.createGoogleLayer=function(){var a;return this.layer=null==this.attrs.options?void 0===this.attrs.namespace?new google.maps[this.attrs.type]:new google.maps[this.attrs.namespace][this.attrs.type]:void 0===this.attrs.namespace?new google.maps[this.attrs.type](this.scope.options):new google.maps[this.attrs.namespace][this.attrs.type](this.scope.options),null!=this.layer&&null!=this.onLayerCreated&&"function"==typeof(a=this.onLayerCreated(this.scope,this.layer))?a(this.layer):void 0},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("MapTypeParentModel".ns(),["BaseObject".ns(),"Logger".ns(),"$timeout",function(b,d){var e;return e=function(b){function e(b,c,e,f,g){return this.scope=b,this.element=c,this.attrs=e,this.gMap=f,this.$log=null!=g?g:d,this.hideOverlay=a(this.hideOverlay,this),this.showOverlay=a(this.showOverlay,this),this.refreshMapType=a(this.refreshMapType,this),this.createMapType=a(this.createMapType,this),null==this.attrs.options?void this.$log.info("options attribute for the map-type directive is mandatory. Map type creation aborted!!"):(this.id=this.gMap.overlayMapTypesCount=this.gMap.overlayMapTypesCount+1||0,this.doShow=!0,this.createMapType(),angular.isDefined(this.attrs.show)&&(this.doShow=this.scope.show),this.doShow&&null!=this.gMap&&this.showOverlay(),this.scope.$watch("show",function(a){return function(b,c){return b!==c?(a.doShow=b,b?a.showOverlay():a.hideOverlay()):void 0}}(this),!0),this.scope.$watch("options",function(a){return function(b,c){return _.isEqual(b,c)?void 0:a.refreshMapType()}}(this),!0),angular.isDefined(this.attrs.refresh)&&this.scope.$watch("refresh",function(a){return function(b,c){return _.isEqual(b,c)?void 0:a.refreshMapType()}}(this),!0),void this.scope.$on("$destroy",function(a){return function(){return a.hideOverlay(),a.mapType=null}}(this)))}return c(e,b),e.prototype.createMapType=function(){if(null!=this.scope.options.getTile)this.mapType=this.scope.options;else{if(null==this.scope.options.getTileUrl)return void this.$log.info("options should provide either getTile or getTileUrl methods. Map type creation aborted!!");this.mapType=new google.maps.ImageMapType(this.scope.options)}return this.attrs.id&&this.scope.id&&(this.gMap.mapTypes.set(this.scope.id,this.mapType),angular.isDefined(this.attrs.show)||(this.doShow=!1)),this.mapType.layerId=this.id},e.prototype.refreshMapType=function(){return this.hideOverlay(),this.mapType=null,this.createMapType(),this.doShow&&null!=this.gMap?this.showOverlay():void 0},e.prototype.showOverlay=function(){return this.gMap.overlayMapTypes.push(this.mapType)},e.prototype.hideOverlay=function(){var a;return a=!1,this.gMap.overlayMapTypes.forEach(function(b){return function(c,d){a||c.layerId!==b.id||(a=!0,b.gMap.overlayMapTypes.removeAt(d))}}(this))},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapMarkersParentModel",["uiGmapIMarkerParentModel","uiGmapModelsWatcher","uiGmapPropMap","uiGmapMarkerChildModel","uiGmap_async","uiGmapClustererMarkerManager","uiGmapMarkerManager","$timeout","uiGmapIMarker","uiGmapPromise","uiGmapGmapUtil",function(b,d,e,f,g,h,i,j,k,l,m){var n;return n=function(b){function j(b,c,d,f){this.onDestroy=a(this.onDestroy,this),this.newChildMarker=a(this.newChildMarker,this),this.updateChild=a(this.updateChild,this),this.pieceMeal=a(this.pieceMeal,this),this.reBuildMarkers=a(this.reBuildMarkers,this),this.createMarkersFromScratch=a(this.createMarkersFromScratch,this),this.validateScope=a(this.validateScope,this),this.onWatch=a(this.onWatch,this);var g;j.__super__.constructor.call(this,b,c,d,f),g=this,this.scope.markerModels=new e,this.$log.info(this),this.doRebuildAll=null!=this.scope.doRebuildAll?this.scope.doRebuildAll:!1,this.setIdKey(b),this.scope.$watch("doRebuildAll",function(a){return function(b,c){return b!==c?a.doRebuildAll=b:void 0}}(this)),this.watch("models",b,!this.isTrue(d.modelsbyref)),this.watch("doCluster",b),this.watch("clusterOptions",b),this.watch("clusterEvents",b),this.watch("fit",b),this.watch("idKey",b),this.gMarkerManager=void 0,this.createMarkersFromScratch(b)}return c(j,b),j.include(m),j.include(d),j.prototype.onWatch=function(a,b,c,d){return"idKey"===a&&c!==d&&(this.idKey=c),this.doRebuildAll?this.reBuildMarkers(b):this.pieceMeal(b)},j.prototype.validateScope=function(a){var b;return b=angular.isUndefined(a.models)||void 0===a.models,b&&this.$log.error(this.constructor.name+": no valid models attribute found"),j.__super__.validateScope.call(this,a)||b},j.prototype.createMarkersFromScratch=function(a){return a.doCluster?(a.clusterEvents&&(this.clusterInternalOptions=_.once(function(b){return function(){var c,d,e,f;return c=b,b.origClusterEvents?void 0:(b.origClusterEvents={click:null!=(d=a.clusterEvents)?d.click:void 0,mouseout:null!=(e=a.clusterEvents)?e.mouseout:void 0,mouseover:null!=(f=a.clusterEvents)?f.mouseover:void 0},_.extend(a.clusterEvents,{click:function(a){return c.maybeExecMappedEvent(a,"click")},mouseout:function(a){return c.maybeExecMappedEvent(a,"mouseout")},mouseover:function(a){return c.maybeExecMappedEvent(a,"mouseover") +}}))}}(this))()),a.clusterOptions||a.clusterEvents?void 0===this.gMarkerManager?this.gMarkerManager=new h(this.map,void 0,a.clusterOptions,this.clusterInternalOptions):this.gMarkerManager.opt_options!==a.clusterOptions&&(this.gMarkerManager=new h(this.map,void 0,a.clusterOptions,this.clusterInternalOptions)):this.gMarkerManager=new h(this.map)):this.gMarkerManager=new i(this.map),g.waitOrGo(this,function(b){return function(){return g.each(a.models,function(c){return b.newChildMarker(c,a)},!1).then(function(){return b.gMarkerManager.draw(),a.fit?b.gMarkerManager.fit():void 0})}}(this)).then(function(a){return function(){return a.existingPieces=void 0}}(this))},j.prototype.reBuildMarkers=function(a){var b;if(a.doRebuild||void 0===a.doRebuild)return(null!=(b=this.scope.markerModels)?b.length:void 0)&&this.onDestroy(a),this.createMarkersFromScratch(a)},j.prototype.pieceMeal=function(a){var b;return b=null!=this.existingPieces?!1:g.defaultChunkSize,null!=this.scope.models&&this.scope.models.length>0&&this.scope.markerModels.length>0?this.figureOutState(this.idKey,a,this.scope.markerModels,this.modelKeyComparison,function(c){return function(d){var e;return e=d,g.waitOrGo(c,function(){return g.each(e.removals,function(a){return null!=a?(null!=a.destroy&&a.destroy(),c.scope.markerModels.remove(a.id)):void 0},b).then(function(){return g.each(e.adds,function(b){return c.newChildMarker(b,a)},b)}).then(function(){return g.each(e.updates,function(a){return c.updateChild(a.child,a.model)},b)}).then(function(){return(e.adds.length>0||e.removals.length>0||e.updates.length>0)&&(c.gMarkerManager.draw(),a.markerModels=c.scope.markerModels,a.fit)?c.gMarkerManager.fit():void 0})}).then(function(){return c.existingPieces=void 0})}}(this)):this.reBuildMarkers(a)},j.prototype.updateChild=function(a,b){return null==b[this.idKey]?void this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):a.setMyScope(b,a.model,!1)},j.prototype.newChildMarker=function(a,b){var c,d,e,g;return null==a[this.idKey]?void this.$log.error("Marker model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.$log.info("child",c,"markers",this.scope.markerModels),d=b.$new(!0),d.events=b.events,g={},_.each(k.scopeKeys,function(a,c){return g[c]=b[c]}),c=new f(d,a,g,this.map,this.DEFAULTS,this.doClick,this.gMarkerManager,e=!1),this.scope.markerModels.put(a[this.idKey],c),c)},j.prototype.onDestroy=function(){return g.waitOrGo(this,function(a){return function(){return _.each(a.scope.markerModels.values(),function(a){return null!=a?a.destroy(!1):void 0}),delete a.scope.markerModels,null!=a.gMarkerManager&&a.gMarkerManager.clear(),a.scope.markerModels=new e,l.resolve()}}(this))},j.prototype.maybeExecMappedEvent=function(a,b){var c,d;return _.isFunction(null!=(d=this.scope.clusterEvents)?d[b]:void 0)&&(c=this.mapClusterToMarkerModels(a),this.origClusterEvents[b])?this.origClusterEvents[b](c.cluster,c.mapped):void 0},j.prototype.mapClusterToMarkerModels=function(a){var b,c;return b=a.getMarkers().values(),c=b.map(function(a){return function(b){return a.scope.markerModels[b.key].model}}(this)),{cluster:a,mapped:c}},j}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api.models.parent").factory("uiGmapPolylinesParentModel",["$timeout","uiGmapLogger","uiGmapModelKey","uiGmapModelsWatcher","uiGmapPropMap","uiGmapPolylineChildModel","uiGmap_async",function(b,d,e,f,g,h,i){var j;return j=function(b){function e(b,c,f,h,i){var j;this.scope=b,this.element=c,this.attrs=f,this.gMap=h,this.defaults=i,this.modelKeyComparison=a(this.modelKeyComparison,this),this.setChildScope=a(this.setChildScope,this),this.createChild=a(this.createChild,this),this.pieceMeal=a(this.pieceMeal,this),this.createAllNew=a(this.createAllNew,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopes=a(this.createChildScopes,this),this.watchOurScope=a(this.watchOurScope,this),this.watchDestroy=a(this.watchDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),this.watch=a(this.watch,this),e.__super__.constructor.call(this,b),j=this,this.$log=d,this.plurals=new g,this.scopePropNames=["path","stroke","clickable","draggable","editable","geodesic","icons","visible"],_.each(this.scopePropNames,function(a){return function(b){return a[b+"Key"]=void 0}}(this)),this.models=void 0,this.firstTime=!0,this.$log.info(this),this.watchOurScope(b),this.createChildScopes()}return c(e,b),e.include(f),e.prototype.watch=function(a,b,c){return a.$watch(b,function(a){return function(d,e){return d!==e?(a[c]="function"==typeof d?d():d,i.waitOrGo(a,function(){return i.each(_.values(a.plurals),function(d){return d.scope[b]="self"===a[c]?d:d[a[c]]})})):void 0}}(this))},e.prototype.watchModels=function(a){return a.$watch("models",function(b){return function(c,d){return _.isEqual(c,d)?void 0:b.doINeedToWipe(c)?b.rebuildAll(a,!0,!0):b.createChildScopes(!1)}}(this),!0)},e.prototype.doINeedToWipe=function(a){var b;return b=null!=a?0===a.length:!0,this.plurals.length>0&&b},e.prototype.rebuildAll=function(a,b,c){return i.waitOrGo(this,function(a){return function(){return i.each(a.plurals.values(),function(a){return a.destroy()}).then(function(){return c&&delete a.plurals,a.plurals=new g,b?a.createChildScopes():void 0})}}(this))},e.prototype.watchDestroy=function(a){return a.$on("$destroy",function(b){return function(){return b.rebuildAll(a,!1,!0)}}(this))},e.prototype.watchOurScope=function(a){return _.each(this.scopePropNames,function(b){return function(c){var d;return d=c+"Key",b[d]="function"==typeof a[c]?a[c]():a[c],b.watch(a,c,d)}}(this))},e.prototype.createChildScopes=function(a){return null==a&&(a=!0),angular.isUndefined(this.scope.models)?void this.$log.error("No models to create polylines from! I Need direct models!"):null!=this.gMap&&null!=this.scope.models?(this.watchIdKey(this.scope),a?this.createAllNew(this.scope,!1):this.pieceMeal(this.scope,!1)):void 0},e.prototype.watchIdKey=function(a){return this.setIdKey(a),a.$watch("idKey",function(b){return function(c,d){return c!==d&&null==c?(b.idKey=c,b.rebuildAll(a,!0,!0)):void 0}}(this))},e.prototype.createAllNew=function(a,b){return null==b&&(b=!1),this.models=a.models,this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),i.waitOrGo(this,function(b){return function(){return i.each(a.models,function(a){return b.createChild(a,b.gMap)})}}(this)).then(function(a){return function(){return a.firstTime=!1,a.existingPieces=void 0}}(this))},e.prototype.pieceMeal=function(a,b){var c;return null==b&&(b=!0),c=null!=this.existingPieces?!1:i.defaultChunkSize,this.models=a.models,null!=a&&null!=a.models&&a.models.length>0&&this.plurals.length>0?this.figureOutState(this.idKey,a,this.plurals,this.modelKeyComparison,function(a){return function(b){var c;return c=b,i.waitOrGo(a,function(){return i.each(c.removals,function(b){var c;return c=a.plurals[b],null!=c?(c.destroy(),a.plurals.remove(b)):void 0}).then(function(){return i.each(c.adds,function(b){return a.createChild(b,a.gMap)})}).then(function(){return a.existingPieces=void 0})})}}(this)):this.rebuildAll(this.scope,!0,!0)},e.prototype.createChild=function(a,b){var c,d;return d=this.scope.$new(!1),this.setChildScope(d,a),d.$watch("model",function(a){return function(b,c){return b!==c?a.setChildScope(d,b):void 0}}(this),!0),d["static"]=this.scope["static"],c=new h(d,this.attrs,b,this.defaults,a),null==a[this.idKey]?void this.$log.error("Polyline model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.plurals.put(a[this.idKey],c),c)},e.prototype.setChildScope=function(a,b){return _.each(this.scopePropNames,function(c){return function(d){var e,f;return e=d+"Key",f="self"===c[e]?b:b[c[e]],f!==a[d]?a[d]=f:void 0}}(this)),a.model=b},e.prototype.modelKeyComparison=function(a,b){return _.isEqual(this.evalModelHandle(a,this.scope.path),this.evalModelHandle(b,this.scope.path))},e}(e)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api.models.parent".ns()).factory("RectangleParentModel".ns(),["Logger".ns(),"GmapUtil".ns(),"EventsHelper".ns(),"RectangleOptionsBuilder".ns(),function(a,c,d,e){var f;return f=function(e){function f(b,c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q;this.scope=b,this.attrs=d,this.map=e,this.DEFAULTS=f,g=void 0,j=!1,n=[],m=void 0,k=function(a){return function(){return a.isTrue(d.fit)?a.fitMapBounds(a.map,g):void 0}}(this),i=function(c){return function(){var d,e;return null!=b.bounds&&null!=(null!=(d=b.bounds)?d.sw:void 0)&&null!=(null!=(e=b.bounds)?e.ne:void 0)&&c.validateBoundPoints(b.bounds)?(g=c.convertBoundPoints(b.bounds),a.info("new new bounds created: "+o)):null!=b.bounds.getNorthEast&&null!=b.bounds.getSouthWest?g=b.bounds:"undefined"!=typeof bound&&null!==bound?a.error("Invalid bounds for newValue: "+JSON.stringify(b.bounds)):void 0}}(this),i(),o=new google.maps.Rectangle(this.buildOpts(g)),a.info("rectangle created: "+o),p=!1,q=function(){return function(){var a,c,d;return a=o.getBounds(),c=a.getNorthEast(),d=a.getSouthWest(),p?void 0:b.$evalAsync(function(b){return null!=b.bounds&&null!=b.bounds.sw&&null!=b.bounds.ne&&(b.bounds.ne={latitude:c.lat(),longitude:c.lng()},b.bounds.sw={latitude:d.lat(),longitude:d.lng()}),null!=b.bounds.getNorthEast&&null!=b.bounds.getSouthWest?b.bounds=a:void 0})}}(this),l=function(a){return function(){return k(),a.removeEvents(n),n.push(google.maps.event.addListener(o,"dragstart",function(){return j=!0})),n.push(google.maps.event.addListener(o,"dragend",function(){return j=!1,q()})),n.push(google.maps.event.addListener(o,"bounds_changed",function(){return j?void 0:q()}))}}(this),h=function(a){return function(){return a.removeEvents(n),null!=m&&a.removeEvents(m),o.setMap(null)}}(this),null!=g&&l(),b.$watch("bounds",function(a,b){var c;if(!(_.isEqual(a,b)&&null!=g||j))return p=!0,null==a?void h():(null==g?c=!0:k(),i(),o.setBounds(g),p=!1,c&&null!=g?l():void 0)},!0),this.setMyOptions=function(a){return function(b,c){return _.isEqual(b,c)||null==g||null==b?void 0:o.setOptions(a.buildOpts(g))}}(this),this.props.push("bounds"),this.watchProps(this.props),null!=d.events&&(m=this.setEvents(o,b,b),b.$watch("events",function(a){return function(c,d){return _.isEqual(c,d)?void 0:(null!=m&&a.removeEvents(m),m=a.setEvents(o,b,b))}}(this))),b.$on("$destroy",function(){return function(){return h()}}(this)),a.info(this)}return b(f,e),f.include(c),f.include(d),f}(e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("SearchBoxParentModel".ns(),["BaseObject".ns(),"Logger".ns(),"EventsHelper".ns(),"$timeout","$http","$templateCache",function(b,d,e){var f;return f=function(b){function f(b,c,e,f,g,h,i){var j;return this.scope=b,this.element=c,this.attrs=e,this.gMap=f,this.ctrlPosition=g,this.template=h,this.$log=null!=i?i:d,this.getBounds=a(this.getBounds,this),this.setBounds=a(this.setBounds,this),this.createSearchBox=a(this.createSearchBox,this),this.addToParentDiv=a(this.addToParentDiv,this),this.addAsMapControl=a(this.addAsMapControl,this),this.init=a(this.init,this),null==this.attrs.template?void this.$log.error("template attribute for the search-box directive is mandatory. Places Search Box creation aborted!!"):(j=angular.element("
"),j.append(this.template),this.input=j.find("input")[0],void this.init())}return c(f,b),f.include(e),f.prototype.init=function(){return this.createSearchBox(),null!=this.attrs.parentdiv?this.addToParentDiv():this.addAsMapControl(),this.listener=google.maps.event.addListener(this.searchBox,"places_changed",function(a){return function(){return a.places=a.searchBox.getPlaces()}}(this)),this.listeners=this.setEvents(this.searchBox,this.scope,this.scope),this.$log.info(this),this.scope.$watch("options",function(a){return function(b){return angular.isObject(b)&&null!=b.bounds?a.setBounds(b.bounds):void 0}}(this),!0),this.scope.$on("$destroy",function(a){return function(){return a.searchBox=null}}(this))},f.prototype.addAsMapControl=function(){return this.gMap.controls[google.maps.ControlPosition[this.ctrlPosition]].push(this.input)},f.prototype.addToParentDiv=function(){return this.parentDiv=angular.element(document.getElementById(this.scope.parentdiv)),this.parentDiv.append(this.input)},f.prototype.createSearchBox=function(){return this.searchBox=new google.maps.places.SearchBox(this.input,this.scope.options)},f.prototype.setBounds=function(a){if(angular.isUndefined(a.isEmpty))this.$log.error("Error: SearchBoxParentModel setBounds. Bounds not an instance of LatLngBounds.");else if(a.isEmpty()===!1&&null!=this.searchBox)return this.searchBox.setBounds(a)},f.prototype.getBounds=function(){return this.searchBox.getBounds()},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api.models.parent".ns()).factory("WindowsParentModel".ns(),["IWindowParentModel".ns(),"ModelsWatcher".ns(),"PropMap".ns(),"WindowChildModel".ns(),"Linked".ns(),"_async".ns(),"Logger".ns(),"$timeout","$compile","$http","$templateCache","$interpolate","uiGmapPromise",function(b,d,e,f,g,h,i,j,k,l,m,n,o){var p;return p=function(b){function p(b,c,d,f,h,i){var n;this.gMap=h,this.markersScope=i,this.interpolateContent=a(this.interpolateContent,this),this.setChildScope=a(this.setChildScope,this),this.createWindow=a(this.createWindow,this),this.setContentKeys=a(this.setContentKeys,this),this.pieceMealWindows=a(this.pieceMealWindows,this),this.createAllNewWindows=a(this.createAllNewWindows,this),this.watchIdKey=a(this.watchIdKey,this),this.createChildScopesWindows=a(this.createChildScopesWindows,this),this.watchOurScope=a(this.watchOurScope,this),this.watchDestroy=a(this.watchDestroy,this),this.rebuildAll=a(this.rebuildAll,this),this.doINeedToWipe=a(this.doINeedToWipe,this),this.watchModels=a(this.watchModels,this),this.go=a(this.go,this),p.__super__.constructor.call(this,b,c,d,f,j,k,l,m),n=this,this.windows=new e,this.scopePropNames=["coords","template","templateUrl","templateParameter","isIconVisibleOnClick","closeClick","options","show"],_.each(this.scopePropNames,function(a){return function(b){return a[b+"Key"]=void 0}}(this)),this.linked=new g(b,c,d,f),this.models=void 0,this.contentKeys=void 0,this.isIconVisibleOnClick=void 0,this.firstTime=!0,this.firstWatchModels=!0,this.$log.info(n),this.parentScope=void 0,this.go(b)}return c(p,b),p.include(d),p.prototype.go=function(a){return this.watchOurScope(a),this.doRebuildAll=null!=this.scope.doRebuildAll?this.scope.doRebuildAll:!1,a.$watch("doRebuildAll",function(a){return function(b,c){return b!==c?a.doRebuildAll=b:void 0}}(this)),this.createChildScopesWindows()},p.prototype.watchModels=function(a){return a.$watch("models",function(b){return function(c,d){var e;return!_.isEqual(c,d)||b.firstWatchModels?(b.firstWatchModels=!1,b.doRebuildAll||b.doINeedToWipe(c)?b.rebuildAll(a,!0,!0):(e=0===b.windows.length,null!=b.existingPieces?b.existingPieces.then(function(){return b.createChildScopesWindows(e)}):b.createChildScopesWindows(e))):void 0}}(this),!0)},p.prototype.doINeedToWipe=function(a){var b;return b=null!=a?0===a.length:!0,this.windows.length>0&&b},p.prototype.rebuildAll=function(a,b,c){return h.waitOrGo(this,function(a){return function(){return h.each(a.windows.values(),function(a){return a.destroy()}).then(function(){return c&&delete a.windows,a.windows=new e,b&&a.createChildScopesWindows(),o.resolve()})}}(this))},p.prototype.watchDestroy=function(a){return a.$on("$destroy",function(b){return function(){return b.firstWatchModels=!0,b.firstTime=!0,b.rebuildAll(a,!1,!0)}}(this))},p.prototype.watchOurScope=function(a){return _.each(this.scopePropNames,function(b){return function(c){var d;return d=c+"Key",b[d]="function"==typeof a[c]?a[c]():a[c]}}(this))},p.prototype.createChildScopesWindows=function(a){var b,c,d;return null==a&&(a=!0),this.isIconVisibleOnClick=!0,angular.isDefined(this.linked.attrs.isiconvisibleonclick)&&(this.isIconVisibleOnClick=this.linked.scope.isIconVisibleOnClick),b=angular.isUndefined(this.linked.scope.models),!b||void 0!==this.markersScope&&void 0!==(null!=(c=this.markersScope)?c.markerModels:void 0)&&void 0!==(null!=(d=this.markersScope)?d.models:void 0)?null!=this.gMap?null!=this.linked.scope.models?(this.watchIdKey(this.linked.scope),a?this.createAllNewWindows(this.linked.scope,!1):this.pieceMealWindows(this.linked.scope,!1)):(this.parentScope=this.markersScope,this.watchIdKey(this.parentScope),a?this.createAllNewWindows(this.markersScope,!0,"markerModels",!1):this.pieceMealWindows(this.markersScope,!0,"markerModels",!1)):void 0:void this.$log.error("No models to create windows from! Need direct models or models derrived from markers!")},p.prototype.watchIdKey=function(a){return this.setIdKey(a),a.$watch("idKey",function(b){return function(c,d){return c!==d&&null==c?(b.idKey=c,b.rebuildAll(a,!0,!0)):void 0}}(this))},p.prototype.createAllNewWindows=function(a,b,c,d){return null==c&&(c="models"),null==d&&(d=!1),this.models=a.models,this.firstTime&&(this.watchModels(a),this.watchDestroy(a)),this.setContentKeys(a.models),h.waitOrGo(this,function(d){return function(){return h.each(a.models,function(e){var f,g;return f=b&&null!=(g=a[c][[e[d.idKey]]])?g.gMarker:void 0,d.createWindow(e,f,d.gMap)})}}(this)).then(function(a){return function(){return a.firstTime=!1}}(this))},p.prototype.pieceMealWindows=function(a,b,c,d){var e;return null==c&&(c="models"),null==d&&(d=!0),e=null!=this.existingPieces?!1:h.defaultChunkSize,this.models=a.models,null!=a&&null!=a.models&&a.models.length>0&&this.windows.length>0?this.figureOutState(this.idKey,a,this.windows,this.modelKeyComparison,function(b){return function(d){var f;return f=d,h.waitOrGo(b,function(){return h.each(f.removals,function(a){return null!=a&&(b.windows.remove(a.id),null!=a.destroy)?a.destroy(!0):void 0},e).then(function(){return h.each(f.adds,function(d){var e,f;if(e=null!=(f=a[c][d[b.idKey]])?f.gMarker:void 0,!e)throw"Gmarker undefined";return b.createWindow(d,e,b.gMap)},e)})}).then(function(){return b.existingPieces=void 0})["catch"](function(){return i.error("Error while pieceMealing Windows!")})}}(this)):this.rebuildAll(this.scope,!0,!0)},p.prototype.setContentKeys=function(a){return a.length>0?this.contentKeys=Object.keys(a[0]):void 0},p.prototype.createWindow=function(a,b,c){var d,e,g,h,i,j;return e=this.linked.scope.$new(!1),this.setChildScope(e,a),e.$watch("model",function(a){return function(b,c){return b!==c?a.setChildScope(e,b):void 0}}(this),!0),g={html:function(b){return function(){return b.interpolateContent(b.linked.element.html(),a)}}(this)},this.DEFAULTS=this.markersScope?a[this.optionsKey]||{}:this.DEFAULTS,h=this.createWindowOptions(b,e,g.html(),this.DEFAULTS),d=new f(a,e,h,this.isIconVisibleOnClick,c,null!=(i=this.markersScope)&&null!=(j=i.markerModels[a[this.idKey]])?j.scope:void 0,g,!1,!0),null==a[this.idKey]?void this.$log.error("Window model has no id to assign a child to. This is required for performance. Please assign id, or redirect id to a different key."):(this.windows.put(a[this.idKey],d),d)},p.prototype.setChildScope=function(a,b){return _.each(this.scopePropNames,function(c){return function(d){var e,f;return e=d+"Key",f="self"===c[e]?b:b[c[e]],f!==a[d]?a[d]=f:void 0}}(this)),a.model=b},p.prototype.interpolateContent=function(a,b){var c,d,e,f,g,h;if(void 0!==this.contentKeys&&0!==this.contentKeys.length){for(c=n(a),d={},h=this.contentKeys,f=0,g=h.length;g>f;f++)e=h[f],d[e]=b[e];return c(d)}},p}(b)}])}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapCircle",["uiGmapICircle","uiGmapCircleParentModel",function(a,b){return _.extend(a,{link:function(a,c,d,e){return e.getScope().deferred.promise.then(function(){return function(e){return new b(a,c,d,e)}}(this))}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapControl",["uiGmapIControl","$http","$templateCache","$compile","$controller","uiGmapGoogleMapApi",function(b,d,e,f,g,h){var i;return i=function(i){function j(){this.link=a(this.link,this),j.__super__.constructor.call(this)}return c(j,i),j.prototype.link=function(a,c,i,j){return h.then(function(c){return function(h){var i,k;return angular.isUndefined(a.template)?void c.$log.error("mapControl: could not find a valid template property"):(i=angular.isDefined(a.index&&!isNaN(parseInt(a.index)))?parseInt(a.index):void 0,k=angular.isDefined(a.position)?a.position.toUpperCase().replace(/-/g,"_"):"TOP_CENTER",h.ControlPosition[k]?b.mapPromise(a,j).then(function(b){var h,j;return h=void 0,j=angular.element("
"),d.get(a.template,{cache:e}).success(function(b){var c,d;return d=a.$new(),j.append(b),i&&(j[0].index=i),angular.isDefined(a.controller)&&(c=g(a.controller,{$scope:d}),j.children().data("$ngControllerController",c)),h=f(j.children())(d)}).error(function(){return c.$log.error("mapControl: template could not be found")}).then(function(){return b.controls[google.maps.ControlPosition[k]].push(h[0])})}):void c.$log.error("mapControl: invalid position property"))}}(this))},j}(b)}])}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapDrawingManager",["uiGmapIDrawingManager","uiGmapDrawingManagerParentModel",function(a,b){return _.extend(a,{link:function(a,c,d,e){return e.getScope().deferred.promise.then(function(e){return new b(a,c,d,e)})}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapApiFreeDrawPolygons",["uiGmapLogger","uiGmapBaseObject","uiGmapCtrlHandle","uiGmapDrawFreeHandChildModel",function(b,d,e,f){var g;return g=function(d){function g(){return this.link=a(this.link,this),g.__super__.constructor.apply(this,arguments)}return c(g,d),g.include(e),g.prototype.restrict="EMA",g.prototype.replace=!0,g.prototype.require="^uiGmapGoogleMap",g.prototype.scope={polygons:"=",draw:"="},g.prototype.link=function(a,c,d,e){return this.mapPromise(a,e).then(function(){return function(c){var d,e;return a.polygons?_.isArray(a.polygons)?(d=new f(c,a.originalMapOpts),e=void 0,a.draw=function(){return"function"==typeof e&&e(),d.engage(a.polygons).then(function(){var b;return b=!0,e=a.$watch("polygons",function(a,c){var d;return b?void(b=!1):(d=_.differenceObjects(c,a),d.forEach(function(a){return a.setMap(null)}))})})}):b.error("Free Draw Polygons must be of type Array!"):b.error("No polygons to bind to!")}}(this))},g}(d)}])}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api").service("uiGmapICircle",[function(){var a;return a={},{restrict:"EA",replace:!0,require:"^uiGmapGoogleMap",scope:{center:"=center",radius:"=radius",stroke:"=stroke",fill:"=fill",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=icons",visible:"=",events:"="}}}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIControl",["uiGmapBaseObject","uiGmapLogger","uiGmapCtrlHandle",function(a,c,d){var e;return e=function(a){function e(){this.restrict="EA",this.replace=!0,this.require="^uiGmapGoogleMap",this.scope={template:"@template",position:"@position",controller:"@controller",index:"@index"},this.$log=c}return b(e,a),e.extend(d),e.prototype.link=function(){throw new Exception("Not implemented!!")},e}(a)}])}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api").service("uiGmapIDrawingManager",[function(){return{restrict:"EA",replace:!0,require:"^uiGmapGoogleMap",scope:{"static":"@",control:"=",options:"="}}}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("google-maps.directives.api".ns()).factory("IMarker".ns(),["Logger".ns(),"BaseObject".ns(),"CtrlHandle".ns(),function(a,c,d){var e;return e=function(c){function e(){this.$log=a,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.replace=!0,this.scope=e.scopeKeys}return b(e,c),e.scopeKeys={coords:"=coords",icon:"=icon",click:"&click",options:"=options",events:"=events",fit:"=fit",idKey:"=idkey",control:"=control"},e.keys=_.keys(e.scopeKeys),e.extend(d),e}(c)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIPolygon",["uiGmapGmapUtil","uiGmapBaseObject","uiGmapLogger","uiGmapCtrlHandle",function(a,c,d,e){var f;return f=function(c){function f(){}return b(f,c),f.include(a),f.extend(e),f.prototype.restrict="EMA",f.prototype.replace=!0,f.prototype.require="^uiGmapGoogleMap",f.prototype.scope={path:"=path",stroke:"=stroke",clickable:"=",draggable:"=",editable:"=",geodesic:"=",fill:"=",icons:"=icons",visible:"=","static":"=",events:"=",zIndex:"=zindex",fit:"=",control:"=control"},f.prototype.DEFAULTS={},f.prototype.$log=d,f}(c)}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIPolyline",["uiGmapGmapUtil","uiGmapBaseObject","uiGmapLogger","uiGmapCtrlHandle",function(a,c,d,e){var f;return f=function(c){function f(){}return b(f,c),f.include(a),f.extend(e),f.prototype.restrict="EMA",f.prototype.replace=!0,f.prototype.require="^uiGmapGoogleMap",f.prototype.scope={path:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",geodesic:"=",icons:"=",visible:"=","static":"=",fit:"=",events:"="},f.prototype.DEFAULTS={},f.prototype.$log=d,f}(c)}])}.call(this),function(){angular.module("uiGmapgoogle-maps.directives.api").service("uiGmapIRectangle",[function(){"use strict";var a;return a={},{restrict:"EMA",require:"^uiGmapGoogleMap",replace:!0,scope:{bounds:"=",stroke:"=",clickable:"=",draggable:"=",editable:"=",fill:"=",visible:"=",events:"="}}}])}.call(this),function(){var a={}.hasOwnProperty,b=function(b,c){function d(){this.constructor=b}for(var e in c)a.call(c,e)&&(b[e]=c[e]);return d.prototype=c.prototype,b.prototype=new d,b.__super__=c.prototype,b};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapIWindow",["uiGmapBaseObject","uiGmapChildEvents","uiGmapLogger","uiGmapCtrlHandle",function(a,c,d,e){var f;return f=function(a){function f(){this.restrict="EMA",this.template=void 0,this.transclude=!0,this.priority=-100,this.require="^uiGmapGoogleMap",this.replace=!0,this.scope={coords:"=coords",template:"=template",templateUrl:"=templateurl",templateParameter:"=templateparameter",isIconVisibleOnClick:"=isiconvisibleonclick",closeClick:"&closeclick",options:"=options",control:"=control",show:"=show"},this.$log=d}return b(f,a),f.include(c),f.extend(e),f}(a)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMap",["$timeout","$q","uiGmapLogger","uiGmapGmapUtil","uiGmapBaseObject","uiGmapCtrlHandle","uiGmapIsReady","uiGmapuuid","uiGmapExtendGWin","uiGmapExtendMarkerClusterer","uiGmapGoogleMapsUtilV3","uiGmapGoogleMapApi",function(b,d,e,f,g,h,i,j,k,l,m,n){"use strict";var o,p,q;return o=void 0,q=[m,k,l],p=function(d){function g(){this.link=a(this.link,this);var b,c;b=function(a){var b,c;return c=void 0,a.$on("$destroy",function(){return i.reset()}),b=h.handle(a),a.ctrlType="Map",a.deferred.promise.then(function(){return q.forEach(function(a){return a.init()})}),b.getMap=function(){return a.map},c=_.extend(this,b)},this.controller=["$scope",b],c=this}return c(g,d),g.include(f),g.prototype.restrict="EMA",g.prototype.transclude=!0,g.prototype.replace=!1,g.prototype.template='
',g.prototype.scope={center:"=",zoom:"=",dragging:"=",control:"=",options:"=",events:"=",eventOpts:"=",styles:"=",bounds:"=",update:"="},g.prototype.link=function(a,c,d){var f;return a.idleAndZoomChanged=!1,null==a.center?void(f=a.$watch("center",function(b){return function(){return a.center?(f(),b.link(a,c,d)):void 0}}(this))):n.then(function(f){return function(g){var h,k,l,m,n,p,q,r,s,t,u;if(o={mapTypeId:g.MapTypeId.ROADMAP},s=i.spawn(),q=function(){return s.deferred.resolve({instance:s.instance,map:u})},!f.validateCoords(a.center))return void e.error("angular-google-maps: could not find a valid center property");if(!angular.isDefined(a.zoom))return void e.error("angular-google-maps: map zoom property not set");if(k=angular.element(c),k.addClass("angular-google-map"),p={options:{}},d.options&&(p.options=a.options),d.styles&&(p.styles=a.styles),d.type&&(t=d.type.toUpperCase(),google.maps.MapTypeId.hasOwnProperty(t)?p.mapTypeId=google.maps.MapTypeId[d.type.toUpperCase()]:e.error("angular-google-maps: invalid map type '"+d.type+"'")),n=angular.extend({},o,p,{center:f.getCoords(a.center),zoom:a.zoom,bounds:a.bounds}),u=new google.maps.Map(k.find("div")[1],n),u.uiGmap_id=j.generate(),h=!1,google.maps.event.addListenerOnce(u,"idle",function(){return a.deferred.resolve(u),q()}),google.maps.event.addListener(u,"dragstart",function(){var b;return(null!=(b=a.update)?b.lazy:void 0)?void 0:(h=!0,a.$evalAsync(function(a){return null!=a.dragging?a.dragging=h:void 0}))}),google.maps.event.addListener(u,"dragend",function(){var b;return(null!=(b=a.update)?b.lazy:void 0)?void 0:(h=!1,a.$evalAsync(function(a){return null!=a.dragging?a.dragging=h:void 0}))}),google.maps.event.addListener(u,"drag",function(){var c,d,e,f,g;return(null!=(d=a.update)?d.lazy:void 0)?void 0:(c=u.center,b(function(){var b;return b=a,angular.isDefined(b.center.type)?(b.center.coordinates[1]=c.lat(),b.center.coordinates[0]=c.lng()):(b.center.latitude=c.lat(),b.center.longitude=c.lng())},null!=(e=a.eventOpts)&&null!=(f=e.debounce)&&null!=(g=f.debounce)?g.dragMs:void 0)) +}),google.maps.event.addListener(u,"zoom_changed",function(){var c,d,e;return(null!=(c=a.update)?c.lazy:void 0)||a.zoom===u.zoom?void 0:b(function(){return a.zoom=u.zoom},null!=(d=a.eventOpts)&&null!=(e=d.debounce)?e.zoomMs:void 0)}),r=!1,google.maps.event.addListener(u,"center_changed",function(){var c,d,e,f;if(!(null!=(d=a.update)?d.lazy:void 0)){if(c=u.center,r)return;return b(function(){var b;if(b=a,!u.dragging)if(angular.isDefined(b.center.type)){if(b.center.coordinates[1]!==c.lat()&&(b.center.coordinates[1]=c.lat()),b.center.coordinates[0]!==c.lng())return b.center.coordinates[0]=c.lng()}else if(b.center.latitude!==c.lat()&&(b.center.latitude=c.lat()),b.center.longitude!==c.lng())return b.center.longitude=c.lng()},null!=(e=a.eventOpts)&&null!=(f=e.debounce)?f.centerMs:void 0)}}),google.maps.event.addListener(u,"idle",function(){var b,c,d;return b=u.getBounds(),c=b.getNorthEast(),d=b.getSouthWest(),a.$evalAsync(function(b){var e,f;return(null!=(f=b.update)?f.lazy:void 0)&&(e=u.center,angular.isDefined(b.center.type)?(b.center.coordinates[1]!==e.lat()&&(b.center.coordinates[1]=e.lat()),b.center.coordinates[0]!==e.lng()&&(b.center.coordinates[0]=e.lng())):(b.center.latitude!==e.lat()&&(b.center.latitude=e.lat()),b.center.longitude!==e.lng()&&(b.center.longitude=e.lng()))),null!==b.bounds&&void 0!==b.bounds&&void 0!==b.bounds&&(b.bounds.northeast={latitude:c.lat(),longitude:c.lng()},b.bounds.southwest={latitude:d.lat(),longitude:d.lng()}),b.zoom=u.zoom,a.idleAndZoomChanged=!a.idleAndZoomChanged})}),angular.isDefined(a.events)&&null!==a.events&&angular.isObject(a.events)){m=function(b){return function(){return a.events[b].apply(a,[u,b,arguments])}};for(l in a.events)a.events.hasOwnProperty(l)&&angular.isFunction(a.events[l])&&google.maps.event.addListener(u,l,m(l))}return u.getOptions=function(){return n},a.map=u,null!=d.control&&null!=a.control&&(a.control.refresh=function(a){var b;if(null!=u)return google.maps.event.trigger(u,"resize"),null!=(null!=a?a.latitude:void 0)&&null!=(null!=a?a.latitude:void 0)?(b=f.getCoords(a),f.isTrue(d.pan)?u.panTo(b):u.setCenter(b)):void 0},a.control.getGMap=function(){return u},a.control.getMapOptions=function(){return n}),a.$watch("center",function(b){var c;return c=f.getCoords(b),c.lat()!==u.center.lat()||c.lng()!==u.center.lng()?(r=!0,h||(f.validateCoords(b)||e.error("Invalid center for newValue: "+JSON.stringify(b)),f.isTrue(d.pan)&&a.zoom===u.zoom?u.panTo(c):u.setCenter(c)),r=!1):void 0},!0),a.$watch("zoom",function(a,c){return _.isEqual(a,c)?void 0:b(function(){return u.setZoom(a)},0,!1)}),a.$watch("bounds",function(a,b){var c,d,f;if(a!==b)return null==a.northeast.latitude||null==a.northeast.longitude||null==a.southwest.latitude||null==a.southwest.longitude?void e.error("Invalid map bounds for new value: "+JSON.stringify(a)):(d=new google.maps.LatLng(a.northeast.latitude,a.northeast.longitude),f=new google.maps.LatLng(a.southwest.latitude,a.southwest.longitude),c=new google.maps.LatLngBounds(f,d),u.fitBounds(c))}),["options","styles"].forEach(function(b){return a.$watch(b,function(a,b){var c;return c=this.exp,_.isEqual(a,b)?void 0:(p.options=a,null!=u?u.setOptions(p):void 0)})},!0)}}(this))},g}(g)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMarker",["uiGmapIMarker","uiGmapMarkerChildModel","uiGmapMarkerManager",function(b,d,e){var f;return f=function(f){function g(){this.link=a(this.link,this),g.__super__.constructor.call(this),this.template='',this.$log.info(this)}return c(g,f),g.prototype.controller=["$scope","$element",function(a,c){return a.ctrlType="Marker",_.extend(this,b.handle(a,c))}],g.prototype.link=function(a,c,f,g){return this.mapPromise=b.mapPromise(a,g),this.mapPromise.then(function(c){return function(f){var g,h,i,j,k;return c.gMarkerManager||(c.gMarkerManager=new e(f)),i=_.object(b.keys,b.keys),j=new d(a,a,i,f,{},g=!0,c.gMarkerManager,h=!1,k=!1),j.deferred.promise.then(function(b){return a.deferred.resolve(b)}),null!=a.control?a.control.getGMarkers=c.gMarkerManager.getGMarkers:void 0}}(this)),a.$on("$destroy",function(a){return function(){var b;return null!=(b=a.gMarkerManager)&&b.clear(),a.gMarkerManager=null}}(this))},g}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapMarkers",["uiGmapIMarker","uiGmapMarkersParentModel","uiGmap_sync",function(b,d){var e;return e=function(e){function f(b){this.link=a(this.link,this),f.__super__.constructor.call(this,b),this.template='',this.scope=_.extend(this.scope||{},{idKey:"=idkey",doRebuildAll:"=dorebuildall",models:"=models",doCluster:"=docluster",clusterOptions:"=clusteroptions",clusterEvents:"=clusterevents",modelsByRef:"=modelsbyref"}),this.$log.info(this)}return c(f,e),f.prototype.controller=["$scope","$element",function(a,c){return a.ctrlType="Markers",_.extend(this,b.handle(a,c))}],f.prototype.link=function(a,c,e,f){var g,h;return g=void 0,h=function(){return function(){return null!=a.control&&(a.control.getGMarkers=function(){var a;return null!=(a=g.gMarkerManager)?a.getGMarkers():void 0},a.control.getChildMarkers=function(){return g.markerModels}),a.deferred.resolve()}}(this),b.mapPromise(a,f).then(function(){return function(b){var i;return i=f.getScope(),i.$watch("idleAndZoomChanged",function(){return _.defer(g.gMarkerManager.draw)}),g=new d(a,c,e,b),g.existingPieces.then(function(){return h()})}}(this))},f}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Polygon".ns(),["IPolygon".ns(),"$timeout","array-sync".ns(),"PolygonChildModel".ns(),function(b,d,e,f){var g;return g=function(d){function e(){return this.link=a(this.link,this),e.__super__.constructor.apply(this,arguments)}return c(e,d),e.prototype.link=function(a,c,d,e){var g,h;return g=[],h=b.mapPromise(a,e),null!=a.control&&(a.control.getInstance=this,a.control.polygons=g,a.control.promise=h),h.then(function(b){return function(c){return g.push(new f(a,d,c,b.DEFAULTS))}}(this))},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Polyline".ns(),["IPolyline".ns(),"$timeout","array-sync".ns(),"PolylineChildModel".ns(),function(b,d,e,f){var g;return g=function(d){function e(){return this.link=a(this.link,this),e.__super__.constructor.apply(this,arguments)}return c(e,d),e.prototype.link=function(a,c,d,e){return angular.isUndefined(a.path)||null===a.path||!this.validatePath(a.path)?void this.$log.error("polyline: no valid path attribute found"):b.mapPromise(a,e).then(function(b){return function(c){return new f(a,d,c,b.DEFAULTS)}}(this))},e}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("google-maps.directives.api".ns()).factory("Polylines".ns(),["IPolyline".ns(),"$timeout","array-sync".ns(),"PolylinesParentModel".ns(),function(b,d,e,f){var g;return g=function(b){function d(){this.link=a(this.link,this),d.__super__.constructor.call(this),this.scope.idKey="=idkey",this.scope.models="=models",this.$log.info(this)}return c(d,b),d.prototype.link=function(a,b,c,d){return angular.isUndefined(a.path)||null===a.path?void this.$log.error("polylines: no valid path attribute found"):a.models?d.getScope().deferred.promise.then(function(d){return function(e){return new f(a,b,c,e,d.DEFAULTS)}}(this)):void this.$log.error("polylines: no models found to create from")},d}(b)}])}.call(this),function(){angular.module("google-maps.directives.api".ns()).factory("Rectangle".ns(),["Logger".ns(),"GmapUtil".ns(),"IRectangle".ns(),"RectangleParentModel".ns(),function(a,b,c,d){return _.extend(c,{link:function(a,b,c,e){return e.getScope().deferred.promise.then(function(){return function(e){return new d(a,b,c,e)}}(this))}})}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapWindow",["uiGmapIWindow","uiGmapGmapUtil","uiGmapWindowChildModel",function(b,d,e){var f;return f=function(f){function g(){this.link=a(this.link,this),g.__super__.constructor.call(this),this.require=["^uiGmapGoogleMap","^?uiGmapMarker"],this.template='',this.$log.info(this),this.childWindows=[]}return c(g,f),g.include(d),g.prototype.link=function(a,c,d,e){var f,g;return f=e.length>1&&null!=e[1]?e[1]:void 0,g=null!=f?f.getScope():void 0,this.mapPromise=b.mapPromise(a,e[0]),this.mapPromise.then(function(b){return function(e){var h;return h=!0,angular.isDefined(d.isiconvisibleonclick)&&(h=a.isIconVisibleOnClick),f?g.deferred.promise.then(function(){return b.init(a,c,h,e,g)}):void b.init(a,c,h,e)}}(this))},g.prototype.init=function(a,b,c,d,f){var g,h,i,j,k;return h=null!=a.options?a.options:{},j=null!=a&&this.validateCoords(a.coords),null!=(null!=f?f.getGMarker:void 0)&&(i=f.getGMarker()),k=j?this.createWindowOptions(i,a,b.html(),h):h,null!=d&&(g=new e({},a,k,c,d,f,b),this.childWindows.push(g),a.$on("$destroy",function(a){return function(){return a.childWindows=_.withoutObjects(a.childWindows,[g],function(a,b){return a.scope.$id===b.scope.$id}),a.childWindows.length=0}}(this))),null!=a.control&&(a.control.getGWindows=function(a){return function(){return a.childWindows.map(function(a){return a.gWin})}}(this),a.control.getChildWindows=function(a){return function(){return a.childWindows}}(this),a.control.showWindow=function(a){return function(){return a.childWindows.map(function(a){return a.showWindow()})}}(this),a.control.hideWindow=function(a){return function(){return a.childWindows.map(function(a){return a.hideWindow()})}}(this)),null!=this.onChildCreation&&null!=g?this.onChildCreation(g):void 0},g}(b)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}},b={}.hasOwnProperty,c=function(a,c){function d(){this.constructor=a}for(var e in c)b.call(c,e)&&(a[e]=c[e]);return d.prototype=c.prototype,a.prototype=new d,a.__super__=c.prototype,a};angular.module("uiGmapgoogle-maps.directives.api").factory("uiGmapWindows",["uiGmapIWindow","uiGmapWindowsParentModel","uiGmapPromise",function(b,d,e){var f;return f=function(b){function f(){this.init=a(this.init,this),this.link=a(this.link,this),f.__super__.constructor.call(this),this.require=["^uiGmapGoogleMap","^?uiGmapMarkers"],this.template='',this.scope.idKey="=idkey",this.scope.doRebuildAll="=dorebuildall",this.scope.models="=models",this.$log.debug(this)}return c(f,b),f.prototype.link=function(a,b,c,d){var f,g,h;return f=d[0].getScope(),g=d.length>1&&null!=d[1]?d[1]:void 0,h=null!=g?g.getScope():void 0,f.deferred.promise.then(function(f){return function(g){var i,j;return i=(null!=h&&null!=(j=h.deferred)?j.promise:void 0)||e.resolve(),i.then(function(){var e,i;return e=null!=(i=f.parentModel)?i.existingPieces:void 0,e?e.then(function(){return f.init(a,b,c,d,g,h)}):f.init(a,b,c,d,g,h)})}}(this))},f.prototype.init=function(a,b,c,e,f,g){var h;return h=new d(a,b,c,e,f,g),null!=a.control?(a.control.getGWindows=function(){return function(){return h.windows.map(function(a){return a.gWin})}}(this),a.control.getChildWindows=function(){return function(){return h.windows}}(this)):void 0},f}(b)}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapGoogleMap",["uiGmapMap",function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("Marker".ns(),["$timeout","Marker".ns(),function(a,b){return new b(a)}])}.call(this),function(){angular.module("google-maps".ns()).directive("Markers".ns(),["$timeout","Markers".ns(),function(a,b){return new b(a)}])}.call(this),function(){angular.module("google-maps".ns()).directive("Polygon".ns(),["Polygon".ns(),function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("Circle".ns(),["Circle".ns(),function(a){return a}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapPolyline",["uiGmapPolyline",function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("Polylines".ns(),["Polylines".ns(),function(a){return new a}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapRectangle",["uiGmapLogger","uiGmapRectangle",function(a,b){return b}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapWindow",["$timeout","$compile","$http","$templateCache","uiGmapWindow",function(a,b,c,d,e){return new e(a,b,c,d)}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapWindows",["$timeout","$compile","$http","$templateCache","$interpolate","uiGmapWindows",function(a,b,c,d,e,f){return new f(a,b,c,d,e)}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};angular.module("uiGmapgoogle-maps").directive("uiGmapLayer",["$timeout","uiGmapLogger","uiGmapLayerParentModel",function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.template='',this.replace=!0,this.scope={show:"=show",type:"=type",namespace:"=namespace",options:"=options",onCreated:"&oncreated"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(){return function(e){return null!=a.onCreated?new d(a,b,c,e,a.onCreated):new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){angular.module("uiGmapgoogle-maps").directive("uiGmapMapControl",["uiGmapControl",function(a){return new a}])}.call(this),function(){angular.module("google-maps".ns()).directive("DrawingManager".ns(),["DrawingManager".ns(),function(a){return a}])}.call(this),function(){angular.module("google-maps".ns()).directive("FreeDrawPolygons".ns(),["ApiFreeDrawPolygons".ns(),function(a){return new a}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};angular.module("uiGmapgoogle-maps").directive("uiGmapMapType",["$timeout","uiGmapLogger","uiGmapMapTypeParentModel",function(b,c,d){var e;return new(e=function(){function b(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.template='',this.replace=!0,this.scope={show:"=show",options:"=options",refresh:"=refresh",id:"@"}}return b.prototype.link=function(a,b,c,e){return e.getScope().deferred.promise.then(function(){return function(e){return new d(a,b,c,e)}}(this))},b}())}])}.call(this),function(){var a=function(a,b){return function(){return a.apply(b,arguments)}};angular.module("google-maps".ns()).directive("SearchBox".ns(),["GoogleMapApi".ns(),"Logger".ns(),"SearchBoxParentModel".ns(),"$http","$templateCache",function(b,c,d,e,f){var g;return new(g=function(){function g(){this.link=a(this.link,this),this.$log=c,this.restrict="EMA",this.require="^"+"GoogleMap".ns(),this.priority=-1,this.transclude=!0,this.template='',this.replace=!0,this.scope={template:"=template",position:"=position",options:"=options",events:"=events",parentdiv:"=parentdiv"}}return g.prototype.link=function(a,c,g,h){return b.then(function(b){return function(i){return e.get(a.template,{cache:f}).success(function(e){return h.getScope().deferred.promise.then(function(f){var h;return h=angular.isDefined(a.position)?a.position.toUpperCase().replace(/-/g,"_"):"TOP_LEFT",i.ControlPosition[h]?new d(a,c,g,f,h,e):void b.$log.error("searchBox: invalid position property")})})}}(this))},g}())}])}.call(this),angular.module("google-maps.wrapped".ns()).service("uuid".ns(),function(){function a(){}return a.generate=function(){var b=a._gri,c=a._ha;return c(b(32),8)+"-"+c(b(16),4)+"-"+c(16384|b(12),4)+"-"+c(32768|b(14),4)+"-"+c(b(48),12)},a._gri=function(a){return 0>a?0/0:30>=a?0|Math.random()*(1<=a?(0|1073741824*Math.random())+1073741824*(0|Math.random()*(1<0;d>>>=1,e+=e)1&d&&(c=e+c);return c},a}),angular.module("google-maps.wrapped".ns()).service("GoogleMapsUtilV3".ns(),function(){return{init:_.once(function(){function a(a){a=a||{},google.maps.OverlayView.apply(this,arguments),this.content_=a.content||"",this.disableAutoPan_=a.disableAutoPan||!1,this.maxWidth_=a.maxWidth||0,this.pixelOffset_=a.pixelOffset||new google.maps.Size(0,0),this.position_=a.position||new google.maps.LatLng(0,0),this.zIndex_=a.zIndex||null,this.boxClass_=a.boxClass||"infoBox",this.boxStyle_=a.boxStyle||{},this.closeBoxMargin_=a.closeBoxMargin||"2px",this.closeBoxURL_=a.closeBoxURL||"http://www.google.com/intl/en_us/mapfiles/close.gif",""===a.closeBoxURL&&(this.closeBoxURL_=""),this.infoBoxClearance_=a.infoBoxClearance||new google.maps.Size(1,1),"undefined"==typeof a.visible&&(a.visible="undefined"==typeof a.isHidden?!0:!a.isHidden),this.isHidden_=!a.visible,this.alignBottom_=a.alignBottom||!1,this.pane_=a.pane||"floatPane",this.enableEventPropagation_=a.enableEventPropagation||!1,this.div_=null,this.closeListener_=null,this.moveListener_=null,this.contextListener_=null,this.eventListeners_=null,this.fixedWidthSet_=null}function b(a,c){a.getMarkerClusterer().extend(b,google.maps.OverlayView),this.cluster_=a,this.className_=a.getMarkerClusterer().getClusterClass(),this.styles_=c,this.center_=null,this.div_=null,this.sums_=null,this.visible_=!1,this.setMap(a.getMap())}function c(a){this.markerClusterer_=a,this.map_=a.getMap(),this.gridSize_=a.getGridSize(),this.minClusterSize_=a.getMinimumClusterSize(),this.averageCenter_=a.getAverageCenter(),this.markers_=[],this.center_=null,this.bounds_=null,this.clusterIcon_=new b(this,a.getStyles())}function d(a,b,c){this.extend(d,google.maps.OverlayView),b=b||[],c=c||{},this.markers_=[],this.clusters_=[],this.listeners_=[],this.activeMap_=null,this.ready_=!1,this.gridSize_=c.gridSize||60,this.minClusterSize_=c.minimumClusterSize||2,this.maxZoom_=c.maxZoom||null,this.styles_=c.styles||[],this.title_=c.title||"",this.zoomOnClick_=!0,void 0!==c.zoomOnClick&&(this.zoomOnClick_=c.zoomOnClick),this.averageCenter_=!1,void 0!==c.averageCenter&&(this.averageCenter_=c.averageCenter),this.ignoreHidden_=!1,void 0!==c.ignoreHidden&&(this.ignoreHidden_=c.ignoreHidden),this.enableRetinaIcons_=!1,void 0!==c.enableRetinaIcons&&(this.enableRetinaIcons_=c.enableRetinaIcons),this.imagePath_=c.imagePath||d.IMAGE_PATH,this.imageExtension_=c.imageExtension||d.IMAGE_EXTENSION,this.imageSizes_=c.imageSizes||d.IMAGE_SIZES,this.calculator_=c.calculator||d.CALCULATOR,this.batchSize_=c.batchSize||d.BATCH_SIZE,this.batchSizeIE_=c.batchSizeIE||d.BATCH_SIZE_IE,this.clusterClass_=c.clusterClass||"cluster",-1!==navigator.userAgent.toLowerCase().indexOf("msie")&&(this.batchSize_=this.batchSizeIE_),this.setupStyles_(),this.addMarkers(b,!0),this.setMap(a)}function e(a,b){function c(){}c.prototype=b.prototype,a.superClass_=b.prototype,a.prototype=new c,a.prototype.constructor=a}function f(a,b){this.marker_=a,this.handCursorURL_=a.handCursorURL,this.labelDiv_=document.createElement("div"),this.labelDiv_.style.cssText="position: absolute; overflow: hidden;",this.eventDiv_=document.createElement("div"),this.eventDiv_.style.cssText=this.labelDiv_.style.cssText,this.eventDiv_.setAttribute("onselectstart","return false;"),this.eventDiv_.setAttribute("ondragstart","return false;"),this.crossDiv_=f.getSharedCross(b)}function g(a){a=a||{},a.labelContent=a.labelContent||"",a.labelAnchor=a.labelAnchor||new google.maps.Point(0,0),a.labelClass=a.labelClass||"markerLabels",a.labelStyle=a.labelStyle||{},a.labelInBackground=a.labelInBackground||!1,"undefined"==typeof a.labelVisible&&(a.labelVisible=!0),"undefined"==typeof a.raiseOnDrag&&(a.raiseOnDrag=!0),"undefined"==typeof a.clickable&&(a.clickable=!0),"undefined"==typeof a.draggable&&(a.draggable=!1),"undefined"==typeof a.optimized&&(a.optimized=!1),a.crossImage=a.crossImage||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/drag_cross_67_16.png",a.handCursor=a.handCursor||"http"+("https:"===document.location.protocol?"s":"")+"://maps.gstatic.com/intl/en_us/mapfiles/closedhand_8_8.cur",a.optimized=!1,this.label=new f(this,a.crossImage,a.handCursor),google.maps.Marker.apply(this,arguments)}a.prototype=new google.maps.OverlayView,a.prototype.createInfoBoxDiv_=function(){var a,b,c,d=this,e=function(a){a.cancelBubble=!0,a.stopPropagation&&a.stopPropagation()},f=function(a){a.returnValue=!1,a.preventDefault&&a.preventDefault(),d.enableEventPropagation_||e(a)};if(!this.div_){if(this.div_=document.createElement("div"),this.setBoxStyle_(),"undefined"==typeof this.content_.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+this.content_:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(this.content_)),this.getPanes()[this.pane_].appendChild(this.div_),this.addClickHandler_(),this.div_.style.width?this.fixedWidthSet_=!0:0!==this.maxWidth_&&this.div_.offsetWidth>this.maxWidth_?(this.div_.style.width=this.maxWidth_,this.div_.style.overflow="auto",this.fixedWidthSet_=!0):(c=this.getBoxWidths_(),this.div_.style.width=this.div_.offsetWidth-c.left-c.right+"px",this.fixedWidthSet_=!1),this.panBox_(this.disableAutoPan_),!this.enableEventPropagation_){for(this.eventListeners_=[],b=["mousedown","mouseover","mouseout","mouseup","click","dblclick","touchstart","touchend","touchmove"],a=0;ag&&(d=o.x+k+i+m-g),this.alignBottom_?o.y<-j+n+l?e=o.y+j-n-l:o.y+j+n>h&&(e=o.y+j+n-h):o.y<-j+n?e=o.y+j-n:o.y+l+j+n>h&&(e=o.y+l+j+n-h),0!==d||0!==e){{b.getCenter()}b.panBy(d,e)}}},a.prototype.setBoxStyle_=function(){var a,b;if(this.div_){this.div_.className=this.boxClass_,this.div_.style.cssText="",b=this.boxStyle_;for(a in b)b.hasOwnProperty(a)&&(this.div_.style[a]=b[a]);"undefined"!=typeof this.div_.style.opacity&&""!==this.div_.style.opacity&&(this.div_.style.filter="alpha(opacity="+100*this.div_.style.opacity+")"),this.div_.style.position="absolute",this.div_.style.visibility="hidden",null!==this.zIndex_&&(this.div_.style.zIndex=this.zIndex_)}},a.prototype.getBoxWidths_=function(){var a,b={top:0,bottom:0,left:0,right:0},c=this.div_;return document.defaultView&&document.defaultView.getComputedStyle?(a=c.ownerDocument.defaultView.getComputedStyle(c,""),a&&(b.top=parseInt(a.borderTopWidth,10)||0,b.bottom=parseInt(a.borderBottomWidth,10)||0,b.left=parseInt(a.borderLeftWidth,10)||0,b.right=parseInt(a.borderRightWidth,10)||0)):document.documentElement.currentStyle&&c.currentStyle&&(b.top=parseInt(c.currentStyle.borderTopWidth,10)||0,b.bottom=parseInt(c.currentStyle.borderBottomWidth,10)||0,b.left=parseInt(c.currentStyle.borderLeftWidth,10)||0,b.right=parseInt(c.currentStyle.borderRightWidth,10)||0),b},a.prototype.onRemove=function(){this.div_&&(this.div_.parentNode.removeChild(this.div_),this.div_=null)},a.prototype.draw=function(){this.createInfoBoxDiv_();var a=this.getProjection().fromLatLngToDivPixel(this.position_);this.div_.style.left=a.x+this.pixelOffset_.width+"px",this.alignBottom_?this.div_.style.bottom=-(a.y+this.pixelOffset_.height)+"px":this.div_.style.top=a.y+this.pixelOffset_.height+"px",this.div_.style.visibility=this.isHidden_?"hidden":"visible"},a.prototype.setOptions=function(a){"undefined"!=typeof a.boxClass&&(this.boxClass_=a.boxClass,this.setBoxStyle_()),"undefined"!=typeof a.boxStyle&&(this.boxStyle_=a.boxStyle,this.setBoxStyle_()),"undefined"!=typeof a.content&&this.setContent(a.content),"undefined"!=typeof a.disableAutoPan&&(this.disableAutoPan_=a.disableAutoPan),"undefined"!=typeof a.maxWidth&&(this.maxWidth_=a.maxWidth),"undefined"!=typeof a.pixelOffset&&(this.pixelOffset_=a.pixelOffset),"undefined"!=typeof a.alignBottom&&(this.alignBottom_=a.alignBottom),"undefined"!=typeof a.position&&this.setPosition(a.position),"undefined"!=typeof a.zIndex&&this.setZIndex(a.zIndex),"undefined"!=typeof a.closeBoxMargin&&(this.closeBoxMargin_=a.closeBoxMargin),"undefined"!=typeof a.closeBoxURL&&(this.closeBoxURL_=a.closeBoxURL),"undefined"!=typeof a.infoBoxClearance&&(this.infoBoxClearance_=a.infoBoxClearance),"undefined"!=typeof a.isHidden&&(this.isHidden_=a.isHidden),"undefined"!=typeof a.visible&&(this.isHidden_=!a.visible),"undefined"!=typeof a.enableEventPropagation&&(this.enableEventPropagation_=a.enableEventPropagation),this.div_&&this.draw()},a.prototype.setContent=function(a){this.content_=a,this.div_&&(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.fixedWidthSet_||(this.div_.style.width=""),"undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a)),this.fixedWidthSet_||(this.div_.style.width=this.div_.offsetWidth+"px","undefined"==typeof a.nodeType?this.div_.innerHTML=this.getCloseBoxImg_()+a:(this.div_.innerHTML=this.getCloseBoxImg_(),this.div_.appendChild(a))),this.addClickHandler_()),google.maps.event.trigger(this,"content_changed")},a.prototype.setPosition=function(a){this.position_=a,this.div_&&this.draw(),google.maps.event.trigger(this,"position_changed")},a.prototype.setZIndex=function(a){this.zIndex_=a,this.div_&&(this.div_.style.zIndex=a),google.maps.event.trigger(this,"zindex_changed")},a.prototype.setVisible=function(a){this.isHidden_=!a,this.div_&&(this.div_.style.visibility=this.isHidden_?"hidden":"visible")},a.prototype.getContent=function(){return this.content_},a.prototype.getPosition=function(){return this.position_},a.prototype.getZIndex=function(){return this.zIndex_},a.prototype.getVisible=function(){var a;return a="undefined"==typeof this.getMap()||null===this.getMap()?!1:!this.isHidden_},a.prototype.show=function(){this.isHidden_=!1,this.div_&&(this.div_.style.visibility="visible")},a.prototype.hide=function(){this.isHidden_=!0,this.div_&&(this.div_.style.visibility="hidden")},a.prototype.open=function(a,b){var c=this;b&&(this.position_=b.getPosition(),this.moveListener_=google.maps.event.addListener(b,"position_changed",function(){c.setPosition(this.getPosition())})),this.setMap(a),this.div_&&this.panBox_()},a.prototype.close=function(){var a;if(this.closeListener_&&(google.maps.event.removeListener(this.closeListener_),this.closeListener_=null),this.eventListeners_){for(a=0;af&&g.getMap().setZoom(f+1)},100)),d.cancelBubble=!0,d.stopPropagation&&d.stopPropagation()}}),google.maps.event.addDomListener(this.div_,"mouseover",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseover",c.cluster_)}),google.maps.event.addDomListener(this.div_,"mouseout",function(){var a=c.cluster_.getMarkerClusterer();google.maps.event.trigger(a,"mouseout",c.cluster_)})},b.prototype.onRemove=function(){this.div_&&this.div_.parentNode&&(this.hide(),google.maps.event.removeListener(this.boundsChangedListener_),google.maps.event.clearInstanceListeners(this.div_),this.div_.parentNode.removeChild(this.div_),this.div_=null)},b.prototype.draw=function(){if(this.visible_){var a=this.getPosFromLatLng_(this.center_);this.div_.style.top=a.y+"px",this.div_.style.left=a.x+"px"}},b.prototype.hide=function(){this.div_&&(this.div_.style.display="none"),this.visible_=!1},b.prototype.show=function(){if(this.div_){var a="",b=this.backgroundPosition_.split(" "),c=parseInt(b[0].trim(),10),d=parseInt(b[1].trim(),10),e=this.getPosFromLatLng_(this.center_);this.div_.style.cssText=this.createCss(e),a="",this.div_.innerHTML=a+"
"+this.sums_.text+"
",this.div_.title="undefined"==typeof this.sums_.title||""===this.sums_.title?this.cluster_.getMarkerClusterer().getTitle():this.sums_.title,this.div_.style.display="" }this.visible_=!0},b.prototype.useStyle=function(a){this.sums_=a;var b=Math.max(0,a.index-1);b=Math.min(this.styles_.length-1,b);var c=this.styles_[b];this.url_=c.url,this.height_=c.height,this.width_=c.width,this.anchorText_=c.anchorText||[0,0],this.anchorIcon_=c.anchorIcon||[parseInt(this.height_/2,10),parseInt(this.width_/2,10)],this.textColor_=c.textColor||"black",this.textSize_=c.textSize||11,this.textDecoration_=c.textDecoration||"none",this.fontWeight_=c.fontWeight||"bold",this.fontStyle_=c.fontStyle||"normal",this.fontFamily_=c.fontFamily||"Arial,sans-serif",this.backgroundPosition_=c.backgroundPosition||"0 0"},b.prototype.setCenter=function(a){this.center_=a},b.prototype.createCss=function(a){var b=[];return b.push("cursor: pointer;"),b.push("position: absolute; top: "+a.y+"px; left: "+a.x+"px;"),b.push("width: "+this.width_+"px; height: "+this.height_+"px;"),b.join("")},b.prototype.getPosFromLatLng_=function(a){var b=this.getProjection().fromLatLngToDivPixel(a);return b.x-=this.anchorIcon_[1],b.y-=this.anchorIcon_[0],b.x=parseInt(b.x,10),b.y=parseInt(b.y,10),b},c.prototype.getSize=function(){return this.markers_.length},c.prototype.getMarkers=function(){return this.markers_},c.prototype.getCenter=function(){return this.center_},c.prototype.getMap=function(){return this.map_},c.prototype.getMarkerClusterer=function(){return this.markerClusterer_},c.prototype.getBounds=function(){var a,b=new google.maps.LatLngBounds(this.center_,this.center_),c=this.getMarkers();for(a=0;ad)a.getMap()!==this.map_&&a.setMap(this.map_);else if(cb;b++)this.markers_[b].setMap(null);else a.setMap(null);return this.updateIcon_(),!0},c.prototype.isMarkerInClusterBounds=function(a){return this.bounds_.contains(a.getPosition())},c.prototype.calculateBounds_=function(){var a=new google.maps.LatLngBounds(this.center_,this.center_);this.bounds_=this.markerClusterer_.getExtendedBounds(a)},c.prototype.updateIcon_=function(){var a=this.markers_.length,b=this.markerClusterer_.getMaxZoom();if(null!==b&&this.map_.getZoom()>b)return void this.clusterIcon_.hide();if(a0))for(a=0;ad&&(g=d,h=e));h&&h.isMarkerInClusterBounds(a)?h.addMarker(a):(e=new c(this),e.addMarker(a),this.clusters_.push(e))},d.prototype.createClusters_=function(a){var b,c,d,e=this;if(this.ready_){0===a&&(google.maps.event.trigger(this,"clusteringbegin",this),"undefined"!=typeof this.timerRefStatic&&(clearTimeout(this.timerRefStatic),delete this.timerRefStatic)),d=this.getMap().getZoom()>3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var f=this.getExtendedBounds(d),g=Math.min(a+this.batchSize_,this.markers_.length);for(b=a;g>b;b++)c=this.markers_[b],!c.isAdded&&this.isMarkerInBounds_(c,f)&&(!this.ignoreHidden_||this.ignoreHidden_&&c.getVisible())&&this.addToClosestCluster_(c);gc?a.getMap()!==this.map_&&a.setMap(this.map_):b3?new google.maps.LatLngBounds(this.getMap().getBounds().getSouthWest(),this.getMap().getBounds().getNorthEast()):new google.maps.LatLngBounds(new google.maps.LatLng(85.02070771743472,-178.48388434375),new google.maps.LatLng(-85.08136444384544,178.00048865625));var f=this.getExtendedBounds(d),g=Math.min(a+this.batchSize_,this.markers_.length);for(b=a;g>b;b++)c=this.markers_.values()[b],!c.isAdded&&this.isMarkerInBounds_(c,f)&&(!this.ignoreHidden_||this.ignoreHidden_&&c.getVisible())&&this.addToClosestCluster_(c);if(gc&&(f=c,g=d));g&&g.isMarkerInClusterBounds(a)?g.addMarker(a):(d=new NgMapCluster(this),d.addMarker(a),this.clusters_.push(d))},c.prototype.redraw_=function(){this.createClusters_(0)},c.prototype.resetViewport_=function(a){var b;for(b=0;b test: {} watch: + offline: + options: + livereload: true + + files: [ + "src/coffee/*.coffee", "src/coffee/**/*.coffee", "src/coffee/**/**/*.coffee", + "src/js/*.js", "src/js/**/*.js", "src/js/**/**/*.js", "spec/**/*.spec.coffee", "spec/coffee/helpers/**"#, + #"example/**" + ] + tasks: ['default-no-specs'] all: options: livereload: true diff --git a/spec/coffee/helpers/initiator.coffee b/spec/coffee/helpers/initiator.coffee index c17fded7f..60181eb8e 100644 --- a/spec/coffee/helpers/initiator.coffee +++ b/spec/coffee/helpers/initiator.coffee @@ -4,7 +4,7 @@ defaultMap = longitude: 47 latitude: -27 -window["Initiator".ns()] = +window["uiGmapInitiator"] = initDirective: (toInit, apiSubjectClassName, thingsToInit = ['initAll'], map = defaultMap)-> injects = ['$compile', '$rootScope', '$timeout', 'Logger'.ns()] diff --git a/src/coffee/directives/api/drawing-manager.coffee b/src/coffee/directives/api/drawing-manager.coffee index 37c959a07..a38939253 100644 --- a/src/coffee/directives/api/drawing-manager.coffee +++ b/src/coffee/directives/api/drawing-manager.coffee @@ -1,8 +1,8 @@ -angular.module("google-maps.directives.api".ns()).factory "DrawingManager".ns(), [ - "IDrawingManager".ns(), "DrawingManagerParentModel".ns(), - (IDrawingManager,DrawingManagerParentModel) -> +angular.module("uiGmapgoogle-maps.directives.api").factory "uiGmapDrawingManager", [ + "uiGmapIDrawingManager", "uiGmapDrawingManagerParentModel", + (IDrawingManager, DrawingManagerParentModel) -> _.extend IDrawingManager, link: (scope, element, attrs, mapCtrl) -> - mapCtrl.getScope().deferred.promise.then (map) => - new DrawingManagerParentModel scope,element,attrs, map + mapCtrl.getScope().deferred.promise.then (map) -> + new DrawingManagerParentModel scope, element, attrs, map ] diff --git a/src/coffee/directives/api/free-draw-polygons.coffee b/src/coffee/directives/api/free-draw-polygons.coffee index 3b1eba5e6..c18338c1f 100644 --- a/src/coffee/directives/api/free-draw-polygons.coffee +++ b/src/coffee/directives/api/free-draw-polygons.coffee @@ -3,14 +3,14 @@ - inject the draw function into a controllers scope so that controller can call the directive to draw on demand - draw function creates the DrawFreeHandChildModel which manages itself ### -angular.module("google-maps.directives.api".ns()) -.factory 'ApiFreeDrawPolygons'.ns(), ["Logger".ns(), 'BaseObject'.ns(), "CtrlHandle".ns(), "DrawFreeHandChildModel".ns(), +angular.module('uiGmapgoogle-maps.directives.api') +.factory 'uiGmapApiFreeDrawPolygons', ["uiGmapLogger", 'uiGmapBaseObject', "uiGmapCtrlHandle", "uiGmapDrawFreeHandChildModel", ($log, BaseObject, CtrlHandle, DrawFreeHandChildModel) -> class FreeDrawPolygons extends BaseObject @include CtrlHandle restrict: 'EMA' replace: true - require: '^' + 'GoogleMap'.ns() + require: '^' + 'uiGmapGoogleMap' scope: polygons: '=' draw: '=' @@ -19,9 +19,9 @@ angular.module("google-maps.directives.api".ns()) @mapPromise(scope, ctrl).then (map) => return $log.error "No polygons to bind to!" unless scope.polygons return $log.error "Free Draw Polygons must be of type Array!" unless _.isArray scope.polygons - freeHand = new DrawFreeHandChildModel(map, scope.originalMapOpts) + freeHand = new DrawFreeHandChildModel map, scope.originalMapOpts listener = undefined - scope.draw = () -> + scope.draw = -> #clear watch only watch when we are finished drawing/engaging listener?() freeHand.engage(scope.polygons).then -> @@ -36,4 +36,4 @@ angular.module("google-maps.directives.api".ns()) removals = _.differenceObjects oldValue, newValue removals.forEach (p) -> p.setMap null -] \ No newline at end of file +] diff --git a/src/coffee/directives/api/i-control.coffee b/src/coffee/directives/api/i-control.coffee index 8883afc93..597195a74 100644 --- a/src/coffee/directives/api/i-control.coffee +++ b/src/coffee/directives/api/i-control.coffee @@ -7,14 +7,14 @@ - controller - index ### -angular.module("google-maps.directives.api".ns()) -.factory "IControl".ns(), [ "BaseObject".ns(), "Logger".ns(), "CtrlHandle".ns(), (BaseObject, Logger, CtrlHandle) -> +angular.module("uiGmapgoogle-maps.directives.api") +.factory "uiGmapIControl", [ "uiGmapBaseObject", "uiGmapLogger", "uiGmapCtrlHandle", (BaseObject, Logger, CtrlHandle) -> class IControl extends BaseObject @extend CtrlHandle constructor: -> @restrict = 'EA' @replace = true - @require = '^' + 'GoogleMap'.ns() + @require = '^' + 'uiGmapGoogleMap' @scope = template: '@template' position: '@position' @@ -22,6 +22,6 @@ angular.module("google-maps.directives.api".ns()) index: '@index' @$log = Logger - link: (scope, element, attrs, ctrl) => - throw new Exception("Not implemented!!") + link: (scope, element, attrs, ctrl) -> + throw new Exception "Not implemented!!" ] diff --git a/src/coffee/directives/api/i-drawing-manager.coffee b/src/coffee/directives/api/i-drawing-manager.coffee index 4b22bf5c4..da576e510 100644 --- a/src/coffee/directives/api/i-drawing-manager.coffee +++ b/src/coffee/directives/api/i-drawing-manager.coffee @@ -1,9 +1,9 @@ -angular.module("google-maps.directives.api".ns()).service "IDrawingManager".ns(), [ -> - restrict: "EA" +angular.module('uiGmapgoogle-maps.directives.api').service 'uiGmapIDrawingManager', [ -> + restrict: 'EA' replace: true - require: '^' + 'GoogleMap'.ns() + require: '^' + 'uiGmapGoogleMap' scope: - static: "@" - control: "=" - options: "=" + static: '@' + control: '=' + options: '=' ] diff --git a/src/coffee/directives/api/i-marker.coffee b/src/coffee/directives/api/i-marker.coffee index a93883b1d..291d24104 100644 --- a/src/coffee/directives/api/i-marker.coffee +++ b/src/coffee/directives/api/i-marker.coffee @@ -17,7 +17,7 @@ angular.module("google-maps.directives.api".ns()) options: '=options' events: '=events' fit: '=fit' - idKey: '=idkey' #id key to bind to that makes a model unique, if it does not exist default to rebuilding all markers + idKey: '=idkey' control: '=control' IMarker.keys = _.keys IMarker.scopeKeys diff --git a/src/coffee/directives/api/i-polygon.coffee b/src/coffee/directives/api/i-polygon.coffee index e808e03d1..4fa75983f 100644 --- a/src/coffee/directives/api/i-polygon.coffee +++ b/src/coffee/directives/api/i-polygon.coffee @@ -1,29 +1,29 @@ -angular.module("google-maps.directives.api".ns()) -.factory "IPolygon".ns(), ["GmapUtil".ns(), "BaseObject".ns(), "Logger".ns(), "CtrlHandle".ns(), +angular.module('uiGmapgoogle-maps.directives.api') +.factory 'uiGmapIPolygon', ['uiGmapGmapUtil', 'uiGmapBaseObject', 'uiGmapLogger', 'uiGmapCtrlHandle', (GmapUtil, BaseObject, Logger, CtrlHandle) -> class IPolygon extends BaseObject @include GmapUtil @extend CtrlHandle constructor: -> - restrict: "EMA" + restrict: 'EMA' replace: true - require: '^' + 'GoogleMap'.ns() + require: '^' + 'uiGmapGoogleMap' scope: - path: "=path" - stroke: "=stroke" - clickable: "=" - draggable: "=" - editable: "=" - geodesic: "=" - fill: "=" - icons: "=icons" - visible: "=" - static: "=" - events: "=" - zIndex: "=zindex" - fit: "=" - control:"=control" + path: '=path' + stroke: '=stroke' + clickable: '=' + draggable: '=' + editable: '=' + geodesic: '=' + fill: '=' + icons: '=icons' + visible: '=' + static: '=' + events: '=' + zIndex: '=zindex' + fit: '=' + control:'=control' DEFAULTS: {} $log: Logger -] \ No newline at end of file +] diff --git a/src/coffee/directives/api/i-polyline.coffee b/src/coffee/directives/api/i-polyline.coffee index c674be0be..65e1667b4 100644 --- a/src/coffee/directives/api/i-polyline.coffee +++ b/src/coffee/directives/api/i-polyline.coffee @@ -1,25 +1,25 @@ -angular.module("google-maps.directives.api".ns()) -.factory "IPolyline".ns(), ["GmapUtil".ns(), "BaseObject".ns(), "Logger".ns(), "CtrlHandle".ns(), (GmapUtil, BaseObject, Logger, CtrlHandle) -> +angular.module('uiGmapgoogle-maps.directives.api') +.factory 'uiGmapIPolyline', ['uiGmapGmapUtil', 'uiGmapBaseObject', 'uiGmapLogger', 'uiGmapCtrlHandle', (GmapUtil, BaseObject, Logger, CtrlHandle) -> class IPolyline extends BaseObject @include GmapUtil @extend CtrlHandle constructor: ()-> - restrict: "EMA" + restrict: 'EMA' replace: true - require: '^' + 'GoogleMap'.ns() + require: '^' + 'uiGmapGoogleMap' scope: - path: "=" - stroke: "=" - clickable: "=" - draggable: "=" - editable: "=" - geodesic: "=" - icons: "=" - visible: "=" - static: "=" - fit: "=" - events: "=" + path: '=' + stroke: '=' + clickable: '=' + draggable: '=' + editable: '=' + geodesic: '=' + icons: '=' + visible: '=' + static: '=' + fit: '=' + events: '=' DEFAULTS: {} $log: Logger -] \ No newline at end of file +] diff --git a/src/coffee/directives/api/i-rectangle.coffee b/src/coffee/directives/api/i-rectangle.coffee index b6ea47de9..3035f7443 100644 --- a/src/coffee/directives/api/i-rectangle.coffee +++ b/src/coffee/directives/api/i-rectangle.coffee @@ -1,16 +1,16 @@ -angular.module("google-maps.directives.api".ns()).service "IRectangle".ns(), [ -> - "use strict" +angular.module('uiGmapgoogle-maps.directives.api').service 'uiGmapIRectangle', [ -> + 'use strict' DEFAULTS = {} - restrict: "EMA" - require: '^' + 'GoogleMap'.ns() + restrict: 'EMA' + require: '^' + 'uiGmapGoogleMap' replace: true scope: - bounds: "=" - stroke: "=" - clickable: "=" - draggable: "=" - editable: "=" - fill: "=" - visible: "=" - events: "=" + bounds: '=' + stroke: '=' + clickable: '=' + draggable: '=' + editable: '=' + fill: '=' + visible: '=' + events: '=' ] diff --git a/src/coffee/directives/api/i-window.coffee b/src/coffee/directives/api/i-window.coffee index c095e2b61..c5a4db8fc 100644 --- a/src/coffee/directives/api/i-window.coffee +++ b/src/coffee/directives/api/i-window.coffee @@ -1,9 +1,6 @@ -### - - interface directive for all window(s) to derive from -### -angular.module("uiGmapgoogle-maps.directives.api") -.factory "uiGmapIWindow", [ - "uiGmapBaseObject", "uiGmapChildEvents", "uiGmapLogger", "uiGmapCtrlHandle", +angular.module('uiGmapgoogle-maps.directives.api') +.factory 'uiGmapIWindow', [ + 'uiGmapBaseObject', 'uiGmapChildEvents', 'uiGmapLogger', 'uiGmapCtrlHandle', (BaseObject, ChildEvents, Logger, CtrlHandle) -> class IWindow extends BaseObject @include ChildEvents @@ -13,7 +10,7 @@ angular.module("uiGmapgoogle-maps.directives.api") @template = undefined @transclude = true @priority = -100 - @require = '^' + 'GoogleMap'.ns() + @require = '^' + 'uiGmapGoogleMap' @replace = true @scope = { coords: '=coords', @@ -21,10 +18,9 @@ angular.module("uiGmapgoogle-maps.directives.api") templateUrl: '=templateurl', templateParameter: '=templateparameter', isIconVisibleOnClick: '=isiconvisibleonclick', - closeClick: '&closeclick', #scope glue to gmap InfoWindow closeclick + closeClick: '&closeclick', options: '=options' control: '=control' - #show is not part of options, (https://developers.google.com/maps/documentation/javascript/reference#InfoWindowOptions) we need it then show: '=show' } @$log = Logger diff --git a/src/coffee/directives/api/managers/clusterer-marker-manager.coffee b/src/coffee/directives/api/managers/clusterer-marker-manager.coffee index 11024ffee..83973eef9 100644 --- a/src/coffee/directives/api/managers/clusterer-marker-manager.coffee +++ b/src/coffee/directives/api/managers/clusterer-marker-manager.coffee @@ -1,5 +1,5 @@ -angular.module("google-maps.directives.api.managers".ns()) -.factory "ClustererMarkerManager".ns(), ["Logger".ns(), "FitHelper".ns(), "PropMap".ns(), ($log, FitHelper, PropMap) -> +angular.module('uiGmapgoogle-maps.directives.api.managers') +.factory 'uiGmapClustererMarkerManager', ['uiGmapLogger', 'uiGmapFitHelper', 'uiGmapPropMap', ($log, FitHelper, PropMap) -> class ClustererMarkerManager extends FitHelper @type = 'ClustererMarkerManager' constructor: (gMap, opt_markers, opt_options, @opt_events) -> @@ -8,29 +8,27 @@ angular.module("google-maps.directives.api.managers".ns()) self = @ @opt_options = opt_options if opt_options? and opt_markers == undefined - @clusterer = new NgMapMarkerClusterer(gMap, undefined, opt_options) + @clusterer = new NgMapMarkerClusterer gMap, undefined, opt_options else if opt_options? and opt_markers? - @clusterer = new NgMapMarkerClusterer(gMap, opt_markers, opt_options) + @clusterer = new NgMapMarkerClusterer gMap, opt_markers, opt_options else - @clusterer = new NgMapMarkerClusterer(gMap) + @clusterer = new NgMapMarkerClusterer gMap @propMapGMarkers = new PropMap() #keep in sync with cluster.markers_ - @attachEvents @opt_events, "opt_events" + @attachEvents @opt_events, 'opt_events' - @clusterer.setIgnoreHidden(true) + @clusterer.setIgnoreHidden true @noDrawOnSingleAddRemoves = true - $log.info(@) + $log.info @ checkKey: (gMarker) -> unless gMarker.key? - msg = "gMarker.key undefined and it is REQUIRED!!" + msg = 'gMarker.key undefined and it is REQUIRED!!' Logger.error msg add: (gMarker)=> @checkKey gMarker - exists = @propMapGMarkers.get(gMarker.key)? - - @clusterer.addMarker(gMarker, @noDrawOnSingleAddRemoves) + @clusterer.addMarker gMarker, @noDrawOnSingleAddRemoves @propMapGMarkers.put gMarker.key, gMarker @checkSync() @@ -76,14 +74,14 @@ angular.module("google-maps.directives.api.managers".ns()) @clearEvents @opt_internal_events @clear() - fit: ()=> + fit: => super @getGMarkers(), @clusterer.getMap() getGMarkers: => @clusterer.getMarkers().values() checkSync: => - throw "GMarkers out of Sync in MarkerClusterer" if @getGMarkers().length != @propMapGMarkers.length + throw 'GMarkers out of Sync in MarkerClusterer' if @getGMarkers().length != @propMapGMarkers.length ClustererMarkerManager ] diff --git a/src/coffee/directives/api/managers/marker-manager.coffee b/src/coffee/directives/api/managers/marker-manager.coffee index 1b9b32e55..7a547ce99 100644 --- a/src/coffee/directives/api/managers/marker-manager.coffee +++ b/src/coffee/directives/api/managers/marker-manager.coffee @@ -1,5 +1,5 @@ -angular.module("google-maps.directives.api.managers".ns()) -.factory "MarkerManager".ns(), ["Logger".ns(), "FitHelper".ns(), "PropMap".ns(), (Logger, FitHelper, PropMap) -> +angular.module("uiGmapgoogle-maps.directives.api.managers") +.factory "uiGmapMarkerManager", ["uiGmapLogger", "uiGmapFitHelper", "uiGmapPropMap", (Logger, FitHelper, PropMap) -> class MarkerManager extends FitHelper @include FitHelper @type = 'MarkerManager' diff --git a/src/coffee/directives/api/map.coffee b/src/coffee/directives/api/map.coffee index 4f9ec059a..0624e9212 100644 --- a/src/coffee/directives/api/map.coffee +++ b/src/coffee/directives/api/map.coffee @@ -98,7 +98,7 @@ angular.module("uiGmapgoogle-maps.directives.api") bounds: scope.bounds _m = new google.maps.Map(el.find("div")[1], mapOptions) - _m['_id'.ns()] = uuid.generate() + _m['uiGmap_id'] = uuid.generate() dragging = false diff --git a/src/coffee/directives/api/models/child/free-draw-polygons-child.coffee b/src/coffee/directives/api/models/child/free-draw-polygons-child.coffee index f8a890343..d74614a8c 100644 --- a/src/coffee/directives/api/models/child/free-draw-polygons-child.coffee +++ b/src/coffee/directives/api/models/child/free-draw-polygons-child.coffee @@ -7,19 +7,16 @@ Nicholas McCready - https://twitter.com/nmccready Original idea from: http://stackoverflow.com/questions/22758950/google-map-drawing-freehand , & http://jsfiddle.net/YsQdh/88/ ### -angular.module("google-maps.directives.api.models.child".ns()) -.factory "DrawFreeHandChildModel".ns(), ["Logger".ns(), '$q', ($log,$q) -> +angular.module('uiGmapgoogle-maps.directives.api.models.child') +.factory 'uiGmapDrawFreeHandChildModel', ['uiGmapLogger', '$q', ($log, $q) -> drawFreeHand = (map, @polys, enable) -> - #the polygon poly = new google.maps.Polyline map: map clickable: false - #move-listener move = google.maps.event.addListener map, 'mousemove', (e) -> poly.getPath().push e.latLng - #mouseup-listener google.maps.event.addListenerOnce map, 'mouseup', (e) -> google.maps.event.removeListener move path = poly.getPath() @@ -30,18 +27,18 @@ angular.module("google-maps.directives.api.models.child".ns()) poly = null google.maps.event.clearListeners map.getDiv(), 'mousedown' enable() + undefined freeHandMgr = (@map) -> #freeze map to make drawing easy (need to drag to draw .. instead of moving the map) enable = => @deferred?.resolve() - #set map back to old setting @map.setOptions @oldOptions disableMap = => - $log.info('disabling map move'); - @oldOptions = map.getOptions() #dependent on ui-gmap-map directive extension + $log.info 'disabling map move' + @oldOptions = map.getOptions() @map.setOptions draggable: false zoomControl: false @@ -51,10 +48,12 @@ angular.module("google-maps.directives.api.models.child".ns()) @engage = (@polys) => @deferred = $q.defer() disableMap() - $log.info('DrawFreeHandChildModel is engaged (drawing).'); + $log.info 'DrawFreeHandChildModel is engaged (drawing).' google.maps.event.addDomListener @map.getDiv(), 'mousedown', (e) => drawFreeHand @map, @polys, enable @deferred.promise - return @ + + this + freeHandMgr -] \ No newline at end of file +] diff --git a/src/coffee/directives/api/models/child/marker-child-model.coffee b/src/coffee/directives/api/models/child/marker-child-model.coffee index 2e3178d2a..c4650282e 100644 --- a/src/coffee/directives/api/models/child/marker-child-model.coffee +++ b/src/coffee/directives/api/models/child/marker-child-model.coffee @@ -1,7 +1,7 @@ -angular.module("google-maps.directives.api.models.child".ns()) -.factory "MarkerChildModel".ns(), [ "ModelKey".ns(), "GmapUtil".ns(), - "Logger".ns(), "EventsHelper".ns(),"PropertyAction".ns(), - "MarkerOptions".ns(), "IMarker".ns(), "MarkerManager".ns(), "uiGmapPromise", +angular.module('uiGmapgoogle-maps.directives.api.models.child') +.factory 'uiGmapMarkerChildModel', [ 'uiGmapModelKey', 'uiGmapGmapUtil', + 'uiGmapLogger', 'uiGmapEventsHelper','uiGmapPropertyAction', + 'uiGmapMarkerOptions', 'uiGmapIMarker', 'uiGmapMarkerManager', 'uiGmapPromise', (ModelKey, GmapUtil, $log, EventsHelper, PropertyAction, MarkerOptions, IMarker, MarkerManager, uiGmapPromise) -> keys = ['coords', 'icon', 'options', 'fit'] class MarkerChildModel extends ModelKey @@ -19,39 +19,42 @@ angular.module("google-maps.directives.api.models.child".ns()) child.gMarker = null constructor: (scope, @model, @keys, @gMap, @defaults, @doClick, @gMarkerManager, @doDrawSelf = true, - @trackModel = true, @needRedraw = false) -> + @deferred = uiGmapPromise.defer() _.each @keys, (v, k) => @[k + 'Key'] = if _.isFunction @keys[k] then @keys[k]() else @keys[k] - @idKey = @idKeyKey or "id" + @idKey = @idKeyKey or 'id' @id = @model[@idKey] if @model[@idKey]? super(scope) - @setMyScope('all',@model, undefined, true) + @setMyScope 'all',@model, undefined, true @scope.getGMarker = => @gMarker - @createMarker(@model) + @createMarker @model firstTime = true if @trackModel @scope.model = @model @scope.$watch 'model', (newValue, oldValue) => if (newValue != oldValue) - changes = @getChanges(newValue,oldValue, IMarker.keys) + changes = @getChanges newValue, oldValue, IMarker.keys + _.each changes, (v, k) => @setMyScope k, newValue, oldValue @needRedraw = true , true else action = new PropertyAction (calledKey, newVal) => - @setMyScope(calledKey,scope) #being in a closure works , direct to setMyScope is not working (but should?) + #being in a closure works , direct to setMyScope is not working (but should?) + @setMyScope calledKey, scope , false + _.each @keys, (v, k) -> - scope.$watch(k, action.sic, true) + scope.$watch k, action.sic, true #hiding destroy functionality as it should only be called via scope.$destroy() - @scope.$on "$destroy", => + @scope.$on '$destroy', => destroy @ $log.info @ @@ -63,16 +66,16 @@ angular.module("google-maps.directives.api.models.child".ns()) setMyScope: (thingThatChanged, model, oldModel = undefined, isInit = false) => model = @model unless model? if !@gMarker - @setOptions(@scope) + @setOptions @scope justCreated = true switch thingThatChanged when 'all' _.each @keys, (v,k) => @setMyScope k, model, oldModel, isInit when 'icon' - @maybeSetScopeValue('icon', model, oldModel, @iconKey, @evalModelHandle, isInit, @setIcon) + @maybeSetScopeValue 'icon', model, oldModel, @iconKey, @evalModelHandle, isInit, @setIcon when 'coords' - @maybeSetScopeValue('coords', model, oldModel, @coordsKey, @evalModelHandle, isInit, @setCoords) + @maybeSetScopeValue 'coords', model, oldModel, @coordsKey, @evalModelHandle, isInit, @setCoords when 'options' @createMarker(model, oldModel, isInit) if !justCreated @@ -81,12 +84,12 @@ angular.module("google-maps.directives.api.models.child".ns()) maybeSetScopeValue: (scopePropName, model, oldModel, modelKey, evaluate, isInit, gSetter = undefined) => if oldModel == undefined - @scope[scopePropName] = evaluate(model, modelKey) + @scope[scopePropName] = evaluate model, modelKey gSetter(@scope) if gSetter? return - oldVal = evaluate(oldModel, modelKey) - newValue = evaluate(model, modelKey) + oldVal = evaluate oldModel, modelKey + newValue = evaluate model, modelKey if newValue != oldVal @scope[scopePropName] = newValue unless isInit @@ -101,8 +104,8 @@ angular.module("google-maps.directives.api.models.child".ns()) setCoords: (scope) => return if @isNotValid(scope) or !@gMarker? if @getProp(@coordsKey,@model)? - if !@validateCoords(@getProp(@coordsKey,@model)) - $log.debug "MarkerChild does not have coords yet. They may be defined later." + if !@validateCoords @getProp @coordsKey,@model + $log.debug 'MarkerChild does not have coords yet. They may be defined later.' return @gMarker.setPosition @getCoords(@getProp(@coordsKey,@model)) @gMarker.setVisible @validateCoords(@getProp(@coordsKey,@model)) @@ -112,22 +115,22 @@ angular.module("google-maps.directives.api.models.child".ns()) @gMarkerManager.remove @gMarker setIcon: (scope) => - return if @isNotValid(scope) or !@gMarker? + return if @isNotValid(scope) or !@gMarker? # @gMarkerManager.remove @gMarker - @gMarker.setIcon @getProp(@iconKey,@model) + @gMarker.setIcon @getProp @iconKey, @model @gMarkerManager.add @gMarker - @gMarker.setPosition @getCoords(@getProp(@coordsKey,@model)) - @gMarker.setVisible @validateCoords(@getProp(@coordsKey,@model)) + @gMarker.setPosition @getCoords @getProp @coordsKey, @model + @gMarker.setVisible @validateCoords @getProp @coordsKey, @model setOptions: (scope) => return if @isNotValid scope, false unless scope.coords? return - coords = @getProp(@coordsKey,@model) - icon = @getProp(@iconKey,@model) - _options = @getProp(@optionsKey,@model) - @opts = @createOptions(coords,icon,_options) + coords = @getProp @coordsKey, @model + icon = @getProp @iconKey,@model + _options = @getProp @optionsKey, @model + @opts = @createOptions coords, icon, _options if @gMarker? and (@isLabel @gMarker == @isLabel @opts) @gMarker.setOptions @opts @@ -140,7 +143,7 @@ angular.module("google-maps.directives.api.models.child".ns()) if @isLabel @opts @gMarker = new MarkerWithLabel @setLabelOptions @opts else - @gMarker = new google.maps.Marker(@opts) + @gMarker = new google.maps.Marker @opts #hook external event handlers for events @removeEvents @externalListeners if @externalListeners @@ -155,7 +158,7 @@ angular.module("google-maps.directives.api.models.child".ns()) if @gMarker and (@gMarker.getMap() or @gMarkerManager.type != MarkerManager.type) @deferred.resolve @gMarker else - @deferred.reject "gMarker is null" unless @gMarker + @deferred.reject 'gMarker is null' unless @gMarker unless @gMarker.getMap() and @gMarkerManager.type == MarkerManager.type $log.warn 'gMarker has no map yet' @deferred.resolve @gMarker @@ -163,7 +166,6 @@ angular.module("google-maps.directives.api.models.child".ns()) if @model[@fitKey] @gMarkerManager.fit() - setLabelOptions: (opts) => opts.labelAnchor = @getLabelPositionPoint opts.labelAnchor opts @@ -172,7 +174,7 @@ angular.module("google-maps.directives.api.models.child".ns()) dragend: (marker, eventName, model, mousearg) => modelToSet = if @trackModel then @scope.model else @model newCoords = @setCoordsFromEvent @modelOrKey(modelToSet, @coordsKey), @gMarker.getPosition() - modelToSet = @setVal(model, @coordsKey, newCoords) + modelToSet = @setVal model, @coordsKey, newCoords #since we ignored dragend for scope above, if @scope.events has it then we should fire it events = @scope.events events.dragend(marker, eventName, modelToSet, mousearg) if events?.dragend? @@ -180,7 +182,7 @@ angular.module("google-maps.directives.api.models.child".ns()) click: (marker, eventName, model, mousearg) => click = if _.isFunction(@clickKey) then @clickKey else @getProp @clickKey, @model if @doClick and click? - @scope.$evalAsync click(marker, eventName, @model, mousearg) + @scope.$evalAsync click marker, eventName, @model, mousearg MarkerChildModel ] diff --git a/src/coffee/directives/api/models/child/polygon-child-model.coffee b/src/coffee/directives/api/models/child/polygon-child-model.coffee index a134a5d33..af3dfe160 100644 --- a/src/coffee/directives/api/models/child/polygon-child-model.coffee +++ b/src/coffee/directives/api/models/child/polygon-child-model.coffee @@ -1,7 +1,7 @@ -angular.module("google-maps.directives.api".ns()) -.factory "PolygonChildModel".ns(), [ - "PolygonOptionsBuilder".ns(), "Logger".ns(), "$timeout", - "array-sync".ns(), "GmapUtil".ns(), "EventsHelper".ns() +angular.module('uiGmapgoogle-maps.directives.api') +.factory 'uiGmapPolygonChildModel', [ + 'uiGmapPolygonOptionsBuilder', 'uiGmapLogger', '$timeout', + 'uiGmaparray-sync', 'uiGmapGmapUtil', 'uiGmapEventsHelper' (Builder, $log, $timeout, arraySync, GmapUtil, EventsHelper) -> class PolygonChildModel extends Builder @@ -10,63 +10,63 @@ angular.module("google-maps.directives.api".ns()) constructor: (@scope, @attrs, @map, @defaults, @model) -> @listeners = undefined # Validate required properties - if angular.isUndefined(scope.path) or scope.path is null or not @validatePath(scope.path) - $log.error "polygon: no valid path attribute found" + if angular.isUndefined(scope.path) or scope.path is null or not @validatePath scope.path + $log.error 'polygon: no valid path attribute found' return - pathPoints = @convertPathPoints(scope.path) - polygon = new google.maps.Polygon(@buildOpts(pathPoints)) - @extendMapBounds @map, pathPoints if scope.fit + pathPoints = @convertPathPoints scope.path + polygon = new google.maps.Polygon @buildOpts pathPoints + @extendMapBounds @map, pathPoints if scope.fit #TODO refactor all these sets and watches to be handled functionally as an array - if !scope.static and angular.isDefined(scope.editable) - scope.$watch "editable", (newValue, oldValue) -> - polygon.setEditable newValue if newValue != oldValue + if !scope.static and angular.isDefined scope.editable + scope.$watch 'editable', (newValue, oldValue) -> + polygon.setEditable newValue if newValue isnt oldValue - if angular.isDefined(scope.draggable) - scope.$watch "draggable", (newValue, oldValue) -> - polygon.setDraggable newValue if newValue != oldValue + if angular.isDefined scope.draggable + scope.$watch 'draggable', (newValue, oldValue) -> + polygon.setDraggable newValue if newValue isnt oldValue - if angular.isDefined(scope.visible) - scope.$watch "visible", (newValue, oldValue) -> - polygon.setVisible newValue if newValue != oldValue + if angular.isDefined scope.visible + scope.$watch 'visible', (newValue, oldValue) -> + polygon.setVisible newValue if newValue isnt oldValue - if angular.isDefined(scope.geodesic) - scope.$watch "geodesic", (newValue, oldValue) => - polygon.setOptions @buildOpts(polygon.getPath()) if newValue != oldValue + if angular.isDefined scope.geodesic + scope.$watch 'geodesic', (newValue, oldValue) => + polygon.setOptions @buildOpts(polygon.getPath()) if newValue isnt oldValue - if angular.isDefined(scope.stroke) and angular.isDefined(scope.stroke.opacity) - scope.$watch "stroke.opacity", (newValue, oldValue) => - polygon.setOptions @buildOpts(polygon.getPath()) + if angular.isDefined(scope.stroke) and angular.isDefined scope.stroke.opacity + scope.$watch 'stroke.opacity', (newValue, oldValue) => + polygon.setOptions @buildOpts polygon.getPath() - if angular.isDefined(scope.stroke) and angular.isDefined(scope.stroke.weight) - scope.$watch "stroke.weight", (newValue, oldValue) => - polygon.setOptions @buildOpts(polygon.getPath()) if newValue != oldValue + if angular.isDefined(scope.stroke) and angular.isDefined scope.stroke.weight + scope.$watch 'stroke.weight', (newValue, oldValue) => + polygon.setOptions @buildOpts(polygon.getPath()) if newValue isnt oldValue - if angular.isDefined(scope.stroke) and angular.isDefined(scope.stroke.color) - scope.$watch "stroke.color", (newValue, oldValue) => - polygon.setOptions @buildOpts(polygon.getPath()) if newValue != oldValue + if angular.isDefined(scope.stroke) and angular.isDefined scope.stroke.color + scope.$watch 'stroke.color', (newValue, oldValue) => + polygon.setOptions @buildOpts(polygon.getPath()) if newValue isnt oldValue - if angular.isDefined(scope.fill) and angular.isDefined(scope.fill.color) - scope.$watch "fill.color", (newValue, oldValue) => - polygon.setOptions @buildOpts(polygon.getPath()) if newValue != oldValue + if angular.isDefined(scope.fill) and angular.isDefined scope.fill.color + scope.$watch 'fill.color', (newValue, oldValue) => + polygon.setOptions @buildOpts(polygon.getPath()) if newValue isnt oldValue - if angular.isDefined(scope.fill) and angular.isDefined(scope.fill.opacity) - scope.$watch "fill.opacity", (newValue, oldValue) => - polygon.setOptions @buildOpts(polygon.getPath()) if newValue != oldValue + if angular.isDefined(scope.fill) and angular.isDefined scope.fill.opacity + scope.$watch 'fill.opacity', (newValue, oldValue) => + polygon.setOptions @buildOpts(polygon.getPath()) if newValue isnt oldValue - if angular.isDefined(scope.zIndex) - scope.$watch "zIndex", (newValue, oldValue) => - polygon.setOptions @buildOpts(polygon.getPath()) if newValue != oldValue + if angular.isDefined scope.zIndex + scope.$watch 'zIndex', (newValue, oldValue) => + polygon.setOptions @buildOpts(polygon.getPath()) if newValue isnt oldValue - if angular.isDefined(scope.events) and scope.events isnt null and angular.isObject(scope.events) + if angular.isDefined(scope.events) and scope.events isnt null and angular.isObject scope.events @listeners = EventsHelper.setEvents polygon, scope, scope - arraySyncer = arraySync polygon.getPath(), scope, "path", (pathPoints) => - @extendMapBounds @map, pathPoints if scope.fit + arraySyncer = arraySync polygon.getPath(), scope, 'path', (pathPoints) => + @extendMapBounds @map, pathPoints if scope.fit # Remove polygon on scope $destroy - scope.$on "$destroy", => + scope.$on '$destroy', => polygon.setMap null @removeEvents @listeners if arraySyncer diff --git a/src/coffee/directives/api/models/child/polyline-child-model.coffee b/src/coffee/directives/api/models/child/polyline-child-model.coffee index 0de0afaeb..9be4fcbb1 100644 --- a/src/coffee/directives/api/models/child/polyline-child-model.coffee +++ b/src/coffee/directives/api/models/child/polyline-child-model.coffee @@ -1,7 +1,7 @@ -angular.module("google-maps.directives.api".ns()) -.factory "PolylineChildModel".ns(), [ - "PolylineOptionsBuilder".ns(), "Logger".ns(), "$timeout", - "array-sync".ns(), "GmapUtil".ns(), "EventsHelper".ns() +angular.module('uiGmapgoogle-maps.directives.api') +.factory 'ugGmapPolylineChildModel', [ + 'uiGmapPolylineOptionsBuilder', 'uiGmapLogger', '$timeout', + 'uiGmaparray-sync', 'uiGmapGmapUtil', 'uiGmapEventsHelper' (Builder, $log, $timeout, arraySync, GmapUtil,EventsHelper) -> class PolylineChildModel extends Builder @@ -16,7 +16,7 @@ angular.module("google-maps.directives.api".ns()) @polyline = new google.maps.Polyline @buildOpts pathPoints if pathPoints.length > 0 if @polyline @extendMapBounds map, pathPoints if @scope.fit - arraySync @polyline.getPath(), @scope, "path", (pathPoints) => + arraySync @polyline.getPath(), @scope, 'path', (pathPoints) => @extendMapBounds map, pathPoints if @scope.fit @listeners = if @model then @setEvents @polyline, @scope, @model else @setEvents @polyline, @scope, @scope @@ -27,39 +27,39 @@ angular.module("google-maps.directives.api".ns()) createPolyline() #TODO refactor all these sets and watches to be handled functionally as an array if !scope.static and angular.isDefined(scope.editable) - scope.$watch "editable", (newValue, oldValue) => - @polyline?.setEditable newValue if newValue != oldValue + scope.$watch 'editable', (newValue, oldValue) => + @polyline?.setEditable newValue if newValue isnt oldValue if angular.isDefined scope.draggable - scope.$watch "draggable", (newValue, oldValue) => - @polyline?.setDraggable newValue if newValue != oldValue + scope.$watch 'draggable', (newValue, oldValue) => + @polyline?.setDraggable newValue if newValue isnt oldValue if angular.isDefined scope.visible - scope.$watch "visible", (newValue, oldValue) => - @polyline?.setVisible newValue if newValue != oldValue + scope.$watch 'visible', (newValue, oldValue) => + @polyline?.setVisible newValue if newValue isnt oldValue if angular.isDefined scope.geodesic - scope.$watch "geodesic", (newValue, oldValue) => - @polyline?.setOptions @buildOpts(@polyline.getPath()) if newValue != oldValue + scope.$watch 'geodesic', (newValue, oldValue) => + @polyline?.setOptions @buildOpts(@polyline.getPath()) if newValue isnt oldValue if angular.isDefined(scope.stroke) and angular.isDefined(scope.stroke.weight) - scope.$watch "stroke.weight", (newValue, oldValue) => - @polyline?.setOptions @buildOpts(@polyline.getPath()) if newValue != oldValue + scope.$watch 'stroke.weight', (newValue, oldValue) => + @polyline?.setOptions @buildOpts(@polyline.getPath()) if newValue isnt oldValue if angular.isDefined(scope.stroke) and angular.isDefined(scope.stroke.color) - scope.$watch "stroke.color", (newValue, oldValue) => - @polyline?.setOptions @buildOpts(@polyline.getPath()) if newValue != oldValue + scope.$watch 'stroke.color', (newValue, oldValue) => + @polyline?.setOptions @buildOpts(@polyline.getPath()) if newValue isnt oldValue if angular.isDefined(scope.stroke) and angular.isDefined(scope.stroke.opacity) - scope.$watch "stroke.opacity", (newValue, oldValue) => - @polyline?.setOptions @buildOpts(@polyline.getPath()) if newValue != oldValue + scope.$watch 'stroke.opacity', (newValue, oldValue) => + @polyline?.setOptions @buildOpts(@polyline.getPath()) if newValue isnt oldValue if angular.isDefined(scope.icons) - scope.$watch "icons", (newValue, oldValue) => - @polyline?.setOptions @buildOpts(@polyline.getPath()) if newValue != oldValue + scope.$watch 'icons', (newValue, oldValue) => + @polyline?.setOptions @buildOpts(@polyline.getPath()) if newValue isnt oldValue # Remove @polyline on scope $destroy - scope.$on "$destroy", => + scope.$on '$destroy', => @clean() @scope = null diff --git a/src/coffee/directives/api/models/child/window-child-model.coffee b/src/coffee/directives/api/models/child/window-child-model.coffee index cb6a9bbec..f3e2e936b 100644 --- a/src/coffee/directives/api/models/child/window-child-model.coffee +++ b/src/coffee/directives/api/models/child/window-child-model.coffee @@ -1,6 +1,6 @@ -angular.module("google-maps.directives.api.models.child".ns()) -.factory "WindowChildModel".ns(), - [ "BaseObject".ns(), "GmapUtil".ns(), "Logger".ns(), "$compile", "$http", "$templateCache", 'uiGmapChromeFixes', +angular.module('uiGmapgoogle-maps.directives.api.models.child') +.factory 'uiGmapWindowChildModel', + ['uiGmapBaseObject', 'uiGmapGmapUtil', 'uiGmapLogger', '$compile', '$http', '$templateCache', 'uiGmapChromeFixes', (BaseObject, GmapUtil, $log, $compile, $http, $templateCache, ChromeFixes) -> class WindowChildModel extends BaseObject @include GmapUtil @@ -20,7 +20,7 @@ angular.module("google-maps.directives.api.models.child".ns()) @watchCoords() @watchAndDoShow() - @scope.$on "$destroy", => + @scope.$on '$destroy', => @destroy() $log.info @ #todo: watch model in here, and recreate / clean gWin on change @@ -39,7 +39,7 @@ angular.module("google-maps.directives.api.models.child".ns()) watchElement: => @scope.$watch => return unless @element or @html - if @html != @element.html() and @gWin + if @html isnt @element.html() and @gWin @opts?.content = undefined @remove() @createGWin() @@ -54,13 +54,13 @@ angular.module("google-maps.directives.api.models.child".ns()) if @element @html = if _.isObject(@element) then @element.html() else @element _opts = if @scope.options then @scope.options else defaults - @opts = @createWindowOptions(@getGmarker(), @markerScope || @scope, @html, _opts) + @opts = @createWindowOptions @getGmarker(), @markerScope or @scope, @html, _opts if @opts? and !@gWin - if @opts.boxClass and (window.InfoBox && typeof window.InfoBox == 'function') - @gWin = new window.InfoBox(@opts) + if @opts.boxClass and (window.InfoBox and typeof window.InfoBox is 'function') + @gWin = new window.InfoBox @opts else - @gWin = new google.maps.InfoWindow(@opts) + @gWin = new google.maps.InfoWindow @opts @handleClick(@scope?.options?.forceClick) @doShow() @@ -73,10 +73,10 @@ angular.module("google-maps.directives.api.models.child".ns()) @getGmarker().setVisible false @getGmarker().setVisible @markerIsVisibleAfterWindowClose , 250 - @gWin.isOpen(false) + @gWin.isOpen false @model.show = false if @scope.closeClick? - @scope.$apply(@scope.closeClick()) + @scope.$apply @scope.closeClick() else #update models state change since it is out of angular scope (closeClick) @scope.$apply() @@ -84,13 +84,13 @@ angular.module("google-maps.directives.api.models.child".ns()) watchCoords: => scope = if @markerScope? then @markerScope else @scope scope.$watch 'coords', (newValue, oldValue) => - if (newValue != oldValue) + if newValue isnt oldValue unless newValue? @hideWindow() - else if !@validateCoords(newValue) + else if !@validateCoords newValue $log.error "WindowChildMarker cannot render marker as scope.coords as no position on marker: #{JSON.stringify @model}" return - pos = @getCoords(newValue) + pos = @getCoords newValue @gWin.setPosition pos @opts.position = pos if @opts , true @@ -98,12 +98,12 @@ angular.module("google-maps.directives.api.models.child".ns()) watchOptions: => #windows and markers options are separate @scope.$watch 'options', (newValue, oldValue) => - if (newValue != oldValue) + if newValue isnt oldValue @opts = newValue if @gWin? - @gWin.setOptions(@opts) + @gWin.setOptions @opts - if @opts.visible? && @opts.visible + if @opts.visible? and @opts.visible @showWindow() else if @opts.visible? @hideWindow() @@ -118,13 +118,13 @@ angular.module("google-maps.directives.api.models.child".ns()) pos = if @scope.coords? then @gWin?.getPosition() else @getGmarker()?.getPosition() return unless pos if @gWin? - @gWin.setPosition(pos) + @gWin.setPosition pos @opts.position = pos if @opts @showWindow() if @getGmarker()? @initialMarkerVisibility = @getGmarker().getVisible() @oldMarkerAnimation = @getGmarker().getAnimation() - @getGmarker().setVisible(@isIconVisibleOnClick) + @getGmarker().setVisible @isIconVisibleOnClick click() if forceClick @@ -136,7 +136,7 @@ angular.module("google-maps.directives.api.models.child".ns()) show = => _.defer => unless @gWin.isOpen() - @gWin.open(@mapCtrl, if @getGmarker() then @getGmarker() else undefined) + @gWin.open @mapCtrl, if @getGmarker() then @getGmarker() else undefined @model.show = @gWin.isOpen() _.defer => ChromeFixes.maybeRepaint @gWin.content @@ -144,18 +144,18 @@ angular.module("google-maps.directives.api.models.child".ns()) if @scope.templateUrl $http.get(@scope.templateUrl, { cache: $templateCache }).then (content) => templateScope = @scope.$new() - if angular.isDefined(@scope.templateParameter) + if angular.isDefined @scope.templateParameter templateScope.parameter = @scope.templateParameter - compiled = $compile(content.data)(templateScope) - @gWin.setContent(compiled[0]) + compiled = $compile(content.data) templateScope + @gWin.setContent compiled[0] show() else if @scope.template templateScope = @scope.$new() if angular.isDefined(@scope.templateParameter) templateScope.parameter = @scope.templateParameter - compiled = $compile(@scope.template)(templateScope) - @gWin.setContent(compiled[0]) + compiled = $compile(@scope.template) templateScope + @gWin.setContent compiled[0] show() else show() diff --git a/src/coffee/directives/api/models/parent/circle-parent-mode.coffee b/src/coffee/directives/api/models/parent/circle-parent-mode.coffee index a1074831c..fae69d0e1 100644 --- a/src/coffee/directives/api/models/parent/circle-parent-mode.coffee +++ b/src/coffee/directives/api/models/parent/circle-parent-mode.coffee @@ -1,18 +1,18 @@ -angular.module("google-maps.directives.api.models.parent".ns()) -.factory "CircleParentModel".ns(), -['Logger'.ns(), '$timeout',"GmapUtil".ns(), -"EventsHelper".ns(), "CircleOptionsBuilder".ns(), +angular.module('uiGmapgoogle-maps.directives.api.models.parent') +.factory 'uiGmapCircleParentModel', +['uiGmapLogger', '$timeout','uiGmapGmapUtil', +'uiGmapEventsHelper', 'uiGmapCircleOptionsBuilder', ($log, $timeout, GmapUtil, EventsHelper, Builder) -> class CircleParentModel extends Builder @include GmapUtil @include EventsHelper constructor: (@scope, element, @attrs, @map, @DEFAULTS) -> circle = - new google.maps.Circle(@buildOpts(GmapUtil.getCoords(scope.center), scope.radius)) + new google.maps.Circle @buildOpts GmapUtil.getCoords(scope.center), scope.radius @setMyOptions = (newVals, oldVals) => unless _.isEqual newVals,oldVals - circle.setOptions @buildOpts(GmapUtil.getCoords(scope.center), scope.radius) + circle.setOptions @buildOpts GmapUtil.getCoords(scope.center), scope.radius @props = @props.concat [ {prop: 'center',isColl: true} @@ -36,8 +36,7 @@ angular.module("google-maps.directives.api.models.parent".ns()) scope.center.latitude = circle.getCenter().lat() scope.center.longitude = circle.getCenter().lng() - # Remove circle on scope $destroy - scope.$on "$destroy", => + scope.$on '$destroy', => @removeEvents listeners circle.setMap null diff --git a/src/coffee/directives/api/models/parent/drawing-manager-parent-model.coffee b/src/coffee/directives/api/models/parent/drawing-manager-parent-model.coffee index 263f6703f..f8aa97e9e 100644 --- a/src/coffee/directives/api/models/parent/drawing-manager-parent-model.coffee +++ b/src/coffee/directives/api/models/parent/drawing-manager-parent-model.coffee @@ -1,23 +1,22 @@ -angular.module("google-maps.directives.api.models.parent".ns()) -.factory "DrawingManagerParentModel".ns(), - ['Logger'.ns(), '$timeout' +angular.module('uiGmapgoogle-maps.directives.api.models.parent') +.factory 'uiGmapDrawingManagerParentModel', + ['uiGmapLogger', '$timeout' ($log, $timeout) -> class DrawingManagerParentModel constructor: (@scope, element, @attrs, @map) -> drawingManager = new google.maps.drawing.DrawingManager @scope.options drawingManager.setMap @map - + if @scope.control? - @scope.control.getDrawingManager = () => + @scope.control.getDrawingManager = -> drawingManager if !@scope.static and @scope.options - @scope.$watch("options", (newValue) => - drawingManager?.setOptions(newValue) - , true) - - # Remove drawingManager on scope $destroy - scope.$on "$destroy", => + @scope.$watch 'options', (newValue) -> + drawingManager?.setOptions newValue + , true + + scope.$on '$destroy', -> drawingManager.setMap null drawingManager = null ] diff --git a/src/coffee/directives/api/models/parent/i-window-parent-model.coffee b/src/coffee/directives/api/models/parent/i-window-parent-model.coffee index 69de101f2..c1ed591e7 100644 --- a/src/coffee/directives/api/models/parent/i-window-parent-model.coffee +++ b/src/coffee/directives/api/models/parent/i-window-parent-model.coffee @@ -1,13 +1,10 @@ -### - - interface directive for all window(s) to derrive from -### -angular.module("google-maps.directives.api.models.parent".ns()) -.factory "IWindowParentModel".ns(), ["ModelKey".ns(), "GmapUtil".ns(), "Logger".ns(), (ModelKey, GmapUtil, Logger) -> +angular.module("uiGmapgoogle-maps.directives.api.models.parent") +.factory "uiGmapIWindowParentModel", ["uiGmapModelKey", "uiGmapGmapUtil", "uiGmapLogger", (ModelKey, GmapUtil, Logger) -> class IWindowParentModel extends ModelKey @include GmapUtil constructor: (scope, element, attrs, ctrls, $timeout, $compile, $http, $templateCache) -> - super(scope) + super scope @$log = Logger @$timeout = $timeout @$compile = $compile @@ -17,4 +14,4 @@ angular.module("google-maps.directives.api.models.parent".ns()) if scope.options? @DEFAULTS = scope.options IWindowParentModel -] \ No newline at end of file +] diff --git a/src/coffee/directives/api/models/parent/layer-parent-model.coffee b/src/coffee/directives/api/models/parent/layer-parent-model.coffee index 4c5f08e72..885b7020e 100644 --- a/src/coffee/directives/api/models/parent/layer-parent-model.coffee +++ b/src/coffee/directives/api/models/parent/layer-parent-model.coffee @@ -1,43 +1,42 @@ -angular.module("google-maps.directives.api.models.parent".ns()) -.factory "LayerParentModel".ns(), ["BaseObject".ns(), "Logger".ns(), '$timeout',(BaseObject, Logger,$timeout) -> - class LayerParentModel extends BaseObject - constructor: (@scope, @element, @attrs, @gMap, @onLayerCreated = undefined, @$log = Logger) -> - unless @attrs.type? - @$log.info("type attribute for the layer directive is mandatory. Layer creation aborted!!") - return - @createGoogleLayer() - @doShow = true +angular.module('uiGmapgoogle-maps.directives.api.models.parent') +.factory 'uiGmapLayerParentModel', ['uiGmapBaseObject', 'uiGmapLogger', '$timeout', (BaseObject, Logger, $timeout) -> + class LayerParentModel extends BaseObject + constructor: (@scope, @element, @attrs, @gMap, @onLayerCreated = undefined, @$log = Logger) -> + unless @attrs.type? + @$log.info 'type attribute for the layer directive is mandatory. Layer creation aborted!!' + return + @createGoogleLayer() + @doShow = true - @doShow = @scope.show if angular.isDefined(@attrs.show) - @layer.setMap @gMap if @doShow and @gMap? - @scope.$watch("show", (newValue, oldValue) => - if newValue isnt oldValue - @doShow = newValue - if newValue - @layer.setMap @gMap - else - @layer.setMap null - , true) - @scope.$watch("options", (newValue, oldValue) => - if newValue isnt oldValue - @layer.setMap null - @layer = null - @createGoogleLayer() - , true) - @scope.$on "$destroy", => - @layer.setMap null + @doShow = @scope.show if angular.isDefined(@attrs.show) + @layer.setMap @gMap if @doShow and @gMap? + @scope.$watch 'show', (newValue, oldValue) => + if newValue isnt oldValue + @doShow = newValue + if newValue + @layer.setMap @gMap + else + @layer.setMap null + , true + @scope.$watch 'options', (newValue, oldValue) => + if newValue isnt oldValue + @layer.setMap null + @layer = null + @createGoogleLayer() + , true - createGoogleLayer: ()=> - unless @attrs.options? - @layer = if @attrs.namespace == undefined then new google.maps[@attrs.type]() - else new google.maps[@attrs.namespace][@attrs.type]() - else - @layer = if@attrs.namespace == undefined then new google.maps[@attrs.type](@scope.options) - else new google.maps[@attrs.namespace][@attrs.type](@scope.options) + @scope.$on '$destroy', => @layer.setMap null - if @layer? and @onLayerCreated? - fn = @onLayerCreated(@scope, @layer) - if fn - fn(@layer) - LayerParentModel + createGoogleLayer: => + unless @attrs.options? + @layer = if @attrs.namespace == undefined then new google.maps[@attrs.type]() + else new google.maps[@attrs.namespace][@attrs.type]() + else + @layer = if @attrs.namespace == undefined then new google.maps[@attrs.type](@scope.options) + else new google.maps[@attrs.namespace][@attrs.type](@scope.options) + + if @layer? and @onLayerCreated? + @onLayerCreated(@scope, @layer)? @layer + + LayerParentModel ] diff --git a/src/coffee/directives/api/options/marker-options.coffee b/src/coffee/directives/api/options/marker-options.coffee index 14dd0c2f5..00f2b1713 100644 --- a/src/coffee/directives/api/options/marker-options.coffee +++ b/src/coffee/directives/api/options/marker-options.coffee @@ -1,29 +1,28 @@ -angular.module("google-maps.directives.api.options".ns()) -.service "MarkerOptions".ns(), -[ "Logger".ns(), "GmapUtil".ns(), ($log, GmapUtil) -> - _.extend GmapUtil, - createOptions: (coords, icon, defaults, map = undefined) -> - defaults = {} unless defaults? +angular.module('uiGmapgoogle-maps.directives.api.options') +.service 'uiGmapMarkerOptions', +[ 'uiGmapLogger', 'uiGmapGmapUtil', ($log, GmapUtil) -> + _.extend GmapUtil, + createOptions: (coords, icon, defaults, map) -> + defaults ?= {} - opts = angular.extend {}, defaults, - position: if defaults.position? then defaults.position else GmapUtil.getCoords(coords), - visible: if defaults.visible? then defaults.visible else GmapUtil.validateCoords(coords) + opts = angular.extend {}, defaults, + position: if defaults.position? then defaults.position else GmapUtil.getCoords coords + visible: if defaults.visible? then defaults.visible else GmapUtil.validateCoords coords - # Only set icon if there's one to set - if defaults.icon? or icon? - opts = angular.extend opts, - icon: if defaults.icon? then defaults.icon else icon + if defaults.icon? or icon? + opts = angular.extend opts, + icon: if defaults.icon? then defaults.icon else icon - opts.map = map if map? - opts + opts.map = map if map? + opts - isLabel:(options) -> - if options.labelContent? or - options.labelAnchor? or - options.labelClass? or - options.labelStyle? or - options.labelVisible? - return true - else false + isLabel: (options) -> + if options.labelContent? or + options.labelAnchor? or + options.labelClass? or + options.labelStyle? or + options.labelVisible? + return true + else false ] diff --git a/src/coffee/directives/api/utils/_async.coffee b/src/coffee/directives/api/utils/_async.coffee index 9cf9de34a..979e5edae 100644 --- a/src/coffee/directives/api/utils/_async.coffee +++ b/src/coffee/directives/api/utils/_async.coffee @@ -1,5 +1,5 @@ angular.module("uiGmapgoogle-maps.directives.api.utils") -.service("_sync".ns(), [ -> +.service("uiGmap_sync", [ -> fakePromise: -> _cb = undefined then: (cb) -> diff --git a/src/coffee/directives/api/utils/fit-helper.coffee b/src/coffee/directives/api/utils/fit-helper.coffee index 31c08b7dd..83c1ba3c1 100644 --- a/src/coffee/directives/api/utils/fit-helper.coffee +++ b/src/coffee/directives/api/utils/fit-helper.coffee @@ -5,7 +5,7 @@ angular.module("google-maps.directives.api.utils".ns()) class FitHelper extends BaseObject fit: (gMarkers, gMap) -> if gMap and gMarkers and gMarkers.length > 0 - bounds = new google.maps.LatLngBounds(); + bounds = new google.maps.LatLngBounds() everSet = false _async.each gMarkers, (gMarker) => if gMarker diff --git a/src/coffee/utils/chrome-fixes.coffee b/src/coffee/utils/chrome-fixes.coffee index 4e20616a0..6c3bd473b 100644 --- a/src/coffee/utils/chrome-fixes.coffee +++ b/src/coffee/utils/chrome-fixes.coffee @@ -1,5 +1,5 @@ -angular.module("google-maps.directives.api.utils".ns()) - .factory "ChromeFixes".ns(), [-> +angular.module("uiGmapgoogle-maps.directives.api.utils") + .factory "uiGmapChromeFixes", [-> maybeRepaint: (el) -> if el od = el.style.display