我使用了谷歌地图信息窗口,但我无法使用信息窗口填充进行管理,现在我的选项卡看起来像
但我需要黑色内容 div 对齐所有白色标签长度,我在文档中读到我无法自定义 google infoWindow,并且他们提供使用弹出窗口,但我只需要在悬停时显示它。在项目中我使用 vue.js 也许中小企业有经验什么以及如何使用 vue 代替 infoWindow?
getDevelopmentInInfoWindow(entity, marker) {
window.axios.get(`/development-map/development/${entity.id}`)
.then((response) => {
this.instance.$props.entity = response.data;
this.instance.$mount();
this.infoWindow.setContent(this.instance.$el.innerHTML);
this.infoWindow.open(this.map, marker);
})
.catch((error) => console.log(error));
},
initializeInfoWindow() {
let InfoWindow = Vue.extend(InfoWindowComponent);
this.instance = new InfoWindow({
propsData: {
entity: null,
}
});
this.infoWindow = new this.google.maps.InfoWindow({
shadow: false,
});
},
最佳答案
您可以尝试使用 custom popup
如果您想在类似 infowindow 的样式中进行调整,这是另一种选择,因为 infowindow 类不提供自定义功能,因此不建议更改 infowindow 类的样式。
文档中还包含一个示例供您引用。
关于javascript - 什么可以替代谷歌地图信息窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54938729/