Mega Search
23.2 Million


Sign Up

Make a donation  
Starting web browser with map url for specific coordinate?  
News Group: embarcadero.public.delphi.internet.winsock

I wonder if it is possible to launch the default browser from a Delphi
2007 application such that it will show Google Maps with a specific
Lat/Long position centered?

I am trying to create a utility that should help a friend to locate
his lot corner marks using GPS. He knows the delta coordinates (in
meters of the national grid) for all of the (irregular) corners of his
lot. But the actual markers are not easily visible so he asked me to
make some help function for him.

Since I have already created a conversion utility between UTM
coordinates to Lat/Long I can calculate the positions in UTM given the
Lat/Long of one marker (which he has located) and using the deltas to
all of the others by simple arithmetic. And then finally convert these
back to Lat/Long again.

The idea is for him to put the GPS on the known marker and wait until
he has a good fix. Then use the helper and enter the fix (Lat/Long)
and let the utility calculate the other marker Lat/Long positions.
So far I think I have it all covered.
Next he would like to be able to walk over to the correct spot using
the PC GPS and start looking there (hopefully within a couple of
meters).

So now I would like to make it possible to click a position in the
calculations and then launch the default browser on his PC to Google
Maps with the requested marker position centered/highlighted.
Can't figure out how this should be done:
- How do I launch the browser? By shell-execute an URL file?
- How do I direct it to show Google Maps on the requested position?

And is this the right sub-forum for such a question????

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 2-Jan-2015, at 1:29 AM EST
From: Bo Berglund
 
Re: Starting web browser with map url for specific coordinat  
News Group: embarcadero.public.delphi.internet.winsock
> But now there is no marker for the actual position...
> The marker is needed in order to walk to the correct spot.

You need to use Javascript to control the Google Maps API properly, to add
lines and markers to maps.  

Using the Google Maps API V3 from Delphi.  You can either embed the browser
in your Delphi application and control it, or generate HTML code for an
external browser.  

This blog has several articles that will get you started. 

http://theroadtodelphi.wordpress.com/2010/08/07/using-the-google-maps-api-v3
-from-delphi-part-i-basic-functionality/

Beware when enbedding the browser that it's hard to avoid popup errors. 

Angus

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 2-Jan-2015, at 6:34 AM EST
From: Angus Robertson
 
Re: Starting web browser with map url for specific coordinat  
News Group: embarcadero.public.delphi.internet.winsock
On Fri, 2 Jan 2015 02:42:32 -0800, Linden ROTH <> wrote:

>
>Shellexec {code} https://www.google.com.au/maps/@-33.8597527,151.2215808,21z {code} job done

Thanks,
I tried it after removing the .au part and changing to my coordinates.
But now there is no marker for the actual position...
The marker is needed in order to walk to the correct spot.

But I am investigating the various url compositions now.
This variation seems to work and gives me a marker too:
{code}https://maps.google.com/maps?z=20&q=-33.8597527,151.2215808{code}
The z parameter seems to designate the zoom factor.

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 2-Jan-2015, at 3:34 AM EST
From: Bo Berglund
 
Re: Starting web browser with map url for specific coordinat  
News Group: embarcadero.public.delphi.internet.winsock
> {quote:title=Bo Berglund wrote:}{quote}
> I wonder if it is possible to launch the default browser from a Delphi
> 2007 application such that it will show Google Maps with a specific
> Lat/Long position centered?
> 
> I am trying to create a utility that should help a friend to locate
> his lot corner marks using GPS. He knows the delta coordinates (in
> meters of the national grid) for all of the (irregular) corners of his
> lot. But the actual markers are not easily visible so he asked me to
> make some help function for him.
> 
> Since I have already created a conversion utility between UTM
> coordinates to Lat/Long I can calculate the positions in UTM given the
> Lat/Long of one marker (which he has located) and using the deltas to
> all of the others by simple arithmetic. And then finally convert these
> back to Lat/Long again.
> 
> The idea is for him to put the GPS on the known marker and wait until
> he has a good fix. Then use the helper and enter the fix (Lat/Long)
> and let the utility calculate the other marker Lat/Long positions.
> So far I think I have it all covered.
> Next he would like to be able to walk over to the correct spot using
> the PC GPS and start looking there (hopefully within a couple of
> meters).
> 
> So now I would like to make it possible to click a position in the
> calculations and then launch the default browser on his PC to Google
> Maps with the requested marker position centered/highlighted.
> Can't figure out how this should be done:
> - How do I launch the browser? By shell-execute an URL file?
> - How do I direct it to show Google Maps on the requested position?
> 
> And is this the right sub-forum for such a question????

Shellexec {code} https://www.google.com.au/maps/@-33.8597527,151.2215808,21z {code} job done

--
Linden
"Mango" was Cool but "Wasabi" was Hotter but remember it's all in the "source"

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 2-Jan-2015, at 2:42 AM EST
From: Linden ROTH