Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map (v11.0.6) freezes on Java/FX 17.0.2 shortly after beeing initialized #202

Open
bgmf opened this issue Mar 16, 2022 · 6 comments
Open

Comments

@bgmf
Copy link

bgmf commented Mar 16, 2022

The code is rather easy: in the UI code I create an empty container for the map (mapCard) and I use the controller to create the map and add Data (markers):

mapCard.content.clear()
mapCard.content.children.add(
    GoogleMapView().apply {
        mapView = this
        minHeight = 320.0
        maxHeight = minHeight
        setKey("...")

        addEventFilter(ScrollEvent.ANY) {
            if (!it.isControlDown) {
                parent.fireEvent(it.copyFor(parent, parent))
                it.consume()
            }
        }
    }
)
mapView?.addMapInitializedListener(object : MapComponentInitializedListener {
    override fun mapInitialized() {
        mapView?.createMap(
            MapOptions().apply {
                center(LatLong(46.80121, 8.22669))
                mapType(MapTypeIdEnum.ROADMAP)
                mapTypeControl(false)
                overviewMapControl(false)
                panControl(false)
                rotateControl(false)
                scaleControl(false)
                streetViewControl(false)
                zoomControl(true)
                zoom(8.0)
            }
        ).also { map = it }
        mapView?.removeMapInitializedListener(this)
        initResults()
        toggleGroup.toggles.forEach { (it as ToggleButton).isDisable = false }
    }
})

The initResults() method loads some data from a local database and creates markers. I'm using Kotlin for the application and everything runs in a co routine, but that should not be an issue.

What happens is, the map freezes shortly after being initialized, or beeing just for some seconds. No zoomin, no map moving, no marker interaction.
What is notable, though, is that the web container itself still seems to be reacting - I've seen a grey rectanguar border around a marker appearing at least once. So I think, that the input events somehow are not forwarded to the map.

To make sure, it's not something else, I've removed the initResult() method as well as the scroll event filter. No change.

Since I have no more ideas, I thought raising an issue might be a good idea.

#edit: maybe that's noteworthy: I'm using the classpath variant, the application is not modularized...

@RyuDarc
Copy link

RyuDarc commented Mar 30, 2022

I got mine randomly freeze too, right now using javafx 17 + java 17 and lastest build of gmapsfx.

Try few more times(eg.10 times). I will got 2 ~3 times properly functional, 7~8 times freezes, and if you access GoogleMap again, it will throw MapNotInitializedException.

I've tried to renew map by

   map = googleMapView.getMap();

but no luck, it will not be able to initialize agian.

edit:
if you press any of the links below and rightclick back to map, then the frozen will get resolved.

@bgmf
Copy link
Author

bgmf commented Jul 18, 2022

@RyuDarc

if you press any of the links below and rightclick back to map, then the frozen will get resolved.

What do you mean by that? I have no liks in the map.

@danielwilbanks
Copy link

danielwilbanks commented Oct 21, 2022

Were you able to fix this? I'm having the same issue but oddly it only impacts my windows machines...not the mac.

EDIT: If anyone else encounters this I solved it by going back to 11.0.2. Not an ideal solution but for my purposes it works fine and maybe it will work for yours too.

@bgmf
Copy link
Author

bgmf commented Dec 16, 2022

No sorry. Unfortunately I wasn't able to work around this.
But I will try the suggested older version.

@dlemmermann Have you ever experienced this behaviour in any of your apps?

@dlemmermann
Copy link
Collaborator

No, I have not. Then again ... not using it extensively at the moment.

@danielwilbanks
Copy link

So after running a while on 11.0.2 with no issues now every version except 11.0.7 doesn't load a map at all, and 11.0.7 still has the issue with the map freezing. So we're back where we started on this issue. @dlemmermann any ideas on what I could try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants