gpt4 book ai didi

javascript - 谷歌地图 infoWindow 将文字显示为白色,可以突出显示以查看内容

转载 作者:行者123 更新时间:2023-12-01 05:02:36 26 4
gpt4 key购买 nike

我使用本教程来设置我的 map :http://meteorcapture.com/how-to-create-a-reactive-google-map/

我在 infoWindow 中使用了这个示例:https://developers.google.com/maps/documentation/javascript/infowindows

我现在试图在用户单击标记时显示任务的标题。 infoWindow 会显示,但文本是白色的,只有在突出显示时才能阅读。我试着用谷歌搜索这个,但我找不到类似的东西。

我正在使用 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
};
}
}

我在嵌入 map 的模板的 onRendered 函数中调用 GoogleMaps.load()。

无论我在文本字段中输入了什么,无论它是硬编码的还是来自另一个对象,infoWindow 都会显示为白色文本。

最佳答案

在 CSS 中找到 rgb(255,255,255) {或接近}的颜色设置。与语义-ui 倒置对象相关的东西。为了解决这个问题,我注释掉了 .ui.primary.inverted.segment 下的第 640 行。

color(255,255,255...

在我的项目中,我没有注意到其他倒置部分有任何变化,但我可能没有使用相同的倒置设计。

关于javascript - 谷歌地图 infoWindow 将文字显示为白色,可以突出显示以查看内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31633770/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com