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

[r1-dev] icon cannot be updated without the need to destroy a marker.. (Window design conflict) #59

Closed
nmccready opened this issue Jul 15, 2013 · 3 comments
Assignees

Comments

@nmccready
Copy link
Contributor

My goal is to show only one open window at a time. Thus, having window.show bound to m.doShow (where m is the marker field doShow evals to true or false). I also tried using a parent scope via using doShow(maker) = function { self.active_marker.index === marker.index} . In any case both resulted to the $scope.watch of 'show()' always evaluating newValue and oldValue as equal. This appears to be a bug with angular itself.

See here.

angular/angular.js#2621

@nmccready
Copy link
Contributor Author

Never-mind I have narrowed this down to being a value vs. reference problem on having certain fields copied over. I have the window show stuff working now by leaving the model's reference intact (without overwriting with a copy). This allows for the show() tracking (watch) to work correctly. However now I have other problems with drawing. This is with where relying on the model being replaced by a copy does not allow the icon to be updated.

@nmccready
Copy link
Contributor Author

This problem surrounds the design of how markers and windows are integrated. Markers will not be redrawn by the google maps api unless the marker is destroyed. This requires the reference to be over written (causes destroy and recreate) with the current design.

However when you do this any other properties that are requiring state changes via scope.watch will not work for each marker. This is because the state has been reset on each overwrite with a new reference. Therefore newValue is always equal to oldValue. So the dilemma here, is how do we redraw a marker without deleting it and keep the scope tracking intact?

@nmccready nmccready reopened this Jul 15, 2013
@nmccready
Copy link
Contributor Author

I think the solution would be to scope.watch icon using the same (or close to) logic that scope watching of 'coords' has.

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

No branches or pull requests

1 participant