如何在 bing 地图图钉中显示多行文本?
How to display multiple lines of text in bing maps pushpin?
我正在将带有 foreach 循环的图钉添加到地图,如下所示:
Pushpin p = new Pushpin() { Location = new Microsoft.Maps.MapControl.WPF.Location { Latitude = n.latitude, Longitude = n.longtitude} };
我的 class 看起来像这样:
public class Address
{
public int ID { get; set; }
public string companyName { get; set; }
public string address { get; set; }
public string street { get; set; }
public string houseNumber { get; set; }
public double longtitude { get; set; }
public double latitude { get; set; }
}
如何将地址 class 中的其他数据添加到图钉,使其看起来像这样?
Pushpin
您链接的图片是一个信息框。我建议的是创建一个自定义的 UIControl,它看起来像您想要的那样,然后将其添加到地图中,而不是试图破解图钉 class。这是一个代码示例:
https://msdn.microsoft.com/en-us/library/hh868032.aspx
尝试使用带有背景颜色的网格来启动和添加您的文本字段。
我正在将带有 foreach 循环的图钉添加到地图,如下所示:
Pushpin p = new Pushpin() { Location = new Microsoft.Maps.MapControl.WPF.Location { Latitude = n.latitude, Longitude = n.longtitude} };
我的 class 看起来像这样:
public class Address
{
public int ID { get; set; }
public string companyName { get; set; }
public string address { get; set; }
public string street { get; set; }
public string houseNumber { get; set; }
public double longtitude { get; set; }
public double latitude { get; set; }
}
如何将地址 class 中的其他数据添加到图钉,使其看起来像这样? Pushpin
您链接的图片是一个信息框。我建议的是创建一个自定义的 UIControl,它看起来像您想要的那样,然后将其添加到地图中,而不是试图破解图钉 class。这是一个代码示例:
https://msdn.microsoft.com/en-us/library/hh868032.aspx
尝试使用带有背景颜色的网格来启动和添加您的文本字段。