「マップ」機能で動作するコード スニペットがあります。コードは次のとおりです。
var latlang = new google.maps.LatLng(myjsonobject[pos].geocode.latitude, myjsonobject[pos].geocode.longitude);
$('#map_canvas').gmap({
'center': latlang,
'zoom': 10,
'disableDefaultUI':false,
'callback': function() {
var self = this;
self
.addMarker({'position': this.get('map').getCenter() })
.click(function() {
self.openInfoWindow({ 'content': address }, this);
});
}
});
変数latlangには、特定の場所の緯度と経度が提供されます。次に、 はを入力としてmap_canvasGoogle マップが表示される divです。latlangコールバック関数でselfは、 で割り当てられる変数ですthis。これは私が混乱している場所です。thisこの文脈では何ですか?誰か光を当てgetCenter()てthis内部self.openInfoWindowをお願いできますか?
コード全体はどのように機能し、結果を表示していますか?