Last post Apr 11, 2013 05:41 PM by smirnov
Apr 10, 2013 10:45 PM|adaam2|LINK
I have just got my Gmap control working and have implemented it as part of a form where the user inputs their location for the event they are planning (it's a book club meeting website) and a little google maps preview pops up with their location and the
placemarker. I would like to insert the coordinates of the address that they have just entered into the database and retrieve those coordinates at a later date.
I hope someone here is familiar with Subgurim GMap as I'm definitely not!
Anyway here is my client side code:
<p style="text-align:right; margin-right:300px">
<asp:textbox ID="txtStreetAddress" runat="server" Width="150px" /><br />
<asp:textbox ID="txtSuburb" runat="server" Width="150px" /><br />
<asp:textbox ID="txtCountry" runat="server" Width="150px" /><br /><br />
<asp:Button Text="Show On Map" ID="lnkShowMap" runat="server" />
<cc1:GMap ID="GMap1" runat="server" GZoom="4" Height="200px" Width="250px" />
And here is my subroutine:
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim conn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("BookMeetConnString").ConnectionString)
Dim cmd As New OleDbCommand("INSERT INTO Events (EventTitle, EventDescription, EventDate, EventCategory, CreatedBy, Coordinates) VALUES (@f1,@f2,@f3,@f4,@f5,@f6)", conn)
cmd.Parameters.AddWithValue("@f3", DateTime.ParseExact(tb_eventdate.Text, "dd/MM/yyyy", CultureInfo.InvariantCulture))
cmd.Parameters.AddWithValue("@f4", dd_eventcategory.SelectedIndex + 1)
As you can see, I haven't got very far with the Gmap (@f6) parameter. This is where you guys come in!
VB.NET responses preferred!, or error-free C# will suffice as long as I can convert it!
Thanks in advance,
Apr 11, 2013 05:41 PM|smirnov|LINK
If you look at
their web site, you can get an example of the inverse Geocoding. There is the initialPoint property, which is probably you can use too.
Hope this helps.