当前位置:网站首页>Tencent map and high logo removal method
Tencent map and high logo removal method
2022-04-23 18:48:00 【KIDD-4869】
Preface
Previous projects need to integrate positioning components , So we unified Gaode and Tencent , The inevitable need will be logo hide . But the map api There is no hidden logo Methods , Only settings logo Of margin Methods .
Tencent map
Traverse the layer to find logo Can be hidden .
class TextureTMapView: MapView {
constructor(context: Context) : super(context)
constructor(context: Context, options: TencentMapOptions?) : super(context, options)
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
constructor(
context: Context,
attrs: AttributeSet?,
options: TencentMapOptions?
) : super(context, attrs, options)
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
)
constructor(
context: Context,
attrs: AttributeSet?,
defStyleAttr: Int,
options: TencentMapOptions?
) : super(context, attrs, defStyleAttr, options)
init {
this.viewTreeObserver.addOnGlobalLayoutListener(object : ViewTreeObserver.OnGlobalLayoutListener {
override fun onGlobalLayout() {
// Hide Tencent map logo
getChildAt(1)?.visibility = GONE
viewTreeObserver.removeOnGlobalLayoutListener(this)
}
})
}
}
Gould map
Gaode map can also use Tencent map , remove layer , But I read several blogs , What they offer getChildAt Of index Don't agree with each other , I didn't try , But it should be right index It can also be hidden . Or some people judge view yes imageview Hide it directly .
After map initialization , take logo Move out of the map
init {
// hide logo, Passing in negative values can move out of the map
mapView?.map?.uiSettings?.setLogoBottomMargin(ExtendUtil.dip2px(context, -100f))
}
In the following order
Replace map sdk The workload is OK , Two maps api Very similar , There are only individual differences , Perfect replacement is not a problem .
版权声明
本文为[KIDD-4869]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210603464024.html
边栏推荐
- Esp32 (UART ecoh) - serial port echo worm learning (2)
- Tangle
- Daily network security certification test questions (April 12, 2022)
- SQL中函数 decode()与 replace()的用法
- 从技术体系到商业洞察,中小研发团队架构实践之收尾篇
- 解决:cnpm : 无法加载文件 ...\cnpm.ps1,因为在此系统上禁止运行脚本
- About the operation of unit file reading (I)
- Iptables - L executes slowly
- ESP32 LVGL8. 1 - msgbox message box (msgbox 28)
- CISSP certified daily knowledge points (April 18, 2022)
猜你喜欢
ESP32 LVGL8. 1 - img picture (IMG 20)
CANopen STM32 transplantation
After opening the original normal project, the dependency package displays red and does not exist.
On iptables
listener.log
MVVM model
七、DOM(下) - 章节课后练习题及答案
Chondroitin sulfate in vitreous
Iptables - L executes slowly
使用 bitnami/postgresql-repmgr 镜像快速设置 PostgreSQL HA
随机推荐
CANopen STM32 transplantation
os_authent_prefix
ESP32 LVGL8. 1 - label (style 14)
22 year flying Book manpower Kit
Daily CISSP certification common mistakes (April 19, 2022)
PyGame tank battle
Nacos作为服务注册中心
Excel intercept text
从技术体系到商业洞察,中小研发团队架构实践之收尾篇
listener.log
深入理解 Golang 中的 new 和 make 是什么, 差异在哪?
STM32: LCD display
Daily network security certification test questions (April 18, 2022)
QT excel operation summary
Chondroitin sulfate in vitreous
ctfshow-web362(SSTI)
Database computer experiment 4 (data integrity and stored procedure)
视频边框背景如何虚化,简单操作几步实现
实战业务优化方案总结---主目录---持续更新
Practice of Druid SQL and security in meituan review