I'm having a bit of trouble. In the constructor for MapView (and most of your constructors) there are these references to this.options that are coming up undefined in my app. In particular, when the MarkerViewCollection is adding a child,
// in MarkerViewCollection->addChild
var markerView = new this.markerView({
model: childModel,
map: this.map
});
My experience is that the View constructor is only applying the model part of the options being passed in. The result is that on the indicated line (below) this.map and this.options are both undefined. Any clues as to why this might be happening? What was this.options intended to refer to? Why might map not be being applied to this?
// in MapView
constructor: function() {
_.bindAll(this, 'render', 'close');
Backbone.View.prototype.constructor.apply(this, arguments);
// Ensure map and API loaded
if(!google || !google.maps) throw new Error("Google maps API is not loaded.");
--> if(!this.options.map && !this.map) throw new Error("A map must be specified.");
this.gOverlay = this.map = this.options.map || this.map;
// Set this.overlay options
this.overlayOptions || (this.overlayOptions = this.options.overlayOptions);
},
The map being passed in, by the way, is certainly defined.
I'm having a bit of trouble. In the constructor for MapView (and most of your constructors) there are these references to
this.options
that are coming up undefined in my app. In particular, when the MarkerViewCollection is adding a child,My experience is that the View constructor is only applying the
model
part of the options being passed in. The result is that on the indicated line (below)this.map
andthis.options
are both undefined. Any clues as to why this might be happening? What wasthis.options
intended to refer to? Why mightmap
not be being applied tothis
?The
map
being passed in, by the way, is certainly defined.Thanks!