Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using Google maps with Postcode field from Delphi

Posted on 2007-11-26
4
Medium Priority
?
1,034 Views
Last Modified: 2014-07-18
Hi Experts,

I have an application which contains a postcode.
What I need to do is to have a button called "Get Directions" for example and Click on it and search google Maps for the Postcode on the TEdit and open it in the browser.

I know it's possible but I just don't know how to do it!

Hope you can help!

Thanks

ST3VO
 
0
Comment
Question by:ST3VO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
Steven-Fernandez earned 2000 total points
ID: 20349672
Here you are.

This is an example where you insert the postcode on a TEdit Component.

Don't forget to add the "ShellAPI" unit to uses.


procedure TForm1.Button1Click(Sender: TObject);
 var s: string;
begin
s:=('http://maps.google.com/maps?f=q&hl=en&geocode=&time=&date=&ttype=&q='+Edit1.text+'+&ie=UTF8&z=16&iwloc=addr&om=1');
ShellExecute(self.WindowHandle,'open',PChar(s),nil,nil, SW_SHOWNORMAL);
end;

Open in new window

0
 

Author Comment

by:ST3VO
ID: 20349680
Perfect!!!

Thanks a million!!!

ST3VO
0
 

Author Closing Comment

by:ST3VO
ID: 31410951
Perfect!!!
0
 

Expert Comment

by:Delphiwizard
ID: 40203973
Code from Steven Fernandez can now be changed to:
uses ShellAPI;

procedure TForm1.Button1Click(Sender: TObject);
var s : string;
begin
  s := ('https://www.google.nl/maps/place/' + Edit1.text);
  ShellExecute(self.WindowHandle,'open',PChar(s),nil,nil, SW_SHOWNORMAL);
end;

Open in new window

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question