多个地图的看法? [英] Multiple map views?

查看:133
本文介绍了多个地图的看法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个地图的意见一颗卫星和一个街景的应用程序。他们都一直显示为即使一个设置为 setStreetView(真)卫星视图; 和其他设置为 setSattelite(真); 。我怎么会得到这么两个视图显示不同的地图?

先谢谢了。


解决方案

假设你是在谈论同时显示在同一时间,它不会出现成为可能。看到
如何使一个活动

更新回应置评。

%的谷歌地图API的 MapActivity ,只有一个MapActivity是每个进程的支持。同时运行多个MapActivities有可能在意想不到的和不需要的方式来干涉。所以,即使你有两个不同的MapActivities你必须处理与流程生命周期,其中也许一个活动是可见的,其他的活动背景,这正是你所得到的问题。

2日更新

所以,根据这个线索<一个href=\"http://groups.google.com/group/android-developers/browse_thread/thread/596f6c14d2b1af8b/5d36e97af12adfd1?lnk=gst&q=mapactivity#5d36e97af12adfd1\"相对=nofollow>的MapView的局限性和MapActivity 的一位评论者把两个MapActivities之间的单独活动,并能够使它发挥作用,否则你将不得不使用重叠/找到一种方法,使您的应用程序的工作只有一个MapActivity

I have an application that has two map views one satellite and one street view. They both keep showing up as a satellite view even though one is set to setStreetView(true); and the other is set to setSattelite(true);. How would I get it so that both views show different maps?

Thanks in advance.

解决方案

Assuming you are talking about showing both at the same time, it doesn't appear to be possible. See How to Make 2 MapView on One Activity

Updated to respond to comment.

Per the Google Map API MapActivity, "Only one MapActivity is supported per process. Multiple MapActivities running simultaneously are likely to interfere in unexpected and undesired ways." So even if you have two different MapActivities you have to deal with the Process Lifecycle, where perhaps one activity is visible and the other activity is background and that is where you are getting problems.

2nd Update

So according to this thread Limitations of the MapView and MapActivity one commenter put a separate activity between two MapActivities and was able to make it work, but otherwise you will have to use overlays/find a way to make your app work with only one MapActivity.

这篇关于多个地图的看法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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