gpt4 book ai didi

c# - GMap subgurim.net 仅显示灰色框

转载 作者:太空宇宙 更新时间:2023-11-03 14:53:43 27 4
gpt4 key购买 nike

这是我的代码,从数据库中获取纬度和经度并显示给 gmap 工具。它运行没有任何错误,我可以看到数据也变得正确,但没有在显示器上显示任何 map ,只有灰色框由 subgurim 窗口提供支持。我需要添加任何其他内容才能查看 map 吗?

 GLatLng mainLocation = new GLatLng(20.300000099999997, 50.4000000);
GMap1.setCenter(mainLocation, 15);

XPinLetter xpinLetter = new XPinLetter(PinShapes.pin_star, "S", Color.Blue, Color.White, Color.Chocolate);
GMap1.Add(new GMarker(mainLocation, new GMarkerOptions(new GIcon(xpinLetter.ToString(), xpinLetter.Shadow()))));

GeoLocationDB objLocationDB = new GeoLocationDB();
GeoLocationList objLocationList = new GeoLocationList();
DateTime dt1 = new DateTime();
dt1 = new DateTime(Convert.ToInt32(txtDatePicker.Text.Split('/')[2].ToString()), Convert.ToInt32(txtDatePicker.Text.Split('/')[1].ToString()), Convert.ToInt32(txtDatePicker.Text.Split('/')[0].ToString()));
DateTime dt2 = new DateTime();
dt2 = new DateTime(Convert.ToInt32(txtDatePicker1.Text.Split('/')[2].ToString()), Convert.ToInt32(txtDatePicker1.Text.Split('/')[1].ToString()), Convert.ToInt32(txtDatePicker1.Text.Split('/')[0].ToString()));

objLocationList = objLocationDB.GetListBySearch(txtStaff.Text,dt1,dt2);

PinIcon p;
GMarker gm;
GInfoWindow win;
foreach (var i in objLocationList)
{
p = new PinIcon(PinIcons.car, Color.Cyan);
gm = new GMarker(new GLatLng(i.Longitude),
new GMarkerOptions(new GIcon(p.ToString(), p.Shadow())));

win = new GInfoWindow(gm, i.ShopName + " <a href='" + i.Address + "'>Address...</a>", false, GListener.Event.mouseover);
GMap1.Add(win);
}

请帮助我找到解决方案。提前致谢。

最佳答案

我只提供纬度,但数据是纬度和经度。现在将代码更改为以下工作正常。

   GLatLng mainLocation = new GLatLng(20.300000099999997, 50.4000000);
GMap1.setCenter(mainLocation, 15);

XPinLetter xpinLetter = new XPinLetter(PinShapes.pin_star, "S", Color.Blue, Color.White, Color.Chocolate);
GMap1.Add(new GMarker(mainLocation, new GMarkerOptions(new GIcon(xpinLetter.ToString(), xpinLetter.Shadow()))));
GMap1.addControl(new GControl(GControl.preBuilt.GOverviewMapControl));
GMap1.addControl(new GControl(GControl.preBuilt.LargeMapControl));

GeoLocationDB objLocationDB = new GeoLocationDB();
GeoLocationList objLocationList = new GeoLocationList();
DateTime dt1 = new DateTime();
dt1 = new DateTime(Convert.ToInt32(txtDatePicker.Text.Split('/')[2].ToString()), Convert.ToInt32(txtDatePicker.Text.Split('/')[1].ToString()), Convert.ToInt32(txtDatePicker.Text.Split('/')[0].ToString()));
DateTime dt2 = new DateTime();
dt2 = new DateTime(Convert.ToInt32(txtDatePicker1.Text.Split('/')[2].ToString()), Convert.ToInt32(txtDatePicker1.Text.Split('/')[1].ToString()), Convert.ToInt32(txtDatePicker1.Text.Split('/')[0].ToString()));

objLocationList = objLocationDB.GetListBySearch(txtStaff.Text, dt1, dt2);

PinIcon p;
GMarker gm;
GInfoWindow win;
foreach (var i in objLocationList)
{
p = new PinIcon(PinIcons.car, Color.Cyan);
string str = i.Latitude;
string[] values = str.Split(',');
for (int s = 0; s < 1; s++)
{
double lang =Convert.ToDouble(values[0].Trim());
double longi = Convert.ToDouble(values[1].Trim());

gm = new GMarker(new GLatLng(lang,longi),
new GMarkerOptions(new GIcon(p.ToString(), p.Shadow())));

win = new GInfoWindow(gm, i.ShopName + " <a href='" + i.Address + "'>Address...</a>", false, GListener.Event.mouseover);
GMap1.Add(win);

}
}

同时我也把 key 放到了 html 代码中。

<cc1:GMap ID="GMap1" runat="server" Width="600px" Height="500px"
enableHookMouseWheelToZoom="True" mapType="MapMaker_Normal" Key="abcd"

关于c# - GMap subgurim.net 仅显示灰色框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50640162/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com