我应该使用 MapView 还是 MapFragment [英] Should I use MapView or MapFragment

查看:34
本文介绍了我应该使用 MapView 还是 MapFragment的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我是应该使用 MapView 还是坚持使用 MapFragment.我的应用程序是一个应用程序,可以找到离您最近的一组最近的地点.我希望能够添加位置,在按下标记时显示标记的详细信息以及当用户沿地图移动时,我希望能够获取地图中心的坐标并显示定义的最近位置半径.如果我继续使用 MapFragments,我会处于劣势还是应该在我还有机会的时候切换到 MapView?

I am not sure whether I should be using MapView or stick to using a MapFragment. My application is an app that finds the nearest set of places that are closest to you. I want to be able to add locations, display details of a marker when I press a marker and when the user moves along the map I want to be able to get the coordinates of the center of the map and display the nearest locations within a defined radius. Would I be at a disadvantage if I continue to use MapFragments or should I switch over to MapView while I still have the chance?

推荐答案

首先,很快 MapView 和 Google Maps API V1 将停止支持并且不会收到任何新的更新.很快,所有支持都会消失.

First of all, soon the MapView and Google Maps API V1 will stop being supported and won't receive any new updates. And soon all the support will go away.

其次,MapFragment 现在可能不太灵活,但是所呈现的地图、操作看起来好多了.而且我猜它的功能会随着时间的推移而改进.

Secondly, MapFragment may be a little bit less flexible right now, but the map presented, manipulated a looks much better. And I guess that it's functionality will improve with time.

所以我肯定会继续使用 MapFragments.

So I would definitely continue to use MapFragments.

更新:正如@Brian White 在评论中指出的那样,今天 Google API V2 中有一个 MapView,当您想在片段中嵌入地图时应该使用它.这样您就可以避免不必要的级联片段.

UPDATE: As @Brian White pointed out in the comments, today there is a MapView in Google API V2, and you should use it when you want to embed a map in a fragment. That way you will avoid cascading fragments when you don't have to.

这篇关于我应该使用 MapView 还是 MapFragment的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