[英]Google maps infoWindow shows text as white, can highlight to see content
我使用本教程來設置我的地圖: http : //meteorcapture.com/how-to-create-a-reactive-google-map/
我將此示例用於infoWindow: https : //developers.google.com/maps/documentation/javascript/infowindows
我現在正試圖在用戶點擊標記時顯示任務的標題。 infoWindow顯示,但文本為白色,只有突出顯示才能讀取。 我試着用Google搜索,但我找不到類似的東西。
我正在使用Meteor進行開發
相關代碼:
<div align = 'center' class = 'map-container' id = 'map'>
{{> googleMap name = 'map' options = mapOptions}}
</div>
Template.currentTasks.onCreated(function() {
GoogleMaps.ready('map', function(map) {
Tasks.find().forEach(function(task) {
if (task.location != null) {
var marker = new google.maps.Marker({
draggable: false,
animation: google.maps.Animation.DROP,
position: task.location,
map: map.instance,
title: task.title,
id: document._id
});
var infoWindow = new google.maps.InfoWindow({
content: task.title
});
google.maps.event.addListener(marker, 'click', function() {
infoWindow.open(map.instance, marker);
});
}
})
});
});
mapOptions: function() {
if (GoogleMaps.loaded()) {
return {
//union lat lng is below, using wellesley for testing rn
// center: new google.maps.LatLng(42.8177427, -73.9305222),
center: new google.maps.LatLng(42.3170368, -71.2751508),
zoom: 14
};
}
}
我在嵌入地圖的模板的onRendered函數中調用了GoogleMaps.load()。
無論我放入文本字段,無論是硬編碼還是其他對象,infoWindow都會顯示為白色文本。
在CSS中找到rgb(255,255,255){或接近它}的顏色設置。 與語義 - ui倒置對象相關的東西。 為了解決這個問題,我在.ui.primary.inverted.segment下注釋了第640行。
color(255,255,255...
我沒有注意到我的項目中其他倒置部件有任何變化,但我可能沒有使用相同的倒置設計。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.