1
我试图将语言属性设置为除div标签内的 “en”[说“ko”]之外的某个值。我以这种方式在 中创建的内容字符串用于设置InfoWindow的setContent()。不幸的是,我继续看到英文文本,而不是我定义的语言值。 下面是代码中的相关部分:InfoWindow:在div标签内部设置lang属性不起作用
content_string = '<div style="width: 210px; padding-right: 10px" lang="ko" xml:lang="ko">' + biz_name_html + '<br>' + biz_addr + '<br>' + biz_url_html + '<br>' + biz_phone + '<br>' + biz_description + '</div>';
marker = new google.maps.Marker({
position: latlng,
map: map,
title: biz_name,
html: content_string,
icon: new google.maps.MarkerImage(marker_icon_url)
});
google.maps.event.addListener(marker, 'click', function() {
info_window.setContent(this.html);
info_window.open(map, this);
});