Anonymous user  |  Log in  |  Create Account
Message inside Help

Blank map using GMarker

Answer 
#1 - 5/30/2017 7:05:03 PM Reporta abuso | PermaLink
eddirae
Fecha de registro: 3/21/2009
2 posts en todos los foros
Blank map using GMarker

Answer Quote
Hello,
I am new to creating Google Maps on a websites.

I am getting a blank map.

I have tried to get this to work, but I am not sure what to look for.

I have the procedure that is in my program that is adding markers to the map.

I know the reverse geocoding is working because when I debug, I am seeing the longitute and latitude values correctly.

I have added my coding below.

Any help would be greatly appreciated.

Protected Sub cmdMapIt_Click(sender As Object, e As EventArgs) Handles cmdMapIt.Click        Dim strAddress As String        Dim iCntr As Integer        If ddlStart.SelectedItem.Value = "0" Then            txtMsg.Text = "You must select a starting address"            txtMsg.Visible = True            Exit Sub        Else            txtMsg.Text = ""            txtMsg.Visible = False        End If        'Initialize Google Map        GMap1.enableDragging = False        GMap1.Language = "es"        GMap1.BackColor = Drawing.Color.White        SetStartPosition()        'Add Starting Point to map as a BLUE marker        strAddress = txtOtherStart.Text                AddMarker(strAddress, True)        iCntr = gvMapLeads.Rows.Count        For i As Integer = 0 To iCntr - 1            strAddress = gvMapLeads.Rows(i).Cells(2).Text & " " & gvMapLeads.Rows(i).Cells(4).Text & " " & gvMapLeads.Rows(i).Cells(5).Text & " " & gvMapLeads.Rows(i).Cells(6).Text            AddMarker(strAddress, False)        Next i        GMap1.Visible = True    End Sub

Protected Sub AddMarker(ByVal strAddress As String, bStartLoc As Boolean) Dim GoogleKey As String Dim GeoCode As Subgurim.Controles.GeoCode GoogleKey = ConfigurationManager.AppSettings.Get("googlemaps.subgurim.net") GeoCode = GMap1.getGeoCodeRequest(strAddress, GoogleKey) Dim gLatLng As New Subgurim.Controles.GLatLng(GeoCode.Placemark.coordinates.lat, GeoCode.Placemark.coordinates.lng) If bStartLoc = True Then GMap1.setCenter(gLatLng, 16, Subgurim.Controles.GMapType.GTypes.Normal) End If Dim oMarker As New Subgurim.Controles.GMarker(gLatLng) GMap1.Add(oMarker) End Sub

<%@ Register assembly="GMaps" namespace="Subgurim.Controles" tagprefix="cc1" %> <cc1:GMap ID="GMap1" runat="server" Version="3" Visible="True" Width="500px" Height="500px" />




























Top


Powered by Subgurim.NET