Google Maps

Re: Google Maps

Postby Colin Haig » Tue Jan 14, 2014 2:33 am

Tim

If possible can you send me the webmap.prg and any includes if required.



colin@techdata.net.au

Regards

Colin
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: Google Maps

Postby jds » Wed Jan 15, 2014 8:21 pm

I would like also become a copy please to try it
many thanks
jds (not for professional use)
jose.deschutter@skynet.be
jds
 
Posts: 122
Joined: Sat Dec 05, 2009 12:44 pm

Re: Google Maps

Postby TimStone » Wed Jan 15, 2014 8:29 pm

The code is provided by Gale Ford. Here is the link:

http://www.xharbour.com/xhc/index.asp?p ... show_sub=1
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Google Maps

Postby jds » Thu Jan 16, 2014 9:45 pm

Please Rafael, can you send me also a working example
Jose.deschutter@skynet.be
jds
 
Posts: 122
Joined: Sat Dec 05, 2009 12:44 pm

Re: Google Maps

Postby MGA » Mon Jan 27, 2014 8:17 pm

Hi Rafael,
Please you send me also a copy of the DLL.
ubiratan@sgsistemas.com.br
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: Google Maps

Postby Gale FORd » Tue Jan 28, 2014 12:05 am

I am not sure Rafael is responding to the Google map issue any more.
You can download my simple class with examples using link below.
http://www.xharbour.com/xhc/index.asp?page=xhc_download_detail.asp&type=dl&id=146&action=download&show_i=7&show_sub=1
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: Google Maps

Postby TimStone » Tue Jan 28, 2014 1:26 am

Gale,

I see my link that I posted got truncated somehow.

The code works great for me.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: Google Maps

Postby MGA » Tue Jan 28, 2014 11:04 am

Gale Ford,

Can you display only the map in the FiveWin dialog ?

thanks
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Re: Google Maps

Postby Gale FORd » Tue Jan 28, 2014 4:36 pm

I am sure that it could be done using <iframe> tags in the HTML code.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: Google Maps

Postby Gale FORd » Tue Jan 28, 2014 5:46 pm

If you download the webmap class try the sample below. Click the "Show in FW window" button.
I added the <iframe> code to a local html file in ShowInWin() function. This should give you enough ideas to do what you want.

Code: Select all  Expand view  RUN
#include "FiveWin.ch"

static cStreet, cCity, cCountry
static cStreet2, cCity2
static cStreet3, cCity3
static cStreet4, cCity4
static cStreet5, cCity5
static cWhatsNear
static nZoomLevel

function Main()
   local oDlg, oActiveX
   local aWhatsNear

   default cStreet := PadR( "BROADWAY 500", 80 ), ;
   cCity := PadR( "NEW YORK CITY", 80 ), ;
   cCountry := PadR( "USA", 80 ), ;
   cStreet2 := space( 80 ), ;
   cCity2 := space( 80 ), ;
   cStreet3 := space( 80 ), ;
   cCity3 := space( 80 ), ;
   cStreet4 := space( 80 ), ;
   cCity4 := space( 80 ), ;
   cStreet5 := space( 80 ), ;
   cCity5 := space( 80 )
   cWhatsNear := ''
   nZoomLevel := 0

   aWhatsNear := { ;
      '', ;
      'Hotel', ;
      'Gas', ;
      'Food', ;
      'Parks', ;
      'Car Parts', ;
      'Truck Parts', ;
      'Railroads' ;
      }

   DEFINE DIALOG oDlg RESOURCE "map"

   REDEFINE GET cStreet ID 200 OF oDlg

   REDEFINE GET cCity ID 300 OF oDlg

   REDEFINE GET cCountry ID 400 OF oDlg

   REDEFINE COMBOBOX cWhatsNear ITEMS aWhatsNear ID 140 OF oDlg

   REDEFINE GET cStreet2 ID 202 OF oDlg
   REDEFINE GET cCity2   ID 302 OF oDlg
   REDEFINE GET cStreet3 ID 203 OF oDlg
   REDEFINE GET cCity3   ID 303 OF oDlg
   REDEFINE GET cStreet4 ID 204 OF oDlg
   REDEFINE GET cCity4   ID 304 OF oDlg
   REDEFINE GET cStreet5 ID 205 OF oDlg
   REDEFINE GET cCity5   ID 305 OF oDlg

   REDEFINE GET nZoomLevel ID 141 OF oDlg

   REDEFINE BUTTON ID 1 OF oDlg ACTION ShowInWin()
   REDEFINE BUTTON ID 150 OF oDlg ACTION ShowFull()

   ACTIVATE DIALOG oDlg CENTERED

return nil

