当前位置:网站首页>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
边栏推荐
- WebView saves the last browsing location
- Daily CISSP certification common mistakes (April 12, 2022)
- CISSP certified daily knowledge points (April 15, 2022)
- 机器学习实战 -朴素贝叶斯
- ESP32 LVGL8. 1 - input devices (input devices 18)
- 教你用简单几个步骤快速重命名文件夹名
- Use stm32cube MX / stm32cube ide to generate FatFs code and operate SPI flash
- How to virtualize the video frame and background is realized in a few simple steps
- Daily CISSP certification common mistakes (April 19, 2022)
- Coolweather is revised and connected to the wind weather interface to realize the broken line diagram of temperature
猜你喜欢
【科普】CRC校验(一)什么是CRC校验?
Solutions such as unknown or garbled code or certificate problem prompt in Charles's mobile phone packet capture, actual measurement.
解决:cnpm : 無法加載文件 ...\cnpm.ps1,因為在此系統上禁止運行脚本
Resolution: cnpm: unable to load file \cnpm. PS1, because running scripts is prohibited on this system
Résolution: cnpm: impossible de charger le fichier... Cnpm. PS1 parce que l'exécution de scripts est désactivée sur ce système
listener. log
教你用简单几个步骤快速重命名文件夹名
ctfshow-web361(SSTI)
Use stm32cube MX / stm32cube ide to generate FatFs code and operate SPI flash
Use bitnami / PostgreSQL repmgr image to quickly set up PostgreSQL ha
随机推荐
os_authent_prefix
配置iptables
os_ authent_ Prefix
视频边框背景如何虚化,简单操作几步实现
Use Chenxi bookkeeping book to analyze the balance of revenue and expenditure of each account in a certain period of time
Nacos作为服务配置中心实战
Esp32 (UART event) - serial port event learning (1)
Practice of Druid SQL and security in meituan review
Sentinel service fusing practice (sentinel integration ribbon + openfeign + fallback)
从技术体系到商业洞察,中小研发团队架构实践之收尾篇
ctfshow-web362(SSTI)
ESP32 LVGL8. 1 - roller rolling (roller 24)
Ionic instruction set order from creation to packaging
Daily network security certification test questions (April 14, 2022)
listener. log
ctfshow-web361(SSTI)
Methods of nested recycleview to solve sliding conflict and incomplete item display
CISSP certified daily knowledge points (April 13, 2022)
Ucosiii transplantation and use, reference punctual atom
Get a list of recent apps