我有以下页面: http ://www.skimmydiscs.co.uk/find-your-nearest-service-centre/ 允许您搜索车库 - 例如,放入斯卡伯勒,您会得到一个列表,选择第一个位置,地图重绘显示几个地点标记。单击标记会弹出一个气球。我无法弄清楚如何将弹出的气球的大小设置为 400 宽乘以至少 300 高......这是该页面上的代码:
<script type="text/javascript">
function initialize() {
var kmlfile = "http://www.skimmydiscs.co.uk/SMD_Data.kml?"+(new Date()).valueOf();
var mapOptions = {
center: new google.maps.LatLng(54.75,-3.5),
zoom: 5,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById('map_canvas'),mapOptions);
var input = document.getElementById('searchTextField');
var autocomplete = new google.maps.places.Autocomplete(input);
autocomplete.bindTo('bounds', map);
var infowindow = new google.maps.InfoWindow();
// Action the Event Listener, zoom in and put the kml layer in place
google.maps.event.addListener(autocomplete, 'place_changed', function() {
var place = autocomplete.getPlace();
if (place.geometry.viewport) {
map.fitBounds(place.geometry.viewport);
//add the layer
var ctaLayer = new google.maps.KmlLayer(kmlfile,{preserveViewport: true});
ctaLayer.setMap(map);
} else {
map.setCenter(place.geometry.location);
map.setZoom(10);
}
});
//setupClickListener('changetype-all', []);
//setupClickListener('changetype-establishment', ['establishment']);
//setupClickListener('changetype-geocode', ['geocode']);
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
我需要指导, - 非常感谢任何帮助。
谢谢安迪