Results 1 to 5 of 5

Thread: Having trouble finding the correct elements on Google maps web page

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    234

    Having trouble finding the correct elements on Google maps web page

    Hi everyone, I am writing a VB.Net program that uses Google Maps to show the GPS position.
    I am having trouble finding the correct elements to input the Latitude and Longitude to on the search panel.
    Below in my code, which comes up with an error, I think it is because I have the wrong elements:

    Can anybody help me on this one?


    Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    WebBrowser1.Navigate("www.google.com/maps")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    WebBrowser1.Document.GetElementById("searchboxinput").SetAttribute("searchboxinput.value", textbox1.Text)
    End Sub
    End Class
    Attached Images Attached Images  

  2. #2
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Having trouble finding the correct elements on Google maps web page

    Is there a particular reason you need to use the search bar and don't just append the coordinates to the querystring like below?

    https://www.google.ca/maps/place/38°42'05.0"N+9°09'48.3"W

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: Having trouble finding the correct elements on Google maps web page

    I was wonderin the same thing... just pass the cooridinates direclty via the querystirng.


    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    234

    Re: Having trouble finding the correct elements on Google maps web page

    Thank you so much for that advice, of course that's the way to do it.
    Is there anyway I can automatically make the image go straight to satellite image instead of map?
    I also sometimes get a: "do you want to continue to run scripts" message, is there anyway to stop this from appearing?

  5. #5
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Having trouble finding the correct elements on Google maps web page

    I believe for Google maps, you can add "?t=k" to force satellite view.

    So the URL would become:

    https://www.google.ca/maps/place/38°42'05.0"N+9°09'48.3"W?t=k

    As for the allowing scripts, which browser is causing the issue? The only browsers I know that prompt for basic javascript are the older versions of IE, or any IE with tight security permission.

    You could also look into using the Google Maps embed API: https://developers.google.com/maps/d...on/embed/guide
    Last edited by kfcSmitty; Oct 7th, 2014 at 06:40 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width