Overrinding draw() in customized MapView in Google Maps Android API v2

风格不统一 提交于 2019-12-11 18:18:44

问题


Very simple question : since MapView inherits from View, is it possible to override draw() to draw whatever you want on the map ?


回答1:


No, but you can use polylines, polygons, circles. If that's not enough you can put any bitmap (even one you draw to using Canvas) combined with ground overlay. If that's not enough, you can also use tile overlay to draw on entire map efficiently.

It's all there in the documentation, I encourage you to study.

Drawing directly can be always done on a view that overlaps with map, but it won't scroll with map nicely, so better to use technics above.

Drawing directly on the map is impossible, because it doesn't happen in your process afaik.



来源:https://stackoverflow.com/questions/16966565/overrinding-draw-in-customized-mapview-in-google-maps-android-api-v2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!