Code Monkey home page Code Monkey logo

Comments (2)

sothawo avatar sothawo commented on August 12, 2024

is the marker variable local to the method where you call it? The MapView only keeps a weak reference to the Marker object, so if you do not keep a reference to the Marker object, it will be garbage collected and disappear from the Map. This is documented in the JavaDoc for MapView.addMarker().

The reason for this is, that if the MapView would keep strong references and the user of the MapView does not remove the Markers from the Map, they would be kept until the MapView is disposed and this would be a memory leak. So to keep it safe, the MapView does not take any responsibility to keep a reference to the Marker objects.

You have to either make them fields in the class using the MapView or put them in some collection of markers which prevents them from being garbage collected - this collection itself must be a field or still be referenced somewhere.

As to the second error: this should only be a warning which appears on first accessing the map tiles; I have to change the logging level.

from mapjfx.

ModdyLP avatar ModdyLP commented on August 12, 2024

Thank you very much, i solved it with a collection of the markers on my own. But your explanation is very good 👍

Best Regards

from mapjfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.