Why is the MapListener not always fired on Codename One GoogleMap under Simulator

笑着哭i 提交于 2019-12-23 02:29:08

问题


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));

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.

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 ?

Any hint appreciated,


回答1:


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.

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.



来源:https://stackoverflow.com/questions/42880326/why-is-the-maplistener-not-always-fired-on-codename-one-googlemap-under-simulato

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!