更改信息窗口有什麼辦法becouse我需要比基本信息窗口更多的樣式與InfoBoxes到改變信息窗口...與信息框
代碼和演示:http://jsbin.com/EVEWOta/26
google.maps.event.addListener(marker,'click',function(){
service.getDetails(request, function(place, status) {
if (status == google.maps.places.PlacesServiceStatus.OK) {
var contentStr = '<h5>'+place.name+'</h5><p>'+place.formatted_address;
if (!!place.formatted_phone_number) contentStr += '<br>'+place.formatted_phone_number;
if (!!place.website) contentStr += '<br><a target="_blank" href="'+place.website+'">'+place.website+'</a>';
contentStr += '<br>'+place.types+'</p>';
if (!!place.photos) contentStr += '<img src=' + place.photos[0].getUrl({ 'maxWidth': 300, 'maxHeight': 300 }) + '></img>';
infowindow.setContent(contentStr);
infowindow.open(map,marker);
} else {
var contentStr = "<h5>No Result, status="+status+"</h5>";
infowindow.setContent(contentStr);
infowindow.open(map,marker);
}
});
});
gmarkers.push(marker);
信息窗口不能風格我想要我需要用信息框來改變它,但是如何?
是,編寫代碼。請參閱:http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/examples.html。 – PHPglue