-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[r1-dev] Feature/many markers issue 69 #83
[r1-dev] Feature/many markers issue 69 #83
Conversation
the js only had prior
- it is following the Interface IMarker
a marker defines watches. However certain watches are enforced, along with required properties.
- fixed destroy bug in marker.coffee
- hashing out Markers some more with MarkerModel, commented out as there is a bug currently
- IWindow - Window .models - WindowModel - WindowModelFunctions Windows to come
… -> and not => as no self references needed.[C
…s scope. This way Windows can listen in on Markers models to know when to clear its models.
…hey all share one Logger from directives.api.util.Logger which can turn on and off info logging by doLog flag.
Hmm, let me try to explain it better. I currently have this setup:
@note that I am storing more in my markers than just their coords. Question is, how would I convert this to utilize the new format you created:
Does this make it more clear? |
As long as it is in your model you should be able to get to it.
|
Ahh
|
You wrap whatever you want in ng-nonbindable as the interpolation is being put off to be done by the WindowParentModel for each child. |
Got it, thanks for the help! On Thu, Aug 15, 2013 at 1:10 PM, nmccready [email protected] wrote:
Matt Miller faculty 2424 E. York Street |
np |
Guys.. I just had an epiphany!
This eliminates the need for Windows unless you really want all of them loaded in memory ... why? This is dynamic as long as a controller somewhere has an activeMarkers array. This also could eliminate the logic for having window as a child of a marker directive. I think this is a good idea cause it eliminates complexity on both sides. BTW there is a bug if you do not use ng-repeat in Window. This bug is only if you expect the html content to change in a Window for the {{}} side of things. If you do not use ng-repeat the content is not re-evaluated if the model changes. See Below.
With that above scenario the Window will move and show as it is supposed to. BUT the html will not get evaluated by angular. If you use ng-repeat it forces it the redo the html! This is how I came to the top solution. |
Matt what is your twitter? |
This is all very interesting. Just reviewed the code. I've got a many-markers app that uses direct api calls instead of the r1-dev marker directive, and it's working fine. However, would like to branch off and then build an implementation that would use the directive and test it. Nice work, @nmccready ! |
It is still got some weight to it as I would like it to be faster. The direct api calls are still way faster. I need to see what Matt sent me earlier. |
@nmccready find me on twitter @mattmillerart |
@nmccready I like the thinking behind |
@nmccready any progress on the window functionality? Not sure if 1ee4fab addressed it... |
No I am not sure how we should proceed with my recommendations above. This is because this is at a high level where a controller that contains activeMarkers is created by some one using our library. I am not sure if we should make a basic GoogleMapsController available or not. Due to the fact that this would force functionality on the user. The commit from above is trying to make MarkerChildModel slimmer. I also think I can eliminate the watches for icon, coords and maybe more in MarkerChild model. They all seems to be caught in the watch 'model' . I will experiment some more, but it could be due to watch using the deep watch argument being set to true. |
I just switched up some logic in MarkerChildModel to use watches much less. This results in less traverses in angular. |
Matt,
This can get rid of the whole key stuff that is in our markers currently. As this allows the expression to be evaluated on our terms. |
I don't particularly like how the author uses:
The |
Yeah I'm not alluding to changing the click behavior, but just how we get to the model objects properties. It would be nice to have some of the attrs be able to grab from the parent scope or controller. This would be instead of being locked to model for each attribute. |
@nmccready I'm using the above "separate window" recommendation, but the window is appearing over the (custom) icon. Will I have to do the offset myself or is this solvable in another way? |
Use window options to set the offsets. It is documented in the google sdk for infowindow options |
This is a major change and I am expecting some flak for moving to CoffeeScript. However, the performance improvements to not using the DOM as much for Markers and Windows is improved. There are areas for improvement, but the discussion for what to do next needs to start.
The areas for improvement specifically are in Windows and Markers "models" watchers. I am currently throwing in a size check (newValue.length != oldValue.length) as not rebuild the models when it is not necessary. Also the new api is more complicated, but the goal was to force some common functionality on common directives and model relationships.