PageSourceSearch

https://yousurfessaouira.com/wp-content/themes/wprentals/js/infobox.js?ver=1.0

js yousurfessaouira.com collected 2026-09-26 16:44:34 UTC 22,439 bytes, 759 lines download raw bytes

vendor: 22,439 bytes, lines 1-759
1/**
2 * @name InfoBox
3 * @version 1.1.5 [March 1, 2011]
4 * @author Gary Little (inspired by proof-of-concept code from Pamela Fox of Google)
5 * @copyright Copyright 2010 Gary Little [gary at luxcentral.com]
6 * @fileoverview InfoBox extends the Google Maps JavaScript API V3 <tt>OverlayView</tt> class.
7 *  <p>
8 *  An InfoBox behaves like a <tt>google.maps.InfoWindow</tt>, but it supports several
9 *  additional properties for advanced styling. An InfoBox can also be used as a map label.
10 *  <p>
11 *  An InfoBox also fires the same events as a <tt>google.maps.InfoWindow</tt>.
12 *  <p>
13 *  Browsers tested:
14 *  <p>
15 *  Mac -- Safari (4.0.4), Firefox (3.6), Opera (10.10), Chrome (4.0.249.43), OmniWeb (5.10.1)
16 *  <br>
17 *  Win -- Safari, Firefox, Opera, Chrome (3.0.195.38), Internet Explorer (8.0.6001.18702)
18 *  <br>
19 *  iPod Touch/iPhone -- Safari (3.1.2)
20 */
21
22/*!
23 *
24 * Licensed under the Apache License, Version 2.0 (the "License");
25 * you may not use this file except in compliance with the License.
26 * You may obtain a copy of the License at
27 *
28 *       http://www.apache.org/licenses/LICENSE-2.0
29 *
30 * Unless required by applicable law or agreed to in writing, software
31 * distributed under the License is distributed on an "AS IS" BASIS,
32 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33 * See the License for the specific language governing permissions and
34 * limitations under the License.
35 */
36
37/*jslint browser:true */
38/*global google */
39
40/**
41 * @name InfoBoxOptions
42 * @class This class represents the optional parameter passed to the {@link InfoBox} constructor.
43 * @property {string|Node} content The content of the InfoBox (plain text or an HTML DOM node).
44 * @property {boolean} disableAutoPan Disable auto-pan on <tt>open</tt> (default is <tt>false</tt>).
45 * @property {number} maxWidth The maximum width (in pixels) of the InfoBox. Set to 0 if no maximum.
46 * @property {Size} pixelOffset The offset (in pixels) from the top left corner of the InfoBox
47 *  (or the bottom left corner if the <code>alignBottom</code> property is <code>true</code>)
48 *  to the map pixel corresponding to <tt>position</tt>.
49 * @property {LatLng} position The geographic location at which to display the InfoBox.
50 * @property {number} zIndex The CSS z-index style value for the InfoBox.
51 *  Note: This value overrides a zIndex setting specified in the <tt>boxStyle</tt> property.
52 * @property {string} boxClass The name of the CSS class defining the styles for the InfoBox container.
53 *  The default name is <code>infoBox</code>.
54 * @property {Object} [boxStyle] An object literal whose properties define specific CSS
55 *  style values to be applied to the InfoBox. Style values defined here override those that may
56 *  be defined in the <code>boxClass</code> style sheet. If this property is changed after the
57 *  InfoBox has been created, all previously set styles (except those defined in the style sheet)
58 *  are removed from the InfoBox before the new style values are applied.
59 * @property {string} closeBoxMargin The CSS margin style value for the close box.
60 *  The default is "2px" (a 2-pixel margin on all sides).
61 * @property {string} closeBoxURL The URL of the image representing the close box.
62 *  Note: The default is the URL for Google's standard close box.
63 *  Set this property to "" if no close box is required.
64 * @property {Size} infoBoxClearance Minimum offset (in pixels) from the InfoBox to the
65 *  map edge after an auto-pan.
66 * @property {boolean} isHidden Hide the InfoBox on <tt>open</tt> (default is <tt>false</tt>).
67 * @property {boolean} alignBottom Align the bottom left corner of the InfoBox to the <code>position</code>
68 *  location (default is <tt>false</tt> which means that the top left corner of the InfoBox is aligned).
69 * @property {string} pane The pane where the InfoBox is to appear (default is "floatPane").
70 *  Set the pane to "mapPane" if the InfoBox is being used as a map label.
71 *  Valid pane names are the property names for the <tt>google.maps.MapPanes</tt> object.
72 * @property {boolean} enableEventPropagation Propagate mousedown, click, dblclick,
73 *  and contextmenu events in the InfoBox (default is <tt>false</tt> to mimic the behavior
74 *  of a <tt>google.maps.InfoWindow</tt>). Set this property to <tt>true</tt> if the InfoBox
75 *  is being used as a map label. iPhone note: This property setting has no effect; events are
76 *  always propagated.
77 */
78
79/**
80 * Creates an InfoBox with the options specified in {@link InfoBoxOptions}.
81 *  Call <tt>InfoBox.open</tt> to add the box to the map.
82 * @constructor
83 * @param {InfoBoxOptions} [opt_opts]
84 */
85function InfoBox(opt_opts) {
86
87  opt_opts = opt_opts || {};
88
89  google.maps.OverlayView.apply(this, arguments);
90
91  // Standard options (in common with google.maps.InfoWindow):
92  //
93  this.content_ = opt_opts.content || "";
94  this.disableAutoPan_ = opt_opts.disableAutoPan || false;
95  this.maxWidth_ = opt_opts.maxWidth || 0;
96  this.pixelOffset_ = opt_opts.pixelOffset || new google.maps.Size(0, 0);
97  this.position_ = opt_opts.position || new google.maps.LatLng(0, 0);
98  this.zIndex_ = opt_opts.zIndex || null;
99
100  // Additional options (unique to InfoBox):
101  //
102  this.boxClass_ = opt_opts.boxClass || "infoBox";
103  this.boxStyle_ = opt_opts.boxStyle || {};
104  this.closeBoxMargin_ = opt_opts.closeBoxMargin || "2px";
105  this.closeBoxURL_ = opt_opts.closeBoxURL || "http://www.google.com/intl/en_us/mapfiles/close.gif";
106  if (opt_opts.closeBoxURL === "") {
107    this.closeBoxURL_ = "";
108  }
109  this.infoBoxClearance_ = opt_opts.infoBoxClearance || new google.maps.Size(1, 1);
110  this.isHidden_ = opt_opts.isHidden || false;
111  this.alignBottom_ = opt_opts.alignBottom || false;
112  this.pane_ = opt_opts.pane || "floatPane";
113  this.enableEventPropagation_ = opt_opts.enableEventPropagation || false;
114
115  this.div_ = null;
116  this.closeListener_ = null;
117  this.eventListener1_ = null;
118  this.eventListener2_ = null;
119  this.eventListener3_ = null;
120  this.moveListener_ = null;
121  this.contextListener_ = null;
122  this.fixedWidthSet_ = null;
123}
124
125/* InfoBox extends OverlayView in the Google Maps API v3.
126 */
127InfoBox.prototype = new google.maps.OverlayView();
128
129/**
130 * Creates the DIV representing the InfoBox.
131 * @private
132 */
133InfoBox.prototype.createInfoBoxDiv_ = function () {
134
135  var bw;
136  var me = this;
137
138  // This handler prevents an event in the InfoBox from being passed on to the map.
139  //
140  var cancelHandler = function (e) {
141    e.cancelBubble = true;
142
143    if (e.stopPropagation) {
144
145      e.stopPropagation();
146    }
147  };
148
149  // This handler ignores the current event in the InfoBox and conditionally prevents
150  // the event from being passed on to the map. It is used for the contextmenu event.
151  //
152  var ignoreHandler = function (e) {
153
154    e.returnValue = false;
155
156    if (e.preventDefault) {
157
158      e.preventDefault();
159    }
160
161    if (!me.enableEventPropagation_) {
162
163      cancelHandler(e);
164    }
165  };
166
167  if (!this.div_) {
168
169    this.div_ = document.createElement("div");
170
171    this.setBoxStyle_();
172
173    if (typeof this.content_.nodeType === "undefined") {
174      this.div_.innerHTML = this.getCloseBoxImg_() + this.content_;
175    } else {
176      this.div_.innerHTML = this.getCloseBoxImg_();
177      this.div_.appendChild(this.content_);
178    }
179
180    // Add the InfoBox DIV to the DOM
181    this.getPanes()[this.pane_].appendChild(this.div_);
182
183    this.addClickHandler_();
184
185    if (this.div_.style.width) {
186
187      this.fixedWidthSet_ = true;
188
189    } else {
190
191      if (this.maxWidth_ !== 0 && this.div_.offsetWidth > this.maxWidth_) {
192
193        this.div_.style.width = this.maxWidth_;
194        this.div_.style.overflow = "auto";
195        this.fixedWidthSet_ = true;
196
197      } else { // The following code is needed to overcome problems with MSIE
198
199        bw = this.getBoxWidths_();
200
201        this.div_.style.width = (this.div_.offsetWidth - bw.left - bw.right) + "px";
202        this.fixedWidthSet_ = false;
203      }
204    }
205
206    this.panBox_(this.disableAutoPan_);
207
208    if (!this.enableEventPropagation_) {
209
210      // Cancel event propagation.
211      //
212      this.eventListener1_ = google.maps.event.addDomListener(this.div_, "mousedown", cancelHandler);
213      this.eventListener2_ = google.maps.event.addDomListener(this.div_, "click", cancelHandler);
214      this.eventListener3_ = google.maps.event.addDomListener(this.div_, "dblclick", cancelHandler);
215    }
216
217    this.contextListener_ = google.maps.event.addDomListener(this.div_, "contextmenu", ignoreHandler);
218
219    /**
220     * This event is fired when the DIV containing the InfoBox's content is attached to the DOM.
221     * @name InfoBox#domready
222     * @event
223     */
224    google.maps.event.trigger(this, "domready");
225  }
226};
227
228/**
229 * Returns the HTML <IMG> tag for the close box.
230 * @private
231 */
232InfoBox.prototype.getCloseBoxImg_ = function () {
233
234  var img = "";
235
236  if (this.closeBoxURL_ !== "") {
237
238    img  = "<img";
239    img += " src='" + this.closeBoxURL_ + "'";
240    img += " align=right"; // Do this because Opera chokes on style='float: right;'
241    img += " style='";
242    img += " position: relative;"; // Required by MSIE
243    img += " cursor: pointer;";
244    img += " margin: " + this.closeBoxMargin_ + ";";
245    img += "'>";
246  }
247
248  return img;
249};
250
251/**
252 * Adds the click handler to the InfoBox close box.
253 * @private
254 */
255InfoBox.prototype.addClickHandler_ = function () {
256
257  var closeBox;
258
259  if (this.closeBoxURL_ !== "") {
260
261    closeBox = this.div_.firstChild;
262    this.closeListener_ = google.maps.event.addDomListener(closeBox, 'click', this.getCloseClickHandler_());
263
264  } else {
265
266    this.closeListener_ = null;
267  }
268};
269
270/**
271 * Returns the function to call when the user clicks the close box of an InfoBox.
272 * @private
273 */
274InfoBox.prototype.getCloseClickHandler_ = function () {
275
276  var me = this;
277
278  return function (e) {
279
280    // 1.0.3 fix: Always prevent propagation of a close box click to the map:
281    e.cancelBubble = true;
282
283    if (e.stopPropagation) {
284
285      e.stopPropagation();
286    }
287
288    me.close();
289
290    /**
291     * This event is fired when the InfoBox's close box is clicked.
292     * @name InfoBox#closeclick
293     * @event
294     */
295    google.maps.event.trigger(me, "closeclick");
296  };
297};
298
299/**
300 * Pans the map so that the InfoBox appears entirely within the map's visible area.
301 * @private
302 */
303InfoBox.prototype.panBox_ = function (disablePan) {
304
305  var map;
306  var bounds;
307  var xOffset = 0, yOffset = 0;
308
309  if (!disablePan) {
310
311    map = this.getMap();
312
313    if (map instanceof google.maps.Map) { // Only pan if attached to map, not panorama
314
315      if (!map.getBounds().contains(this.position_)) {
316      // Marker not in visible area of map, so set center
317      // of map to the marker position first.
318        map.setCenter(this.position_);
319      }
320
321      bounds = map.getBounds();
322
323      var mapDiv = map.getDiv();
324      var mapWidth = mapDiv.offsetWidth;
325      var mapHeight = mapDiv.offsetHeight;
326      var iwOffsetX = this.pixelOffset_.width;
327      var iwOffsetY = this.pixelOffset_.height;
328      var iwWidth = this.div_.offsetWidth;
329      var iwHeight = this.div_.offsetHeight;
330      var padX = this.infoBoxClearance_.width;
331      var padY = this.infoBoxClearance_.height;
332      var pixPosition = this.getProjection().fromLatLngToContainerPixel(this.position_);
333
334      if (pixPosition.x < (-iwOffsetX + padX)) {
335        xOffset = pixPosition.x + iwOffsetX - padX;
336      } else if ((pixPosition.x + iwWidth + iwOffsetX + padX) > mapWidth) {
337        xOffset = pixPosition.x + iwWidth + iwOffsetX + padX - mapWidth;
338      }
339      if (this.alignBottom_) {
340        if (pixPosition.y < (-iwOffsetY + padY + iwHeight)) {
341          yOffset = pixPosition.y + iwOffsetY - padY - iwHeight;
342        } else if ((pixPosition.y + iwOffsetY + padY) > mapHeight) {
343          yOffset = pixPosition.y + iwOffsetY + padY - mapHeight;
344        }
345      } else {
346        if (pixPosition.y < (-iwOffsetY + padY)) {
347          yOffset = pixPosition.y + iwOffsetY - padY;
348        } else if ((pixPosition.y + iwHeight + iwOffsetY + padY) > mapHeight) {
349          yOffset = pixPosition.y + iwHeight + iwOffsetY + padY - mapHeight;
350        }
351      }
352
353      if (!(xOffset === 0 && yOffset === 0)) {
354
355        // Move the map to the shifted center.
356        //
357        var c = map.getCenter();
358        map.panBy(xOffset, yOffset);
359      }
360    }
361  }
362};
363
364/**
365 * Sets the style of the InfoBox by setting the style sheet and applying
366 * other specific styles requested.
367 * @private
368 */
369InfoBox.prototype.setBoxStyle_ = function () {
370
371  var i, boxStyle;
372
373  if (this.div_) {
374
375    // Apply style values from the style sheet defined in the boxClass parameter:
376    this.div_.className = this.boxClass_;
377
378    // Clear existing inline style values:
379    this.div_.style.cssText = "";
380
381    // Apply style values defined in the boxStyle parameter:
382    boxStyle = this.boxStyle_;
383    for (i in boxStyle) {
384
385      if (boxStyle.hasOwnProperty(i)) {
386
387        this.div_.style[i] = boxStyle[i];
388      }
389    }
390
391    // Fix up opacity style for benefit of MSIE:
392    //
393    if (typeof this.div_.style.opacity !== "undefined" && this.div_.style.opacity !== "") {
394
395      this.div_.style.filter = "alpha(opacity=" + (this.div_.style.opacity * 100) + ")";
396    }
397
398    // Apply required styles:
399    //
400    this.div_.style.position = "absolute";
401    this.div_.style.visibility = 'hidden';
402    if (this.zIndex_ !== null) {
403
404      this.div_.style.zIndex = this.zIndex_;
405    }
406  }
407};
408
409/**
410 * Get the widths of the borders of the InfoBox.
411 * @private
412 * @return {Object} widths object (top, bottom left, right)
413 */
414InfoBox.prototype.getBoxWidths_ = function () {
415
416  var computedStyle;
417  var bw = {top: 0, bottom: 0, left: 0, right: 0};
418  var box = this.div_;
419
420  if (document.defaultView && document.defaultView.getComputedStyle) {
421
422    computedStyle = box.ownerDocument.defaultView.getComputedStyle(box, "");
423
424    if (computedStyle) {
425
426      // The computed styles are always in pixel units (good!)
427      bw.top = parseInt(computedStyle.borderTopWidth, 10) || 0;
428      bw.bottom = parseInt(computedStyle.borderBottomWidth, 10) || 0;
429      bw.left = parseInt(computedStyle.borderLeftWidth, 10) || 0;
430      bw.right = parseInt(computedStyle.borderRightWidth, 10) || 0;
431    }
432
433  } else if (document.documentElement.currentStyle) { // MSIE
434
435    if (box.currentStyle) {
436
437      // The current styles may not be in pixel units, but assume they are (bad!)
438      bw.top = parseInt(box.currentStyle.borderTopWidth, 10) || 0;
439      bw.bottom = parseInt(box.currentStyle.borderBottomWidth, 10) || 0;
440      bw.left = parseInt(box.currentStyle.borderLeftWidth, 10) || 0;
441      bw.right = parseInt(box.currentStyle.borderRightWidth, 10) || 0;
442    }
443  }
444
445  return bw;
446};
447
448/**
449 * Invoked when <tt>close</tt> is called. Do not call it directly.
450 */
451InfoBox.prototype.onRemove = function () {
452
453  if (this.div_) {
454
455    this.div_.parentNode.removeChild(this.div_);
456    this.div_ = null;
457  }
458};
459
460/**
461 * Draws the InfoBox based on the current map projection and zoom level.
462 */
463InfoBox.prototype.draw = function () {
464
465  this.createInfoBoxDiv_();
466
467  var pixPosition = this.getProjection().fromLatLngToDivPixel(this.position_);
468
469  this.div_.style.left = (pixPosition.x + this.pixelOffset_.width) + "px";
470  
471  if (this.alignBottom_) {
472    this.div_.style.bottom = -(pixPosition.y + this.pixelOffset_.height) + "px";
473  } else {
474    this.div_.style.top = (pixPosition.y + this.pixelOffset_.height) + "px";
475  }
476
477  if (this.isHidden_) {
478
479    this.div_.style.visibility = 'hidden';
480
481  } else {
482
483    this.div_.style.visibility = "visible";
484  }
485};
486
487/**
488 * Sets the options for the InfoBox. Note that changes to the <tt>maxWidth</tt>,
489 *  <tt>closeBoxMargin</tt>, <tt>closeBoxURL</tt>, and <tt>enableEventPropagation</tt>
490 *  properties have no affect until the current InfoBox is <tt>close</tt>d and a new one
491 *  is <tt>open</tt>ed.
492 * @param {InfoBoxOptions} opt_opts
493 */
494InfoBox.prototype.setOptions = function (opt_opts) {
495  if (typeof opt_opts.boxClass !== "undefined") { // Must be first
496
497    this.boxClass_ = opt_opts.boxClass;
498    this.setBoxStyle_();
499  }
500  if (typeof opt_opts.boxStyle !== "undefined") { // Must be second
501
502    this.boxStyle_ = opt_opts.boxStyle;
503    this.setBoxStyle_();
504  }
505  if (typeof opt_opts.content !== "undefined") {
506
507    this.setContent(opt_opts.content);
508  }
509  if (typeof opt_opts.disableAutoPan !== "undefined") {
510
511    this.disableAutoPan_ = opt_opts.disableAutoPan;
512  }
513  if (typeof opt_opts.maxWidth !== "undefined") {
514
515    this.maxWidth_ = opt_opts.maxWidth;
516  }
517  if (typeof opt_opts.pixelOffset !== "undefined") {
518
519    this.pixelOffset_ = opt_opts.pixelOffset;
520  }
521  if (typeof opt_opts.position !== "undefined") {
522
523    this.setPosition(opt_opts.position);
524  }
525  if (typeof opt_opts.zIndex !== "undefined") {
526
527    this.setZIndex(opt_opts.zIndex);
528  }
529  if (typeof opt_opts.closeBoxMargin !== "undefined") {
530
531    this.closeBoxMargin_ = opt_opts.closeBoxMargin;
532  }
533  if (typeof opt_opts.closeBoxURL !== "undefined") {
534
535    this.closeBoxURL_ = opt_opts.closeBoxURL;
536  }
537  if (typeof opt_opts.infoBoxClearance !== "undefined") {
538
539    this.infoBoxClearance_ = opt_opts.infoBoxClearance;
540  }
541  if (typeof opt_opts.isHidden !== "undefined") {
542
543    this.isHidden_ = opt_opts.isHidden;
544  }
545  if (typeof opt_opts.enableEventPropagation !== "undefined") {
546
547    this.enableEventPropagation_ = opt_opts.enableEventPropagation;
548  }
549
550  if (this.div_) {
551
552    this.draw();
553  }
554};
555
556/**
557 * Sets the content of the InfoBox.
558 *  The content can be plain text or an HTML DOM node.
559 * @param {string|Node} content
560 */
561InfoBox.prototype.setContent = function (content) {
562  this.content_ = content;
563
564  if (this.div_) {
565
566    if (this.closeListener_) {
567
568      google.maps.event.removeListener(this.closeListener_);
569      this.closeListener_ = null;
570    }
571
572    // Odd code required to make things work with MSIE.
573    //
574    if (!this.fixedWidthSet_) {
575
576      this.div_.style.width = "";
577    }
578
579    if (typeof content.nodeType === "undefined") {
580      this.div_.innerHTML = this.getCloseBoxImg_() + content;
581    } else {
582      this.div_.innerHTML = this.getCloseBoxImg_();
583      this.div_.appendChild(content);
584    }
585
586    // Perverse code required to make things work with MSIE.
587    // (Ensures the close box does, in fact, float to the right.)
588    //
589    if (!this.fixedWidthSet_) {
590
591      this.div_.style.width = this.div_.offsetWidth + "px";
592      this.div_.innerHTML = this.getCloseBoxImg_() + content;
593    }
594
595    this.addClickHandler_();
596  }
597
598  /**
599   * This event is fired when the content of the InfoBox changes.
600   * @name InfoBox#content_changed
601   * @event
602   */
603  google.maps.event.trigger(this, "content_changed");
604};
605
606/**
607 * Sets the geographic location of the InfoBox.
608 * @param {LatLng} latlng
609 */
610InfoBox.prototype.setPosition = function (latlng) {
611
612  this.position_ = latlng;
613
614  if (this.div_) {
615
616    this.draw();
617  }
618
619  /**
620   * This event is fired when the position of the InfoBox changes.
621   * @name InfoBox#position_changed
622   * @event
623   */
624  google.maps.event.trigger(this, "position_changed");
625};
626
627/**
628 * Sets the zIndex style for the InfoBox.
629 * @param {number} index
630 */
631InfoBox.prototype.setZIndex = function (index) {
632
633  this.zIndex_ = index;
634
635  if (this.div_) {
636
637    this.div_.style.zIndex = index;
638  }
639
640  /**
641   * This event is fired when the zIndex of the InfoBox changes.
642   * @name InfoBox#zindex_changed
643   * @event
644   */
645  google.maps.event.trigger(this, "zindex_changed");
646};
647
648/**
649 * Returns the content of the InfoBox.
650 * @returns {string}
651 */
652InfoBox.prototype.getContent = function () {
653
654  return this.content_;
655};
656
657/**
658 * Returns the geographic location of the InfoBox.
659 * @returns {LatLng}
660 */
661InfoBox.prototype.getPosition = function () {
662
663  return this.position_;
664};
665
666/**
667 * Returns the zIndex for the InfoBox.
668 * @returns {number}
669 */
670InfoBox.prototype.getZIndex = function () {
671
672  return this.zIndex_;
673};
674
675/**
676 * Shows the InfoBox.
677 */
678InfoBox.prototype.show = function () {
679
680  this.isHidden_ = false;
681  if (this.div_) {
682    this.div_.style.visibility = "visible";
683  }
684};
685
686/**
687 * Hides the InfoBox.
688 */
689InfoBox.prototype.hide = function () {
690
691  this.isHidden_ = true;
692  if (this.div_) {
693    this.div_.style.visibility = "hidden";
694  }
695};
696
697/**
698 * Adds the InfoBox to the specified map or Street View panorama. If <tt>anchor</tt>
699 *  (usually a <tt>google.maps.Marker</tt>) is specified, the position
700 *  of the InfoBox is set to the position of the <tt>anchor</tt>. If the
701 *  anchor is dragged to a new location, the InfoBox moves as well.
702 * @param {Map|StreetViewPanorama} map
703 * @param {MVCObject} [anchor]
704 */
705InfoBox.prototype.open = function (map, anchor) {
706
707  var me = this;
708
709  if (anchor) {
710
711    this.position_ = anchor.getPosition();
712    this.moveListener_ = google.maps.event.addListener(anchor, "position_changed", function () {
713      me.setPosition(this.getPosition());
714    });
715  }
716
717  this.setMap(map);
718
719  if (this.div_) {
720
721    this.panBox_();
722  }
723};
724
725/**
726 * Removes the InfoBox from the map.
727 */
728InfoBox.prototype.close = function () {
729
730  if (this.closeListener_) {
731
732    google.maps.event.removeListener(this.closeListener_);
733    this.closeListener_ = null;
734  }
735
736  if (this.eventListener1_) {
737
738    google.maps.event.removeListener(this.eventListener1_);
739    google.maps.event.removeListener(this.eventListener2_);
740    google.maps.event.removeListener(this.eventListener3_);
741    this.eventListener1_ = null;
742    this.eventListener2_ = null;
743    this.eventListener3_ = null;
744  }
745
746  if (this.moveListener_) {
747
748    google.maps.event.removeListener(this.moveListener_);
749    this.moveListener_ = null;
750  }
751
752  if (this.contextListener_) {
753
754    google.maps.event.removeListener(this.contextListener_);
755    this.contextListener_ = null;
756  }
757
758  this.setMap(null);
759};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.