Skip to content
This repository has been archived by the owner on Nov 30, 2018. It is now read-only.

Marker position does not update when edited #946

Closed
WillsB3 opened this issue Dec 2, 2014 · 7 comments · Fixed by #954
Closed

Marker position does not update when edited #946

WillsB3 opened this issue Dec 2, 2014 · 7 comments · Fixed by #954
Assignees
Milestone

Comments

@WillsB3
Copy link

WillsB3 commented Dec 2, 2014

When altering a markers location, the change is not reflected in the map. It seems as though the markers location is not watched.

See this example. Clicking the "Move a Marker" button should move the marker to a new random location.

The hack we've had to use to get this working is to use the doRebuildAll attribute to force the map to update. You can see this works by adding doRebuildAll="true" to the to the marker cluster element in the above Plunkr, but this solution is horrible...

Is this a bug in the clusterer?

@nmccready
Copy link
Contributor

Confirmed. I need to revisit this code in my PR as well. #948

@nmccready
Copy link
Contributor

Found the issue so when it gets to looking for updates it compares model to ChildModel.model, well they are somehow pointing to the same reference (not sure how they were not before). Anyway one ChildModel creation passing in a clone of model alleviates the problem.

As an alternative the model comparison could compare the model to a gObject. However this would require more code changes that are desired right now.

nmccready added a commit to nmccready/angular-google-maps that referenced this issue Dec 2, 2014
Cloning Model to make sure there is an oldModel and newModel to compare
to .
@grahamj
Copy link

grahamj commented Dec 2, 2014

Confirmed that this happens as of 2.0.2. From that version on doRebuildAll needs to be set for the markers to move. Just did a bunch of manual testing to verify.

nmccready added a commit to nmccready/angular-google-maps that referenced this issue Dec 2, 2014
specs to verify delayed updates
- reference update
- direct model changes (within the models array)
MockMarker fixes to make setOptions mutable with position
@nmccready nmccready added PR'd and removed in progress labels Dec 2, 2014
@nmccready
Copy link
Contributor

@grahamj yes it is confirmed with a PR fix

@nmccready
Copy link
Contributor

Along with specs to check it for now on.

@grahamj
Copy link

grahamj commented Dec 2, 2014

Great thx!

@nmccready
Copy link
Contributor

This is going to take a little extra work if you want it fixed on the 2.0.X branch. The work i did that resolves this issue has been considered 2.1.X . So I need to backtrace some fixes to 2.0.X . But this will be one of the last commit sets for 2.0.X.

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

Successfully merging a pull request may close this issue.

3 participants