-
Notifications
You must be signed in to change notification settings - Fork 93
ui-map-marker should create a marker FOR you, instead of merely attach to an existing one. #8
Comments
Do you need to watch the array of markers for changes for this? If so, there is code in ui-calendar that watches arrays and calls onAdded/onChanged/onRemoved |
Right now you have to call I feel this should not be necessary. |
Right. So you watch the array of user-supplied marker, and: onAdded(marker): new google.maps.marker The code that can efficiently watch for array changes and emit those events is in the |
The direction of ui-map is that it doesn't try to take away google's Apis from you: that is too much work. There are a billion ways you could want to create and initialize a marker. The directives just $apply events for you and make them declarative. Andy Joslin On Thu, May 16, 2013 at 10:11 AM, Gleb Mazovetskiy
|
This doesn't take away the ability use native marker api if you want to. Why not offer both options? |
@ajoslin Yeah after my friend got it working I was less concerned with hand-holding the tag creation for you as I realize there are a lot of open questions it raises. I still think it would be nice to try dabbling with however in a simplistic manner (you pass the entire object to the child tag as an attribute, and the linking takes care of the timing, instead of For now though I think it's more important to clean up the docs and provide an example of loading the map with markers pre-populated. |
Yeah, if there is a better way, definitely do it!! |
By the way, looks like this implementation does automatic marker binding https://github.com/dylanfprice/angular-gm/blob/master/src/directives/gmMarkers.js |
Kind of annoying if I want to put a few markers onto the page. I think it would be more sensible to do something like this:
The 'map' property would be added automatically to the object, and new markers would be generated for you.
The text was updated successfully, but these errors were encountered: