多个地图视图? [英] Multiple map views?

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

问题描述

我有一个应用程序,具有两个地图视图,一个卫星和一个街道视图。即使一个设置为 setStreetView(true); ,另一个设置为 setSattelite(true),它们都会继续显示为卫星视图; 。如何获得这两个视图显示不同的地图?



提前感谢。

解决方案假设您正在谈论同时显示两者,似乎不可能。请参阅
如何使一个活动2 MapView



更新以回覆评论。



根据Google Map API MapActivity ,每个进程只支持一个MapActivity。多个MapActivities运行同时可能会干扰意想不到的和不必要的方式。所以即使你有两个不同的MapActivities,你必须处理流程生命周期,其中可能有一个活动是可见的,另一个活动是背景,那是您遇到问题的地方。



第二次更新



所以根据这个线程 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天全站免登陆