Manages the infowindows for a map. It listens to events triggered by a
CartoDBLayerGroupView and updates models accordingly
163764
function (deps, options) {
  deps = deps || {};
  options = options || {};
  if (!deps.engine) throw new Error('engine is required');
  if (!deps.mapModel) throw new Error('mapModel is required');
  if (!deps.infowindowModel) throw new Error('infowindowModel is required');
  if (!deps.tooltipModel) throw new Error('tooltipModel is required');

  this._engine = deps.engine;
  this._mapModel = deps.mapModel;
  this._infowindowModel = deps.infowindowModel;
  this._tooltipModel = deps.tooltipModel;
  this._showEmptyFields = !!options.showEmptyFields;

  this._cartoDBLayerGroupView = null;
  this._cartoDBLayerModel = null;
  this.currentFeatureUniqueId = null;

  this._mapModel.on('change:popupsEnabled', this._onPopupsEnabledChanged, this);
}
614085
function CartoDBSubLayer(layer, position) {
  SubLayerBase.call(this, layer, position);
  this._bindInteraction();

  var layer = this._parent.getLayer(this._position);
  // TODO: Test this
  if (Backbone.Model && layer) {
    this.infowindow = new Backbone.Model(layer.infowindow);
    this.infowindow.bind('change', function() {
      layer.infowindow = this.infowindow.toJSON();
      this._parent.setLayer(this._position, layer);
    }, this);
  }
}
163170
private function renderInfoWindow(Map $map, InfoWindow $infoWindow, $position = true)
    {
        return $this->getFormatter()->renderContainerAssignment(
            $map,
            $this->infoWindowRenderer->render($infoWindow, $position),
            'overlays.info_windows',
            $infoWindow
        );
    }
398676
public void setEventCategoriesMapList(java.util.Collection<EventCategoriesMap> eventCategoriesMapList) {
        if (eventCategoriesMapList == null) {
            this.eventCategoriesMapList = null;
            return;
        }

        this.eventCategoriesMapList = new java.util.ArrayList<EventCategoriesMap>(eventCategoriesMapList);
    }
463460
def OnClickRelease( self, event ):
        """"""
        node = HotMapNavigator.findNodeAtPosition(self.hot_map, event.GetPosition())
        self.SetSelected( node, event.GetPosition() )
954474
private void registerMap(final MapWidget mapWidget) {
		if (mapWidget != null) {
			onLoadRegistration = mapWidget.getMapModel().addMapModelHandler(new MapModelHandler() {

				public void onMapModelChange(MapModelEvent event) {
					onLoadRegistration.removeHandler();
					view.onLoadStart();
					if (GwtCommandDispatcher.getInstance().isBusy()) {
						onDispatchStopRegistration = GwtCommandDispatcher.getInstance().addDispatchStoppedHandler(
								new DispatchStoppedHandler() {

									public void onDispatchStopped(DispatchStoppedEvent event) {
										fadeOut(mapWidget);
									}
								});
					} else {
						fadeOut(mapWidget);
					}
				}
			});
		}
	}
1167253
public static void closeAllInfoWindowsOn(MapView mapView) {
        ArrayList<InfoWindow> opened = getOpenedInfoWindowsOn(mapView);
        for (InfoWindow infoWindow : opened) {
            infoWindow.close();
        }
    }
140860
function (marker, location, infowindow, storeStart, page) {
			this.writeDebug('createInfowindow',arguments);
			var _this = this;
			// Define the location data
			var locations = this._defineLocationData(marker, storeStart, page);

			// Set up the infowindow template with the location data
			var formattedAddress = infowindowTemplate(locations);

			// Opens the infowindow when list item is clicked
			if (location === 'left') {
				infowindow.setContent(formattedAddress);
				infowindow.open(marker.get('map'), marker);
			}
			// Opens the infowindow when the marker is clicked
			else {
				google.maps.event.addListener(marker, 'click', function () {
					infowindow.setContent(formattedAddress);
					infowindow.open(marker.get('map'), marker);
					// Focus on the list
					var markerId = marker.get('id');
					var $selectedLocation = $('.' + _this.settings.locationList + ' li[data-markerid=' + markerId + ']');

					if ($selectedLocation.length > 0) {
						// Marker click callback
						if (_this.settings.callbackMarkerClick) {
							_this.settings.callbackMarkerClick.call(this, marker, markerId, $selectedLocation, locationset[markerId]);
						}

						$('.' + _this.settings.locationList + ' li').removeClass('list-focus');
						$selectedLocation.addClass('list-focus');

						// Scroll list to selected marker
						var $container = $('.' + _this.settings.locationList);
						$container.animate({
							scrollTop: $selectedLocation.offset().top - $container.offset().top + $container.scrollTop()
						});
					}

					// Custom selected marker override
					if (_this.settings.selectedMarkerImg !== null) {
						_this.changeSelectedMarker(marker);
					}
				});
			}
		}
1071366
@Override
	public void onDetach(MapView mapView) {
		BitmapPool.getInstance().asyncRecycle(mIcon);
		mIcon=null;
		BitmapPool.getInstance().asyncRecycle(mImage);
		//cleanDefaults();
		this.mOnMarkerClickListener=null;
		this.mOnMarkerDragListener=null;
		this.mResources=null;
		setRelatedObject(null);
		if (isInfoWindowShown())
			closeInfoWindow();
		//	//if we're using the shared info window, this will cause all instances to close

		mMapViewRepository = null;
		setInfoWindow(null);
		onDestroy();


        super.onDetach(mapView);
    }
