English 中文(简体)
安乐:地图绘制工作,1K图!
原标题:Android: Map drawing performance, 1K drawings !

So I have an application that draws line, polyline, circles, etc over an Open Streen Map. I keep a list of drawings, when the map is invalidated I iterate though the list redrawing each item within the onDraw method of an Overlay. This works fine until my drawing count gets around 300+. Then some serious UI delay kicks in.

我期待有效率地做到这一点?

I ve done bitmap cache drawing on a "board" drawing application. Although that will not work for this situation as the projection in the background can change, thus the drawing must move.

问题回答

当时,我节省了Geo Points,然后在每批重水中将“MapView Point”改为“MapView Point”。 “中间点”可以储存起来,很容易预测到“MapView Point”。 因此,重算部分只做了一次。

步骤

  • Motion Event(x,y) to GeoPoint using (fromPixels)
  • GeoPoint to Intermediate value using (toMapPixelsProjected)
  • Cache the intermediate values for drawing display
  • OnDraw -> intermediate values to screen coordinates using (toMapPixelsTranslated)




相关问题
What to look for in performance analyzer in VS 2008

What to look for in performance analyzer in VS 2008 I am using VS Team system and got the performance wizard and reports going. What benchmarks/process do I use? There is a lot of stuff in the ...

SQL Table Size And Query Performance

We have a number of items coming in from a web service; each item containing an unknown number of properties. We are storing them in a database with the following Schema. Items - ItemID - ...

How to speed up Visual Studio 2008? Add more resources?

I m using Visual Studio 2008 (with the latest service pack) I also have ReSharper 4.5 installed. ReSharper Code analysis/ scan is turned off. OS: Windows 7 Enterprise Edition It takes me a long time ...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

热门标签