52,782
社区成员
发帖
与我相关
我的任务
分享gmap.js
Ext.onReady(function(){
var mapwin;
var button = Ext.get('earth-win-shortcut');
var Width = window.screen.availWidth-100;
var Height = window.screen.availHeight-200;
button.on('click', function(){
// create the window on the first click and reuse on subsequent clicks
if(!mapwin){
mapwin = new Ext.Window({
layout: 'fit',
title: '网站所在地',
closeAction: 'hide',
width:Width,
height:Height,
x: 40,
y: 60,
items: {
xtype: 'gmappanel',
region: 'center',
zoomLevel: 14,
gmapType: 'map',
mapConfOpts: ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
mapControls: ['GSmallMapControl','GMapTypeControl','NonExistantControl'],
setCenter: {
geoCodeAddr: '4 Yawkey Way, Boston, MA, 02215-3409, USA',
marker: {title: 'Fenway Park'}
},
markers: [{
lat: 40.22,//北京纬度
lng: 116.2,//北京经度
marker: {title: 'Boston Museum of Fine Arts'},
listeners: {
click: function(e){
Ext.Msg.alert('Its fine', 'and its art.');
}
}
},{
lat: 40.22,//北京纬度
lng: 116.2,//北京经度
marker: {title: 'Northeastern University'}
}]
}
});
}
mapwin.show();
});
});