1373888
function() {

    if(this.template) {

      // If there is content, destroy the jscrollpane first, then remove the content.
      var $jscrollpane = this.$(".cartodb-popup-content");
      if ($jscrollpane.length > 0 && $jscrollpane.data() != null) {
        $jscrollpane.data().jsp && $jscrollpane.data().jsp.destroy();
      }

      // Clone fields and template name
      var fields = _.map(this.model.attributes.content.fields, function(field){
        return _.clone(field);
      });
      var data = this.model.get('content') ? this.model.get('content').data : {};

      // If a custom template is not applied, let's sanitized
      // fields for the template rendering
      if (this.model.get('template_name')) {
        var template_name = _.clone(this.model.attributes.template_name);

        // Sanitized them
        fields = this._fieldsToString(fields, template_name);
      }

      // Join plan fields values with content to work with
      // custom infowindows and CartoDB infowindows.
      var values = {};
      _.each(this.model.get('content').fields, function(pair) {
        values[pair.title] = pair.value;
      })

      var obj = _.extend({
          content: {
            fields: fields,
            data: data
          }
        },values);

      this.$el.html(
        cdb.core.sanitize.html(this.template(obj), this.model.get('sanitizeTemplate'))
      );

      // Set width and max-height from the model only
      // If there is no width set, we don't force our infowindow
      if (this.model.get('width')) {
        this.$('.cartodb-popup').css('width', this.model.get('width') + 'px');
      }
      this.$('.cartodb-popup .cartodb-popup-content').css('max-height', this.model.get('maxHeight') + 'px');

      // Hello jscrollpane hacks!
      // It needs some time to initialize, if not it doesn't render properly the fields
      // Check the height of the content + the header if exists
      var self = this;
      setTimeout(function() {
        var actual_height = self.$(".cartodb-popup-content").outerHeight();
        if (self.model.get('maxHeight') <= actual_height)
          self.$(".cartodb-popup-content").jScrollPane({
            verticalDragMinHeight: 20,
            autoReinitialise: true
          });
      }, 1);

      // If the infowindow is loading, show spin
      this._checkLoading();

      // If the template is 'cover-enabled', load the cover
      this._loadCover();

      if(!this.isLoadingData()) {
        this.model.trigger('domready', this, this.$el);
        this.trigger('domready', this, this.$el);
      }
    }

    return this;
  }
162133
function(map) {
        this.map = map;
        this.cache = {};
        map.events.register("mousedown", this, this.start, {extension: true});
        map.events.register("mouseup", this, this.onClick, {extension: true});
        map.events.register("touchstart", this, this.start, {extension: true});
        map.events.register("touchmove", this, this.cancel, {extension: true});
        map.events.register("touchend", this, this.onClick, {extension: true});
        map.events.register("mousemove", this, this.onMousemove, {extension: true});
    }
130567
public void show() {
        if (isShowing) {
            Log.w("AlertWindow", "AlertWindow is already displayed.");
        } else {
            isShowing = true;
            mWindowManager.addView(mContentView, mParams);
        }
    }
607742
function(map) {
    var self = this;
    this.options.map = map;

    // Add cartodb logo
    if (this.options.cartodb_logo != false)
      cdb.geo.common.CartoDBLogo.addWadus({ left:8, bottom:8 }, 0, map._container);

    this.__update(function() {
      // if while the layer was processed in the server is removed
      // it should not be added to the map
      var id = L.stamp(self);
      if (!map._layers[id]) {
        return;
      }

      L.TileLayer.prototype.onAdd.call(self, map);
      self.fire('added');
      self.options.added = true;
    });
  }
939704
function(layerModel, gmapsMap) {
  var self = this;

  _.bindAll(this, 'featureOut', 'featureOver', 'featureClick');

  var opts = _.clone(layerModel.attributes);

  opts.map =  gmapsMap;

  var // preserve the user's callbacks
  _featureOver  = opts.featureOver,
  _featureOut   = opts.featureOut,
  _featureClick = opts.featureClick;

  opts.featureOver  = function() {
    _featureOver  && _featureOver.apply(this, arguments);
    self.featureOver  && self.featureOver.apply(this, arguments);
  };

  opts.featureOut  = function() {
    _featureOut  && _featureOut.apply(this, arguments);
    self.featureOut  && self.featureOut.apply(this, arguments);
  };

  opts.featureClick  = function() {
    _featureClick  && _featureClick.apply(this, arguments);
    self.featureClick  && self.featureClick.apply(opts, arguments);
  };

  cdb.geo.CartoDBLayerGMaps.call(this, opts);
  cdb.geo.GMapsLayerView.call(this, layerModel, this, gmapsMap);
}
407133
function() {
        // workaround for resizing of invisible or not yet fully loaded layers
        // where GMap2.checkResize() does not work. We need to load the GMap
        // for the old div size, then checkResize(), and then call
        // layer.moveTo() to trigger GMap.setCenter() (which will finish
        // the GMap initialization).
        if(this.visibility && this.mapObject.isLoaded()) {
            this.mapObject.checkResize();
        } else {
            if(!this._resized) {
                var layer = this;
                var handle = GEvent.addListener(this.mapObject, "load", function() {
                    GEvent.removeListener(handle);
                    delete layer._resized;
                    layer.mapObject.checkResize();
                    layer.moveTo(layer.map.getCenter(), layer.map.getZoom());
                });
            }
            this._resized = true;
        }
    }
961428
public function render(InfoWindow $infoWindow, Map $map, Marker $marker = null)
    {
        $arguments = [$map->getVariable()];

        if ($marker !== null) {
            $arguments[] = $marker->getVariable();
        }

        return $this->getFormatter()->renderObjectCall($infoWindow, 'open', $arguments);
    }
166676
function(map) {
        this.handlers.feature.setMap(map);
        if (this.box) {
            this.handlers.box.setMap(map);
        }
        OpenLayers.Control.prototype.setMap.apply(this, arguments);
    }