简体   繁体   English

GMap subgurim.net仅显示灰色框

[英]GMap subgurim.net showing grey box only

this is my code, taking latitude and longitude from database and showing to gmap tool. 这是我的代码,从数据库中获取经度和纬度并显示给gmap工具。 Its running without any error and i can see the data also getting correct, but not showing any map on the display only grey box with powered by subgurim window. 它的运行没有任何错误,我可以看到数据也越来越正确,但是在仅显示带有由subgurim窗口供电的灰色框上未显示任何地图。 do i need to add anything else with this to see the maps. 我需要添加其他东西才能查看地图吗?

  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); } 

Please help me to find solution. 请帮助我找到解决方案。 thanks in advance. 提前致谢。

I was supplying only latitude , but the data was both latitude and longitude. 我只提供纬度,但是数据既是纬度又是经度。 change the code to below working fine now. 将代码更改为现在可以正常工作。

  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); } } 

Same time i put the key to html code also. 同时我也把关键放在html代码上。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM