?
Solved

Using Google maps with Postcode field from Delphi

Posted on 2007-11-26
4
Medium Priority
?
1,033 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

764 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