如何将地图上的缩放工具从右上角移动到右下角? [英] How can I move the zoom tools on the map from the top to the bottom-right corner?

查看:77
本文介绍了如何将地图上的缩放工具从右上角移动到右下角?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在左上角有一张带有缩放工具的经典地图,我想将它们移到右下角.问题是我什至不知道这是否可能.

I got a classical map with zoom tools on the top-left corner and I want to move'em to the bottom-right corner. The problem is I don't even know if it's possible.

我做了一些研究,但在我看来,如果它存在应该很简单,所以我不知道为什么我几天没有发现任何东西.

I've done some research but well, in my mind it should be simple if it exists so I don't know why I've found nothing in several days.

谢谢大家的帮助

推荐答案

默认 CSS 有 .5em top/left 设置和 1.375em 按钮宽度/高度,所以从左上到下简单移动 2 个堆叠按钮正确的是

The default CSS has .5em top/left setting and a 1.375em button width/height, so a simple move of 2 stacked buttons from from top left to bottom right would be

.ol-zoom {
    top: calc(100% - .5em*2 - 1.375em*2);
    left: calc(100% - .5em*2 - 1.375em);
}

但是需要一些微调,因为按钮周围有 1px 的边距,组合周围有 2px 的边框半径

but some fine tuning will be needed because there is a 1px margin around the buttons and a 2px border radius around the combination

这篇关于如何将地图上的缩放工具从右上角移动到右下角?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