为什么在模拟器下未始终在代号为一个的GoogleMap上触发MapListener [英] Why is the MapListener not always fired on Codename One GoogleMap under Simulator

查看:60
本文介绍了为什么在模拟器下未始终在代号为一个的GoogleMap上触发MapListener的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序具有 ContainerMap (带有有效Javascript API密钥的GoogleMap),该文件放置在BorderLayout表单的中心位置。

My app features a ContainerMap (GoogleMap with valid Javascript API Key) that is laid in center location of a BorderLayout form.

super(new BorderLayout(BorderLayout.CENTER_BEHAVIOR_SCALE));
...
this.add(BorderLayout.CENTER_BEHAVIOR_CENTER, BorderLayout.center(userReportsMap));

我已经注册了 MapListener ,我想知道为什么在模拟器下放大或缩小时不总是将其触发?好像是在初始化GoogleMap并将MapListener添加到地图时,一开始就被触发了十二次,然后它不再触发了。我按下减号键和加号键来放大和缩小。

I have registered a MapListener and I wonder why it is not always fired when I zoom in or out under simulator ? It looks like it is fired a dozen of times right at the beginning when the GoogleMap is initialized and the MapListener is added to the map, and then it does not fire anymore. I press minus key and plus key to zoom out and in.

请注意:之后,我不会删除监听器或实例化地图。

Please note : I don't remove the listener or instantiate the map anywhere afterwards.

与之相反,在Android设备上,捏捏后似乎可以按预期工作。

On the contrary on an Android device it seems to work as expected when I pinch. So is it a limitation in the simulator due to the underlying Javascript map ?

任何提示表示赞赏,

推荐答案

我刚刚发布了一些Google Maps库的更改,以修复JS和模拟器中的一些竞态条件。这可能会为您解决问题。

I have just released some changes to the Google Maps lib to fix a couple of race conditions in JS and simulator. This might fix the issue for you.

此处是指向最新lib的直接链接。或者,您可以等待它(可能少于一天)出现在代号一个设置/扩展名中并在此进行更新。

here is a direct link to latest lib. Or you can wait (probably less than a day) for it to appear in Codename One Settings/Extensions and update through there.

这篇关于为什么在模拟器下未始终在代号为一个的GoogleMap上触发MapListener的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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