function ShowFull()
   local oWnd, oActiveX, oBar
   local cEvents := ""
   local oWebMap

   oWebMap := WebMap():new()
   oWebMap:AddStopSep( cStreet, cCity,,, cCountry )
   // you can format address yourself or just
   // type address string like in google maps
   // using :AddStop() instead of :AddStopSep()
   //
   // oWebMap:AddStop( alltrim( cStreet )+','+;
   //    alltrim( cCity )+' '+alltrim( cCountry ) )
   // or
   // oWebMap:AddStop( 'My Address Info' )
   oWebMap:AddStopSep( cStreet2, cCity2 )
   oWebMap:AddStopSep( cStreet3, cCity3 )
   oWebMap:AddStopSep( cStreet4, cCity4 )
   oWebMap:AddStopSep( cStreet5, cCity5 )

   oWebMap:cWhatsNear := cWhatsNear
   oWebMap:nZoomLevel := nZoomLevel
   oWebMap:GenLink()
   if .not. empty( oWebMap:cLink )

       //oWebMap:cLink, ShellExecute( 0, "open", oWebMap:cLink,,,5 )
       //tracelog( oWebMap:cLink, ShellExecute( nil, "open", oWebMap:cLink,0,0,1 ) )

      // You can also use this for more control

      oActiveX := TOleAuto():New("InternetExplorer.Application")
      oActiveX&#058;Visible := .T.
      oActiveX&#058;Toolbar := .T.
      oActiveX&#058;Statusbar :=.T.
      oActiveX&#058;MenuBar := .T.
      oActiveX&#058;Navigate( oWebMap:cLink )
      */

      sysrefresh()

   endif

return nil
function ShowInWin()
   local oWnd, oActiveX, oBar
   local cEvents := ""
   local oWebMap
   local cHtml, cHtmlFile

   oWebMap := WebMap():new()
   oWebMap:AddStopSep( cStreet, cCity,,, cCountry )
   oWebMap:AddStopSep( cStreet2, cCity2 )
   oWebMap:AddStopSep( cStreet3, cCity3 )
   oWebMap:AddStopSep( cStreet4, cCity4 )
   oWebMap:AddStopSep( cStreet5, cCity5 )
   oWebMap:cWhatsNear := cWhatsNear
   oWebMap:nZoomLevel := nZoomLevel
   oWebMap:GenLink()
   if .not. empty( oWebMap:cLink )
      DEFINE WINDOW oWnd TITLE "Google Map Demo" ;
         FROM 0, 0 TO 600, 800 pixel

      oActiveX = TActiveX():New( oWnd, "Shell.Explorer" )
      // oActiveX = TOleAuto():New("InternetExplorer.Application")

      oWnd:oClient = oActiveX // To fill the entire window surface

      // these setprop options do not work?
      oActiveX&#058;SetProp( "Visible", .T. )
      oActiveX&#058;SetProp( "Toolbar", .T. )
      oActiveX&#058;SetProp( "Statusbar", .T. )
      oActiveX&#058;SetProp( "MenuBar", .F. )

      // Test iframe
      // Added this test 1/28/2014 to see if it could show just map.
      cHtmlFile := 'c:\temp\temp.html'
      cHtml := [<html>]+CRLF
      cHtml += [<head>]+CRLF
      cHtml += [<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">]+CRLF
      cHtml += [<title>Google Map Demo</title>]+CRLF
      cHtml += [</head>]+CRLF
      cHtml += [<body>]+CRLF
      cHtml += [<p>]+CRLF
      cHtml += [<iframe width="700" height="500" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="]+oWebMap:cLink+[&amp;output=embed"></iframe><br /><small><a href="]+;
         oWebMap:cLink+[&amp;source=embed"
style="color:#0000FF;text-align:left">View Larger Map</a></small>]+CRLF
      cHtml += [</p>]+CRLF
      cHtml += [</body>]+CRLF
      cHtml += [</html>]+CRLF
      memowrit( cHtmlFile, cHtml )
      oActiveX&#058;Do( "Navigate", 'c:\temp\temp.html' )

      //oActiveX&#058;Do( "Navigate", oWebMap:cLink )
      sysrefresh()
      // MsgInfo( oActiveX&#058;GetProp( "StatusBar" ) )

      ACTIVATE WINDOW oWnd

      sysrefresh()

   endif

return nil

function EventInfo( event, aParams, pParams, oActiveX )

   local cMsg := "Event: " + cValToChar( event ) + CRLF
   local n

   cMsg += "Params: " + CRLF

   for n = 1 to Len( aParams )
      cMsg += cValToChar( aParams[ n ] ) + CRLF
   next

   if event == "BeforeNavigate2"
      //MsgInfo( aParams[ 2 ] )
      //SetEventParam( pParams, 7, .t. ) // Comment this to allow navigation
   endif

return cMsg + CRLF


 
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Re: Google Maps

Postby MGA » Tue Jan 28, 2014 7:51 pm

Thanks Gale!
ubiratanmga@gmail.com

FWH24.04
BCC7.3
HARBOUR3.2
xMate
Pelles´C
TDolphin
MGA
 
Posts: 1252
Joined: Mon Feb 25, 2008 2:54 pm
Location: Brasil/PR/Maringá

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 49 guests