Giter VIP home page Giter VIP logo

Comments (8)

joserocha3 avatar joserocha3 commented on September 3, 2024 3

@coreyar we didn't find the cause of the issue.

Came back to this library and ended up supplying a unique key for each marker whether the location was the same as a previous marker or not. That clears the previous set of markers just fine.

Used a timestamp with the object's array index concatenated to get a unique key.

from google-maps-react.

auser avatar auser commented on September 3, 2024

I'm not sure I understand the question... perhaps can you post a jsbin/jsfiddle with the issue?

from google-maps-react.

joserocha3 avatar joserocha3 commented on September 3, 2024

I render a first array of markers. When I change that array and render the markers are updated. When I change the markers a second time that second array stays rendered with the new ones.

Adding a unique key prop to the markers each time seems to fix the issue. The markers are all correctly updated each time.

I will try tomorrow to post to jsbin.

from google-maps-react.

auser avatar auser commented on September 3, 2024

Any updates on this @joserocha3 ?

from google-maps-react.

joserocha3 avatar joserocha3 commented on September 3, 2024

I ended up using a different library. You can close this. Thanks for your help.

from google-maps-react.

coreyar avatar coreyar commented on September 3, 2024

@joserocha3 I am having the same issue. Did you find what was causing the problem? What library did you end up using?

from google-maps-react.

coreyar avatar coreyar commented on September 3, 2024

@joserocha3 You are a lifesaver. That worked so well.

from google-maps-react.

G-P-Git avatar G-P-Git commented on September 3, 2024

I think part of the problem, at least for markers that haven't changed position, is the check for this.props.position !== prevProps.position in Marker componentDidUpdate. I think it needs to do a deep comparison:

this.props.position.lat !== prevProps.position.lat || this.props.position.lng !== prevProps.position.lng

from google-maps-react.

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.