Comments (8)
@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.
I'm not sure I understand the question... perhaps can you post a jsbin/jsfiddle with the issue?
from google-maps-react.
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.
Any updates on this @joserocha3 ?
from google-maps-react.
I ended up using a different library. You can close this. Thanks for your help.
from google-maps-react.
@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.
@joserocha3 You are a lifesaver. That worked so well.
from google-maps-react.
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)
- cors error HOT 1
- prop-types should be a proper dependency
- Circle dragend event
- Unable to get marker coordinates on drag HOT 1
- Hide labels.text config on init Map
- is it possible to load geojson HOT 1
- Pin Drag Method Of Google map
- npm ERR ! HOT 1
- React cant compile anymore
- Please Update npmjs.com package to 2.0.8 its still 2.0.6 HOT 13
- Draw a route on the map HOT 1
- How to get the Current Zoom value on the Map? Is there any function to that?
- What is the difference between bounds and marginBounds?
- getting blank page maps not rendered
- Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<InfoWindow> & Readonly<IInfoWindowProps>'
- Exposing Google Map API key HOT 2
- Style the marker
- Updated version published as @peacechen/google-maps-react
- Custom styles not beign applied to map HOT 1
- addListener not a function?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-maps-react.