如何总是在右侧制作反应传单标记弹出窗口?
我想在地图屏幕右侧显示一个反应传单标记弹出窗口,但它总是粘在屏幕的左侧。因此,我将感谢您完成此操作的任何帮助。以下是弹出窗口当前状态的屏幕截图。
这是我尝试过的我的CSS。
.leaflet-popup {
transform: none !important;
position: absolute !important;
top: 1px !important;
bottom: 0px !important;
right: 0% !important;
display: flex !important;
align-items: right !important;
justify-items: right !important;
}
.leaflet-container .leaflet-popup-content-wrapper .popup_modle {
z-index: 1000;
position: absolute;
right: 0 !important;
height: 400px;
width: 300px;
top: -1px;
background-color: rgba(5, 5, 5, 0.7) !important;
background: linear-gradient(
60deg,
rgba(134, 134, 134, 0.7) 0%,
rgba(0, 0, 0, 0.7) 59%
) !important;
align-items: right !important;
justify-items: right !important;
justify-content: right !important;
-webkit-border-radius: 0 !important;
-moz-border-radius: 0 !important;
}
谢谢
I want to show a React Leaflet Marker popup on the right side of the map screen, but it always sticks to the left side of the screen. Therefore, I would appreciate any help in getting this done. Below is a screenshot of the current state of the popup.
this is my CSS that i tried.
.leaflet-popup {
transform: none !important;
position: absolute !important;
top: 1px !important;
bottom: 0px !important;
right: 0% !important;
display: flex !important;
align-items: right !important;
justify-items: right !important;
}
.leaflet-container .leaflet-popup-content-wrapper .popup_modle {
z-index: 1000;
position: absolute;
right: 0 !important;
height: 400px;
width: 300px;
top: -1px;
background-color: rgba(5, 5, 5, 0.7) !important;
background: linear-gradient(
60deg,
rgba(134, 134, 134, 0.7) 0%,
rgba(0, 0, 0, 0.7) 59%
) !important;
align-items: right !important;
justify-items: right !important;
justify-content: right !important;
-webkit-border-radius: 0 !important;
-moz-border-radius: 0 !important;
}
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果此CSS没有反映您的代码。我建议您将其移至全局CSS文件。为了确保您覆盖反应叶样式。我刚刚更新了 .leaflet-popup 类。而不是右:0%我使用右:0!
If this CSS didn't reflect your code. I would recommend for you move it to a global CSS file. to make sure that you override the react-leaflet style. I just updated the .leaflet-popup class. instead of right:0% I used right:0 !important
最重要的是,该标记我还添加了一个模型来显示数据。
并且该模型像这样将地图排名第一,因此您可以编写自己的弹出窗口。
和CSS
On top that that marker I have added a model to show data.
and the model goes top of the map like this so you can write your own popup.
and css