PageRenderTime 69ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 1ms

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

https://github.com/IBM-Bluemix/bluemix-retail
JavaScript | 8131 lines | 5539 code | 912 blank | 1680 comment | 1237 complexity | f181de0b80499e1d68469cc3f32e2b3c MD5 | raw file
Possible License(s): Apache-2.0

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

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

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