Sencha touch 2:地图标记标题

时间:2012-05-09 06:57:56

标签: google-maps sencha-touch extjs google-maps-markers sencha-touch-2

我可以在地图上添加标记,标记图钉就可以了,但我看不到任何标题!

我遍历我的商店并按照以下方式添加:

           //plot the points on the map
           for (var i = 0; i < this.getCount(); i++)
           {                 
               var position = new google.maps.LatLng(this.getAt(i).data.Latitude, this.getAt(i).data.Longitude); 
               var marker = new google.maps.Marker({
                    position: position,
                   title : this.getAt(i).data.LocationDesc,
                   map: Ext.ComponentManager.get('jobmap').getMap()
               });
           }

我看到了针脚,但没有文字标题!数据还可以,我甚至尝试过硬编码字符串。是否有某种覆盖/掩码属性?如何显示标题?

编辑:以下解决方案解决了这个问题,但我也认为我会解决相关问题的解决方案。

如果您想在多个标记上放置弹出信息窗口,则需要阅读:Trying to bind multiple InfoWindows to multiple Markers on a Google Map and failing

在您将字体设为非白色之前,infoWindows将为空白! Google Maps API InfoWindow not Displaying content

1 个答案:

答案 0 :(得分:0)

正如您在MarkerOptions Docs中看到的, title的{​​{1}}属性被视为marker文字。

我想知道,在rollover设备上可以看到它,如果没有像smartphone这样的事件?

我认为您需要在地图mouseover infoWindow上打开一些click

你可以这样做,

pins/markers

然后侦听标记上的click事件,

var infoWindow = new google.maps.InfoWindow({ content:'_address_' }),
相关问题