1 (edited by AD1408 2017-09-29 20:46:37)

Topic: Google Maps

Using Derek's contacts app for Google maps search.

It uses search by postal / zip code and works fine.
I wanted to add address to search to locate street  too beside postal code as some parts of the world there may not be established postal codes.
I have tried the following but couldn't get the syntax right.
Could somebody correct it please?


procedure Form1_Button7_OnClick (Sender, v1, v2: string; var Cancel: boolean);  //** check on google maps
begin
  v1 := 'https://www.google.com/maps/?q=' ;
  v2 := (sqlexecute('select street from people where id = ' + inttostr(form1.tablegrid1.dbitemid)))
  and
  (sqlexecute('select postcode from people where id = ' + inttostr(form1.tablegrid1.dbitemid)));
  openurl(v1+v2);
end;
Adam
God... please help me become the person my dog thinks I am.

Re: Google Maps

The following seems to be almost working:


procedure Form1_Button7_OnClick (Sender, v1, v2, v3: string; var Cancel: boolean);
begin
  v1 := 'https://www.google.com/maps/?q=' ;
  v2 := sqlexecute('select street from people where id = ' + inttostr(form1.tablegrid1.dbitemid)); // Searching for street (1 OXBOW CL)
  v3 := sqlexecute('select postcode from people where id = ' + inttostr(form1.tablegrid1.dbitemid)); // Searching for post code (NG2 2NN)
  openurl(v1+v2+v3);
end;

However, I couldn't get search query displayed on Google maps search box correctly.
It's displayed as: 1 OXBOW CLNG2 2NN
It needs to send search query as: 1 OXBOW CL, NG2 2NN


Tried various things but couldn't get it to include comma and space after street  in search query. Please help....

Adam
God... please help me become the person my dog thinks I am.

Re: Google Maps

Just add the literal between V2 and V3


openurl(v1+v2+', '+v3);

Re: Google Maps

Hi EHW,


Thank you very much for the help................


I was trying to add that literal between sqlexecute lines due to lack of proper understanding at my end.

Adam
God... please help me become the person my dog thinks I am.