BlackBerry RichMapField 在设备上为空
我使用 RichMapField 如下所示在我的应用程序中显示黑莓地图。
RichMapField map = MapFactory.getInstance().generateRichMapField();
add(map);
地图在 BlackBerry 模拟器上正确显示,但在设备上地图字段为空白。
编辑:
这是我的代码的一部分。下面给出的代码向地图添加了 2 个标记,效果非常好,但唯一的问题是我看不到地图。
MapLocation Location1 = new MapLocation(coordinates[0],coordinates[1],"Location 1",null);
int Location1ID = data.add((Mappable)Location1,"Location 1");
data.tag(Location1ID, "Location1");
MapLocation Location2 = new MapLocation(coordinates[0]-0.00009,coordinates[1]- 0.00009,"Location 2",null);
int Location2ID = data.add((Mappable)Location2,"Location 2");
data.tag(Location2ID, "Location2");
data.setVisible("Location");
map.getMapField().update(true)
I use RichMapField like below to display Blackberry Maps in my application.
RichMapField map = MapFactory.getInstance().generateRichMapField();
add(map);
The map is displayed properly on the BlackBerry simulator, but on a device the map field is blank.
Edited:
This is some part of my code. The code given below adds 2 markers to the map, which works perfectly fine, but the only problem is i don't see the map.
MapLocation Location1 = new MapLocation(coordinates[0],coordinates[1],"Location 1",null);
int Location1ID = data.add((Mappable)Location1,"Location 1");
data.tag(Location1ID, "Location1");
MapLocation Location2 = new MapLocation(coordinates[0]-0.00009,coordinates[1]- 0.00009,"Location 2",null);
int Location2ID = data.add((Mappable)Location2,"Location 2");
data.tag(Location2ID, "Location2");
data.setVisible("Location");
map.getMapField().update(true)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
添加以下内容:
我想这样您现在就可以看到地图了。由于某种原因,我仍在调查,
map.getAction().update(true);
对我来说也效果不佳。
Add the following:
I think this way you will see the map now. For some reason I'm still investigating, the
map.getAction().update(true);
isn't working well for me too.
取决于你的屏幕绘画方法。如果您以在地图上重新绘制屏幕的方式覆盖屏幕,那么您显然看不到地图。
您可以尝试粘贴更多代码和您的绘制方法吗?会有帮助的。
depends on your screen painting method. If your override your screen in such a way that u repaint ur screen on top of ur map, you obviously cant see the map.
Can you try pasting more code and ur paint method. It will help.