按类型创建Google地图集群 [英] Creating Google Maps Clusters by type
问题描述
我想知道是否可以在Google地图上集中市场,不仅可以通过密度或数量,而且还可以按类型集中。
例如:我有A型有20个标记,B型有50个。我可以有两个不同的聚类,一个是所有A型标记,另一个是B型标记。显然有不同的图标。另一种可能的解决方案是单个群集,它的图标会根据类型的标记数量而变化。
例如:如果我们有20个标记类型A和50个类型B,则该集群将是B型图像。
这些选项中的任何一个都可能?
非常感谢。
是的,您可以有不同的 MarkerClusterer
用于不同类型的标记。我的地图有七个不同的 MarkerClusterer
实例(我实际使用: MarkerClustererPlus )管理不同的标记类型,并用不同的图标描述您的身影。 >可以实现你的第二个选项,但是它会有一些混乱的代码,通过不断的检查,重新检查和设置 MarkerClusterer
选项。我强烈推荐第一个选项。
I would like to know if it is possible to cluster markets on Google Maps not only by density or number, but also by type.
For example: I have 20 markers of type A and 50 of type B. Could I have a two different clusters, one grouping all the type A markers and another one with type B markers. Obviously with different icons.
Another possible solution would be a single cluster that its icon would change depending of the number of markers of type.
For example: if we have 20 markers type A and 50 type B, the cluster would be a B-Type image.
Any of this options can be possible? Thanks a lot.
Yes, you can have a different MarkerClusterer
for different types of markers. My map has seven different MarkerClusterer
instances (I actually use: MarkerClustererPlus) managing different marker types, with different icons as you describe.
You could achieve your second option, but it would be some messy code with constant checking, re-checking, and setting of MarkerClusterer
options. I strongly recommend the first option.
这篇关于按类型创建Google地图集群的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!