moagrius / MapView

(Deprecated, prefer https://github.com/moagrius/TileView) Android widget roughly described as a hybrid between com.google.android.maps.MapView and iOS's CATiledLayer
http://moagrius.github.com/MapView/documentation
69 stars 35 forks source link

Does MapView only draw PathViews that are visible? #43

Closed mohlendo closed 11 years ago

mohlendo commented 11 years ago

In my use-case I have a lot of stuff that should be drawn on top of the map. Does the MapView only draw those PathViews that are visible on the screen?

moagrius commented 11 years ago

No, only tiles are managed relative to the viewport, everything else is rendered normally. Are you concerned about memory?

mohlendo commented 11 years ago

Yes, when I use the ParthViews the MapView does not respond anymore because I have A LOT of PathViews. I have now added a way to draw directly on the bitmap of the tiles which is much faster. This will eventually result in another pull request ;-)

moagrius commented 11 years ago

sounds cool - looking forward to seeing it

moagrius commented 11 years ago

How'd this go @mohlendo? In another dev's project, they found that adding/removing paths dynamically was buggy, but I found redrawing was stable, so for the next major update I'm going to rewrite the whole path drawing strategy #57 If you've found anything useful, LMK. Thanks.

phil-applegate commented 11 years ago

Just to add a comment to this, I've recently been trying to draw a particularly large path. When trying to use hardware acceleration to draw the MapView I am presented with the error OpenGLRenderer: "Shape path too large to be rendered into a texture" and the path is not drawn.

This can be resolved by disabling hardware acceleration at a cost of performance. Not sure if your update to the path drawing strategy in #57 is planned to solve this but could be worth looking at.

Cheers and thanks.

moagrius commented 11 years ago

@phil-applegate ideally i'd like to limit the shape to the viewport, but i'm not sure how realistic that'll end up being. will definitely keep the note above handy tho, thanks for the input.

phil-applegate commented 11 years ago

I've been doing some more research into this issue and found this post which looks to be similar to the problem I described above.

I've modified my local version of MapView to use drawLines() combined with drawCircle() rather than drawPath(). As a result the Path does not look quite as good as it did with drawPath() but it can now be hardware accelerated thus improving performance and smoothness.

Hope the link proves to be some use!

moagrius commented 11 years ago

@phil-applegate very good info - i knew the path drawing operations needed to be rewritten for the upcoming TileView replacement, and will definitely keep this info handy when doing that. thanks.