i want to make a program which is connected to google maps and take input in form of (eg: location) and search it through webbrowser component???
shubham05 0 Newbie Poster
Dani AI
Generated
Short answer: host a small HTML page that uses the Google Maps JavaScript API (or use Google Maps URLs for a quick no-key option) and show that page in VB6’s WebBrowser control. ’s two-pane UI idea is correct — the extra pieces are API/billing requirements, origin/referrer rules, and practical VB6 tactics to load the page. Get started with Maps Platform · Maps URLs guide. (developers.google.com)
Key checklist before you code: 1) Most Maps Platform features now require an API key and a billing-enabled project, so enable the right APIs and attach a key. 2) The JavaScript client won’t behave from file:// pages — serve your HTML over HTTP (localhost is fine for development). 3) If you restrict the key, add your localhost referrer (or use an unrestricted dev key briefly, but restrict before shipping). See the Maps JavaScript troubleshooting and error docs. (developers.google.com)
Minimal VB6 approaches you can apply immediately:
- Fast, no-key (opens Maps in the embedded browser): build a Maps URL and Navigate the control.
- Full embed (search + drawn route): host map.html (served on localhost) that loads the Maps JS API + DirectionsService, then Navigate to that URL from VB6.
Example VB6 snippets:
' Open Maps directions (no API key needed)
Private Sub cmdGo_Click()
Dim url As String
url = "https://www.google.com/maps/dir/?api=1&origin=" & Replace(txtFrom.Text," ","+") & "&destination=" & Replace(txtTo.Text," ","+")
WebBrowser1.Navigate url
End Sub ' Load local hosted HTML (recommended for Maps JS)
Private Sub cmdOpenLocal_Click()
WebBrowser1.Navigate "http://localhost:8000/map.html"
End Sub For writing HTML directly into the WebBrowser (about:blank → Document.Write) use the readyState loop before Document.Write; that pattern is common in VB6 examples. If you use the JS API, serve over (for example with python -m http.server) and include your API key in the script loader. (stackoverflow.com)
Troubleshooting hints: dark/”for development purposes only” maps or console errors usually mean missing/invalid key, billing not enabled, or referrer restrictions (MissingKeyMapError, RefererNotAllowedMapError). Check the browser console and the Maps error docs for the exact code and fix. (developers.google.com)
Links above point to the current Maps docs and common VB6 patterns; they provide the smallest, most reliable path to implement ’s UI while expanding on ’s HTML-in-WebBrowser approach.
rothfarb 0 Newbie Poster
The solution includes the following steps:
1. Make a form in which you have 2 parts:
a. A panel with controls to input all the needed parameters and a submit control.
b. An Html control to show the results (See: https://developers.google.com/maps/tutorials/fundamentals/adding-a-google-map or google more).
2. After the user enters all parameters and presses "Submit"
the "submit" code (if the submit button is called btnSubmit then the code is in: sub btnSubmit_Click) does the following:
a. Creates the proper html
b. Runs the html control with that html (See: http://www.techrepublic.com/forums/discussions/use-of-webbrowser-control-in-vb6-to-read-a-local-html-file/ or google more).
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.