Open tianxu0836 opened 8 years ago
Look at the documentation on getPlurals
and control
I don't see any example about how to use this control thing and getPlurals. by the way, I think it doesn't support multiple ui-gmap-markers tags in one map really well, so I assugme I can only assign one markerControl to one ui-gmap-markers. what if I have multiple ui-gmap-markers with different clusters? it seems like no way to solve it? How can I use one logic for dynamic updated the options for each marker in each ui-gmap-markers depending on each marks' id?
Can you make an example on the problem your trying to solve. Then I may be able to better assist you. If you have multiple ui-gmap-markers you are right they are all unique sets. So that is your issue to deal with.
Here is what I'm doing:
<ui-gmap-markers models="group.items" ng-repeat="group in Groups" idkey="'Uid'"
options="{icon: getIcon(thisModel, map.zoom)}" type="'cluster'"
typeoptions='{"title":group.Name, gridSize: 175,"ignoreHidden":true,averageCenter: true,"minimumClusterSize":getMinimumClusterSize(group.items), styles: getClusterStyle(group)}'
coords="'self'" icon="'icon'">
</ui-gmap-markers>
each item in each group has a Uid. I need to show the marker icon based on the Uid. each mark have its own icon.
I need to have one cluster per group. cluster minimum size depends on how many visible items in each group.
I will also need to manually calculate the marker icon size based on the zoom level.
options="{icon: getIcon(thisModel, map.zoom)}"
not sure if that part will work. But you should be able to do options="getOptions"
.
##controller
getOptions: (model) ->
#do stuff with your model and derive options with map.zoom and etc..
Still would be easier for me to tinker in a plnkr that you setup.
Yes, options="getOptions" works for me, but if what if I need to calculate and update the options while I'm zooming?
Then track zoom with watches and or google map events. Modify the options there and it should trigger a digest, which will call getOptions again.
As for your clustering problems; you will need to dive into the clustering code and look at calculate.
I'm trying to load icon for each mark. each mark's icon is different.
I have a function "getIcon", it will needs the uid from each binding model(item.Uid).
If I pass "this" to getIcon, it is undefined.
It seems like there is no way to find the current model.
I will have to use "ui-gmap-markers" here not "ui-gmap-marker"
This options works really weird.