ASPX templates
Version 4.x > ASPX templates > Google map not rendering in Geomapping web part View modes: 
User avatar
Certified Developer 9
Certified Developer 9
jkh80 - 11/26/2009 10:43:31 AM
   
Google map not rendering in Geomapping web part
I have added the GoogleMaps web part to a page template and I am having some trouble getting it to work properly. This page template is being used to render a custom document type I have created, to which I have added Latitude and Longitude fields, both of type Decimal.

In my page template, this is the markup for the web part:


<uc1:GoogleMaps ID="GoogleMaps1" runat="server"
GoogleMapsKey="ABQIAAAAGTAd5fdgdjMBbtyfxE4qixQQ_Mk-dH522FZHkubuoPKVeHrrqxTjJtIhI-VzyuDNfrasogA7x9BxUg"
Width="500"
Height="400"
Scale="8" />


In my page template code-behind, I am setting the Latitude and Longitude properties in the Page_Load method:


DataRow row = CMSContext.CurrentDocument.DataRow;
GoogleMaps1.Latitude = Convert.ToDouble(row["Latitude"]);
GoogleMaps1.Longitude = Convert.ToDouble(row["Longitude"]);


When the page template renders, the Google Maps widget appears, but it doesn't actually display a map. All I get is a greyed-out area instead of a map, and no errors are thrown.

Here's an image of it:
User image

Any ideas?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 12/2/2009 7:46:36 AM
   
RE:Google map not rendering in Geomapping web part
Hi,

Could you please check the value of "Convert.ToDouble(row["Latitude"]);" and "Convert.ToDouble(row["Longitude"]);"?

It seems that it is returning invalid values - I am getting the gray map if I set these fields to nonsense values for longitude and latitude.

Best Regards,
Juraj Ondrus