onlylemi / MapView

A MapView on Android platform.
MIT License
678 stars 162 forks source link

mapview图片变黑 #3

Open dys1715 opened 8 years ago

dys1715 commented 8 years ago

在使用LocationLayerTest过程中发现,当把传感器开启之后,mapview load进来的图很容易就变黑了,不显示图片了,并且log显示如下信息: 05-12 14:18:31.710 12247-12247/com.onlylemi.mapview I/View: ssignParent(ViewParent parent) parent is: null 05-12 14:18:31.710 12247-12247/com.onlylemi.mapview W/InputEventReceiver: Attempted to finish an input event but the input event receiver has already been disposed. 05-12 14:18:41.430 12247-12261/com.onlylemi.mapview W/art: Suspending all threads took: 16.904ms

onlylemi commented 8 years ago

@dys1715 收到,我手机上没问题,请告诉我你的手机型号和Android版本号,谢谢!

dys1715 commented 8 years ago

@onlylemi 我用的测试机型有华为P8、坚果、乐视1,系统的话5.0。在LocationLayerTest这个里面看着比较明显,拖动地图的时候,可以看到内存蹭蹭就涨。

onlylemi commented 8 years ago

@dys1715 内存这块优化的不是很好,目前正在优化和修复,之后会发布v1.1,如果你有更好的方法,然后给我pull request,非常欢迎!

dys1715 commented 8 years ago

@onlylemi LocationLayer类,draw方法,float[] goal修改为全局变量,canvas.drawBitmap等操作的时候,不要直接使用new Paint()。

WellJack86 commented 8 years ago

百度地图不知道是不是跟你的一个原理?

onlylemi commented 8 years ago

@WellJack86 应该不是吧,室外数据比较大,

hustzxd commented 8 years ago

我测试的时候也是图片会变黑,请问现在有方法可以解决吗?

onlylemi commented 8 years ago

hey @hustzxd ,

你的系统版本是多少呢,变黑应该在5.0以下会出现,目前正在解决这个问题

ydcool commented 8 years ago

android 4.1.1 也出现 变黑/变花 现象。复现:将地图旋转缩放一下,然后长按不放,就会一点一点变花掉。

ydcool commented 8 years ago

@WellJack86 百度高德这种地图都是矢量的,这个是基于位图。感觉矢量性能应该更好些。