我知道这个问题有很多答案。我已经测试了所有,但它们不适用于我的代码。当我在脚本中使用代码时,它停止工作。
function createMarker(latlng) {
var marker = new google.maps.Marker({
position: latlng,
map: map,
icon:'images/intake.png',
html:(contentString,contentString1,contentStringPhoto)
});
infoBubble = new InfoBubble({
maxWidth: 400
});
var div = document.createElement('DIV');
div.innerHTML = 'NN-Gis';
infoBubble.addTab('Information', contentString);
infoBubble.addTab('Information', contentString1);
infoBubble.addTab('Photo', contentStringPhoto);
google.maps.event.addListener(marker, 'click', function() {
if (!infoBubble.isOpen()) {
infoBubble.setContent(contentString,contentString1,contentStringPhoto);
infoBubble.open(map,marker);
}
});
}
google.maps.event.addDomListener(window, 'load', init);
function updateStyles() {
var shadowStyle = document.getElementById('shadowstyle').value;
infoBubble.setShadowStyle(shadowStyle);
var padding = document.getElementById('padding').value;
infoBubble.setPadding(padding);
var borderRadius = document.getElementById('borderRadius').value;
infoBubble.setBorderRadius(borderRadius);
var borderWidth = document.getElementById('borderWidth').value;
infoBubble.setBorderWidth(borderWidth);
var borderColor = document.getElementById('borderColor').value;
infoBubble.setBorderColor(borderColor);
var backgroundColor = document.getElementById('backgroundColor').value;
infoBubble.setBackgroundColor(backgroundColor);
var maxWidth = document.getElementById('maxWidth').value;
infoBubble.setMaxWidth(maxWidth);
var maxHeight = document.getElementById('maxHeight').value;
infoBubble.setMaxHeight(maxHeight);
var minWidth = document.getElementById('minWidth').value;
infoBubble.setMinWidth(minWidth);
var minHeight = document.getElementById('minHeight').value;
infoBubble.setMinHeight(minHeight);
var arrowSize = document.getElementById('arrowSize').value;
infoBubble.setArrowSize(arrowSize);
var arrowPosition = document.getElementById('arrowPosition').value;
infoBubble.setArrowPosition(arrowPosition);
var arrowStyle = document.getElementById('arrowStyle').value;
infoBubble.setArrowStyle(arrowStyle);
}