1
我讀過原型:Backbone.js的+ google.maps API V3 + OverlayView的使用=骨幹
Mixing Google Maps custom overlays with Backbone Views
,並試圖實現與它玩弄,因爲我需要使用自定義疊加的意見,我已經使用backbone.js
var Label = function(){
Backbone.View.apply(this, arguments);
this.newInit();
};
Label.extend = Backbone.View.extend;
_.extend(Label.prototype, Backbone.View.prototype, google.maps.OverlayView.prototype,{
newInit: function(){
this.setMap(this.options.map);
},
onAdd: function(){...},
onRemove: function(){...},
draw: function(){...}
});
var label_view = new LabelView({map: map});
label_view.bindTo('some_event', {name: 'some_event_occured'});
從我測試,「繪製」方法不被稱爲,儘管它應該覆蓋它。 我在做什麼錯?