本机地图未在Android设备上带有代号为ONE的layeredlayout中显示



在2-3周内,我一直在实际的Android设备上使用我的应用程序。到目前为止,它始终在设备上显示Google Maps和模拟器上的OSM。

今天,我进行了一些更改 - 在地图顶部添加了一个按钮,然后发送了构建。在发送构建之前,对CN1和CN1LIBS进行了更新。现在,当我在设备上对其进行测试时,没有显示映射,我得到 404:找不到。如果您询问模拟器中的行为,它仍然可以按预期工作(但它将OSM与MapComponent一起使用)。

这是我的代码铺设地图(地图初始化没有更改):

Container mapWithButton = LayeredLayout.encloseIn(BorderLayout.centerCenter(googleMap),
FlowLayout.encloseRight(locateMeButton));
this.add(BorderLayout.CENTER, mapWithButton);

我已经看了MapContainer历史记录,但最近的更改仅涉及longPressListener。请注意,本机地图应用程序在设备上运行良好。通过DDMS进行调试无济于事(屏幕上出现相同的错误)。

我是否忘记更新或添加构建提示?

任何帮助。

最终404错误与地图无关,但是与添加的 MapListener试图从移动地图时尚不可用的地址获取数据。

然而,使地图实际出现的事实是,必须通过BorderLayout.center()而不是BorderLayout.centerCenter()替代方案将其包围。

所以我没有提供的解释,但是以下代码显示了图表和按钮(请注意BorderLayout.center而不是BorderLayout.centerCenter

Container mapWithButton = LayeredLayout.encloseIn(
                                        BorderLayout.center(googleMap),
                                        FlowLayout.encloseRight(locateMeButton));
this.add(BorderLayout.CENTER, mapWithButton);

最新更新