Setting latitude/longitude in code-behind

May 23, 2011 at 9:16 PM

I'm tryng to set the coordinates fo the map during the Page_Load event but the map control just shows gray. If I set the latitude and logitude directly in the markup, the location displays, but setting in the code behind doesn't seem to work. Is there another method I need to call? I have this in the markup:

<artem:GoogleMap ID="locationMap" runat="server" 
            Width="300px" Height="300px" 
            Zoom="4" EnableScrollWheelZoom="true"/>
An this in the code behind.

            locationMap.Latitude = housing.Latitude;
            locationMap.Latitude = housing.Longitude;
            locationMap.Markers.Add(new GoogleMarker(housing.Latitude, housing.Longitude){Text = housing.FullAddress});