Clique abaixo para nos ajudar
Conectar-se

Esqueci minha senha

Estamos no Facebook
Buscar
 
 

Resultados por:
 


Rechercher Busca avançada

Quem está conectado
15 usuários online :: Nenhum usuário registrado, Nenhum Invisível e 15 Visitantes :: 1 Motor de busca

Nenhum

[ Ver toda a lista ]


O recorde de usuários online foi de 468 em 1/3/2012, 10:43
TRY BEGIN E FLOCK()

17/4/2017, 10:32 por AJC

Pessoal estou tendo alguns problemas de gravação em rede, estou usando
try begin, mas vi algo na …

Comentários: 0

Exportar Dados Campo Memo Tabela DBF

10/4/2017, 10:28 por fcampos

Olá bom dia.

Estou tentando exportar os dados de algumas tabelas em formato dbf pelo foxpro.
O …

Comentários: 2

Função EVL()

8/4/2017, 12:18 por Clebervfp

Bom dia a todos.
Vim compartilhar de uma Função do próprio VFP que me benefício muito.
Função …

Comentários: 0

COMO BLOQUEAR REGISTRO OU TABELA NO VISUAL FOXPRO PARA GRAVAÇÃO EM REDE

3/4/2017, 10:29 por AJC

Pessoal estou tendo um problema que acontece sempre busco na minha tabela de clientes o ultimo …

Comentários: 2

Controlar Scanner Twain

31/3/2017, 17:31 por Kleber R Bento

Estou usando o EZTW32.DLL para criar uma ferramenta que escaneia e gera PDF. Porém com esses …

Comentários: 0

Estatísticas
Temos 7067 usuários registrados
O último usuário registrado atende pelo nome de Preula

Os nossos membros postaram um total de 48 mensagens em 25 assuntos

FOX + HTML

Ver o tópico anterior Ver o tópico seguinte Ir em baixo

Anexo FOX + HTML

Mensagem por _batmanvfp_ em 30/1/2011, 19:15

Galeria de Imagens

Código:
Public oForm
oForm = Createobject('form1')
oForm.Show()

Define Class form1 As Form
  Top = 0
  Left = 0
  Height = 470
  Width = 740
  DoCreate = .T.
  Caption = "HTML sample"
  Name = "Form1"
  HTMLFile='' && Custom prpoperty to hold temp .htm name

  * This is IE control - you'd use webbrowser4 from gallery instead
  * just because it already has some checks, extra pem. ie: wouldn't need readystate part
  * for the sake of keeping code short here I directly use olecontrol itself
  Add Object htmlviewer As OleControl With ;
    Top = 12, ;
    Left = 12, ;
    Height = 396, ;
    Width = 708, ;
    Visible = .T., ;
    Name = "HTMLViewer", ;
    OleClass = 'Shell.Explorer'

  Add Object text1 As TextBox With ;
    Height = 25, ;
    Left = 12, ;
    Top = 432, ;
    Width = 60, ;
    Name = "Text1"

  Add Object text2 As TextBox With ;
    Height = 23, ;
    Left = 84, ;
    Top = 432, ;
    Width = 204, ;
    Name = "Text2"

  Add Object text3 As TextBox With ;
    Height = 23, ;
    Left = 300, ;
    Top = 432, ;
    Width = 125, ;
    Name = "Text3"

  Add Object text4 As TextBox With ;
    Height = 23, ;
    Left = 432, ;
    Top = 432, ;
    Width = 125, ;
    Name = "Text4"

  Procedure Init
    Local lnImages, lnPerrow, lnCurrent
    lnImages = Adir(arrImages,_samples+'data\graphics\*.gif')
    *You'd use a table let's simulate it
    Create Cursor myImages (ImagePath m,FirstName c(12), LastName c(12))
    For ix=1 To lnImages
      Insert Into myImages Values ;
        (_samples+'data\graphics'+arrImages[ix,1],'FirstName'+Trans(ix),'LastName'+Trans(ix))
    Endfor
    *Now we have a test table - create HTML
    lnPerRow = 3 && How many would we show on a line
    lnCurrent = 0 && Do not use recno() thinking it might be ordered on an index
    This.HTMLFile = Sys(2015)+'.htm'

    Set Textmerge On
    Set Textmerge To (This.HTMLFile) Noshow
    * Initialize lcHTML
      \<HTML><BODY><TABLE>
    Select myImages
    Scan
      lnCurrent = lnCurrent+1
      If (lnCurrent-1)%lnPerRow=0
        If lnCurrent>1
      \</TR>
        Endif
      \<TR>
      Endif
      \<TD><A href="<<trans(recno())>>"><img border="0" src="<<trim(chrtran(ImagePath,'','/'))>>"></A></TD>
    Endscan
      \</TR>
      \</TABLE></BODY></HTML>
    Set Textmerge To
    Set Textmerge Off
    *!*       Modify Command (this.HTMLFile) && If you ever wonder created HTML
    With Thisform.htmlviewer
      .Navigate2('file://'+Sys(5)+Curdir()+This.HTMLFile)
      Do While .ReadyState # 4 && Wait for ready state
      Enddo
    Endwith
  Endproc


  Procedure htmlviewer.BeforeNavigate2
    *** ActiveX Control Event ***
    Lparameters pdisp, url, flags, targetframename, postdata, headers, Cancel
    Cancel = .T.  && do not navigate to anywhere
    With Thisform && with webbrowser4 also this.oHost is the form itself or container
      .text1.Value = Justfname(url)
      Go Val(Justfname(url)) In 'myImages'
      .text2.Value = myImages.ImagePath
      .text3.Value = myImages.FirstName
      .text4.Value = myImages.LastName
    Endwith
  Endproc

  Procedure Destroy
    Erase (This.HTMLFile)
  Endproc
Enddefine


Última edição por _batmanvfp_ em 30/1/2011, 19:18, editado 1 vez(es)

_batmanvfp_
Participa Bastante
Participa Bastante


Voltar ao Topo Ir em baixo

Anexo Re: FOX + HTML

Mensagem por _batmanvfp_ em 30/1/2011, 19:16

Formulário de Cadastro

Código:
public oForm
oForm = newobject('HTMLViewerForm')
oForm.show

local loDocument
loDocument = oForm.htMLVIEWER.object.document
select cust_id,company,contact,country,region ;
  from (_samples+'data\customer') ;
  into cursor crsCustomer

loTableX = _GetTable(loDocument)
loDocument.body.AppendChild(loTableX)
_cliptext = loDocument.body.outerHTML

procedure _GetTable
   lparameters toDocument
   local array aHeaders[1], aColumns[1]

   local oTable,oThead,oTFoot,oTBody,oCaption, jx
   oTable = toDocument.createElement("TABLE")
   oThead = toDocument.createElement("THEAD")
   oTBody1 = toDocument.createElement("TBODY")
   oTBody2 = toDocument.createElement("TBODY")
   oTBody3 = toDocument.createElement("TBODY")
   oTFoot = toDocument.createElement("TFOOT")
   oCaption = toDocument.createElement("CAPTION")

   * Insert the created elements into oTable.
   with oTable
      .border = 1
      .id = 'customers'
      *.Style.borderCollapse="collapse"
      .style.bordercolor = "#000000"
      .style.borderwidth = "thin"
      .style.borderstyle = "solid"
      .AppendChild(oThead)
      .AppendChild(oTBody1)
      .AppendChild(oTBody2)
      .AppendChild(oTBody3)
      .AppendChild(oTFoot)
      .AppendChild(oCaption)
      .cellSpacing = 0
      .cellPadding = 0
   endwith
   oTBody1.bgColor = "#E0E0E0"
   oTBody2.bgColor = "#00FFFF"
   oTBody3.bgColor = "#FF00FF"

   select crsCustomer
   * Insert a row into the header and set its background color.
   oThead.bgColor = "lightskyblue"
   lcHeaders = "cust_id,company,contact,country"

   oRow = toDocument.createElement("TR")
   oCell = toDocument.createElement("TH")
   oCell.rowspan = 2
   oCell.innerText = "Customer ID"
   oRow.AppendChild(oCell)

   oCell = toDocument.createElement("TH")
   oCell.rowspan = 2
   oCell.innerText = "Company"
   oRow.AppendChild(oCell)

   oCell = toDocument.createElement("TH")
   oCell.colspan = 2
   oCell.innerText = "Additional Info"
   oRow.AppendChild(oCell)

   oThead.AppendChild(oRow)
   oRow = toDocument.createElement("TR")
   oCell = toDocument.createElement("TH")
   oCell.innerText = "Contact"
   oRow.AppendChild(oCell)
   oCell = toDocument.createElement("TH")
   oCell.innerText = "Country"
   oRow.AppendChild(oCell)
   oThead.AppendChild(oRow)


   scan
      oRow = toDocument.createElement("TR")
      if country='USA'
         oTBody2.AppendChild(oRow)
      else
         if country='Germany'
            oTBody1.AppendChild(oRow)
         else
            oTBody3.AppendChild(oRow)
         endif
      endif

      *CustID
      oCell = toDocument.createElement("TD")
      oCell.rowspan=2
      oCell.style.fontWeight = "bold"
      oCell.innerText = trim(cust_id)
      oRow.AppendChild(oCell)
      *Company
      oCell = toDocument.createElement("TD")
      *      oCell.Rowspan=2
      oCell.innerText = trim(company)
      oRow.AppendChild(oCell)
      *Contact
      oCell = toDocument.createElement("TD")
      *      oCell.Rowspan=2
      oCell.innerText = trim(contact)
      oRow.AppendChild(oCell)
      * Country and region
      oCell = toDocument.createElement("TD")
      *      oCell.Rowspan=2
      oCell.innerText = trim(country)
      oRow.AppendChild(oCell)

      oSubRow = toDocument.createElement("TR")
      if country='USA'
         oTBody2.AppendChild(oSubRow)
      else
         if country='Germany'
            oTBody1.AppendChild(oSubRow)
         else
            oTBody3.AppendChild(oSubRow)
         endif
      endif

      * Country and region
      oCell = toDocument.createElement("TD")
      oCell.colspan=3
      oCell.style.fontStyle = "italic"
      oCell.innerText = trim(country - (' - ' + region))

      if region='WA'
         oCell.bgColor = "#FF2020"
      ENDIF
      IF region='OR'
         oCell.bgColor = "Turquoise"
      endif
      oSubRow.AppendChild(oCell)

   endscan

   * Create and insert rows and cells into the footer row.
   oRow = toDocument.createElement("TR")
   oTFoot.AppendChild(oRow)
   oCell = toDocument.createElement("TD")
   oRow.AppendChild(oCell)
   oCell.innerText = textmerge("Total <<Reccount()>>")
   oCell.colspan = 4
   oCell.bgColor = "lightskyblue"

   * Set the innerText of the caption and position it at the bottom of the table.
   oCaption.innerText = "Caption Here"
   oCaption.style.fontsize = "14 pt"
   oCaption.style.color = "Blue"
   oCaption.align = "top"
   return oTable

define class HTMLViewerForm as form
   datasession = 2
   top = 0
   left = 0
   height = 500
   width = 800
   docreate = .t.
   caption = "HTML sample"
   cHTML = ""
   cHTMFile = forcepath(sys(2015)+'.htm',sys(2023))
   EmptyHTM = forcepath('empty.htm',sys(2023))
   DoNotErase = .f.

   add object htMLVIEWER as olecontrol with ;
      top = 0, left = 0, height = 500, width = 800, visible = .t., ;
      oleclass = 'Shell.Explorer'

   procedure init
      this.htMLVIEWER.navigate2('about:blank')
      with this.htMLVIEWER.document
         oBody = .createElement('body')
         oBody.oncontextmenu = "return false"
         .AppendChild(oBody)
      endwith
   endproc
   procedure destroy
      erase (this.cHTMFile)
   endproc

   procedure htMLVIEWER.refresh
      nodefault
   endproc

   procedure resize
      this.htMLVIEWER.height = this.height
      this.htMLVIEWER.width  = this.width
   endproc
enddefine


Última edição por _batmanvfp_ em 30/1/2011, 19:19, editado 2 vez(es)

_batmanvfp_
Participa Bastante
Participa Bastante


Voltar ao Topo Ir em baixo

Anexo Re: FOX + HTML

Mensagem por _batmanvfp_ em 30/1/2011, 19:16

Pagina de Relatorio

Código:
Public oForm
oForm = Createobject('htmlSample', GetHTML())
oForm.Show()

Function GetHTML
  *Return HTMLShowerx()
  Local myVar
  TEXT to myVar noshow
<html>
<head>
<title>New User Sign Up</title>
<script language="JScript">
function LoadTreeView()
{
   var TreeView1 = document.all('Tree001');
    var oNode = TreeView1.Nodes.Add(null,0,"top","My Tree");
    TreeView1.Nodes.Add("top",4,"root0","Main node 0");
    TreeView1.Nodes.Add("top",4,"root1","Main node 1");
    TreeView1.Nodes.Add("top",4,"root2","Main node 2");
    TreeView1.Nodes.Add("root1",4,"child11","Child11");
    TreeView1.Nodes.Add("root1",4,"child12","Child12");
    TreeView1.Nodes.Add("root2",4,"child21","Child21");
    TreeView1.Nodes.Add("child11",4,"child111","child111");
    TreeView1.Nodes.Add("child11",4,"child113","child113");
    TreeView1.Nodes.Add("child113",3,"child112","child112");
    oNode.Expanded = true;

   var TreeView2 = document.all('Tree002');
    var oNode = TreeView2.Nodes.Add(null,0,"top","My Tree");
    TreeView2.Nodes.Add("top",4,"root0","Main node 0");
    TreeView2.Nodes.Add("top",4,"root1","Main node 1");
    TreeView2.Nodes.Add("top",4,"root2","Main node 2");
    TreeView2.Nodes.Add("root1",4,"child11","Child11");
    TreeView2.Nodes.Add("root1",4,"child12","Child12");
    TreeView2.Nodes.Add("root2",4,"child21","Child21");
    TreeView2.Nodes.Add("child11",4,"child111","child111");
    TreeView2.Nodes.Add("child11",4,"child113","child113");
    TreeView2.Nodes.Add("child113",3,"child112","child112");
    oNode.Expanded = true;

}
function CheckTable(dbcPath,dbfName)
{
  var strCn = "Provider=VFPOLEDB;Data Source=" + dbcPath;
  var strSQL = "select * from " + dbfName;

  var oConn = new ActiveXObject("Adodb.Connection");
  oConn.ConnectionString = strCn;
  oConn.Open;
  var oRS = oConn.Execute(strSQL);

  var lst="<TABLE border='1'><TR>";
  var Maxfields=5;
  var MaxRows=20;

  for (i=0;i<Math.min(oRS.Fields.Count,Maxfields);i++)
  {
    lst += "<TH>";
    lst += oRS.Fields(i).Name;
    lst += "</TH>";
  }
  lst += "</TR>";

  var counter=0;
  while (!oRS.eof && counter < MaxRows)
  {
    lst += "<TR>";
    for (i=0;i<Math.min(oRS.Fields.Count,Maxfields);i++)
    {
      lst += "<TD>";
      lst += oRS.Fields(i).Value;
      lst += "</TD>";
    }
    lst += "</TR>";
    oRS.MoveNext();
    counter++;
  }
  lst += "</TABLE>";
  oConn.Close();
  tablelist.innerHTML = lst;
  return true;
}
</script>
</head>
<body bgcolor=Turquoise onload="LoadTreeView();">
<h1 align="Center"><font color="#000080">New User Sign Up</font></h1>
<form method="GET" action="empty.htm" target="_self" name="myForm">
    <table border="0" cellspacing="1">
      <tr><td>ID</td><td><input type="text" name="ID" ID="SSNNumber" size="16" maxlength="16"></td></tr>
      <tr><td>First Name</td><td><input type="text" name="First" size="30" maxlength="15"></td></tr>
      <tr><td>Last Name</td><td><input type="text" name="Last" size="30" maxlength="20"></td></tr>
  <td>Gender?</td>
  <td>
    <select name="Selection1">
      <option value="0">- Gender -</option>
      <option value="1">Female</option>
      <option value="2">Male</option>
    </select></td></tr>
<tr>
  <td>Multi Selection</td>
  <td>
    <select multiple name="MulSelection">
      <option value="0">- Sports you watch -</option>
      <option value="1">Basketball</option>
      <option value="2">Soccer</option>
      <option value="3">Football</option>
      <option value="4">Volleyball</option>
      <option value="5">Formula1</option>
      <option value="6">Nascar</option>
    </select></td></tr>
   </table>
<TEXTAREA ID=txtComments STYLE="overflow:scroll; width:70%; height:150">
Sometimes an HTML based VFP form can be cool.
Think you could have syntax coloring on a form :)
Play flash movie (better play "Need For Speed" - post me too if you find a flash version), have a calendar etc.
</TEXTAREA>
  <p>
<A HREF="newpage.htm" TARGET="_self">Go to New Page.</A>
<input type=submit name=sub1 value="Write" onclick='document.all("submitter").value="writeButton";'>
<input type=submit name=sub2 value="Update" onclick='document.all("submitter").value="updateButton";'>
<input type=submit name=sub3 value="Clear" onclick='document.all("submitter").value="clearButton";'>

<p>
<object name="Treeview" classid="clsid:C74190B6-8589-11D1-B16A-00C0F0283628"
  id="Tree001" width="242" height="159">
  <param name="_ExtentX" value="6403">
  <param name="_ExtentY" value="4207">
  <param name="_Version" value="393217">
  <param name="HideSelection" value="0">
  <param name="Indentation" value="1000">
  <param name="LabelEdit" value="0">
  <param name="LineStyle" value="0">
  <param name="PathSeparator" value="/">
  <param name="Sorted" value="0">
  <param name="Style" value="7">
  <param name="Checkboxes" value="0">
  <param name="FullRowSelect" value="0">
  <param name="HotTracking" value="0">
  <param name="Scroll" value="1">
  <param name="SingleSel" value="0">
  <param name="ImageList" value>
  <param name="BorderStyle" value="0">
  <param name="Appearance" value="1">
  <param name="MousePointer" value="0">
  <param name="Enabled" value="1">
  <param name="OLEDragMode" value="0">
  <param name="OLEDropMode" value="0">
</object>
</p>
<p>
<object name="Treeview" classid="clsid:C74190B6-8589-11D1-B16A-00C0F0283628"
  id="Tree002" width="242" height="159">
  <param name="_ExtentX" value="6403">
  <param name="_ExtentY" value="4207">
  <param name="_Version" value="393217">
  <param name="HideSelection" value="0">
  <param name="Indentation" value="1000">
  <param name="LabelEdit" value="0">
  <param name="LineStyle" value="0">
  <param name="PathSeparator" value="/">
  <param name="Sorted" value="0">
  <param name="Style" value="7">
  <param name="Checkboxes" value="0">
  <param name="FullRowSelect" value="0">
  <param name="HotTracking" value="0">
  <param name="Scroll" value="1">
  <param name="SingleSel" value="0">
  <param name="ImageList" value>
  <param name="BorderStyle" value="0">
  <param name="Appearance" value="1">
  <param name="MousePointer" value="0">
  <param name="Enabled" value="1">
  <param name="OLEDragMode" value="0">
  <param name="OLEDropMode" value="0">
</object>
</p>
</form>
<input type=hidden name="submitter" value=0>
<p>Browse a VFP table</p>
<table>
<TR><TD>Locate DBC</TD><TD><input type='file' size='80' name='DBCLOCATION'></TD></TR>
<TR><TD>TableName</TD><TD><input type='text' size='80' name='TABLENAME'></TD></TR>
</TABLE><HR>
<input type='button' value='List' onClick="CheckTable(DBCLOCATION.value,TABLENAME.value);return;">
<div id='tablelist'></div>
</body>
</html>
  ENDTEXT
  Return myVar

Define Class htmlSample As Form
  Top = 0
  Left = 0
  Height = 600
  Width = 800
  DoCreate = .T.
  Caption = "HTML sample"
  cHTML = "<html><body></body></html>"
  cHTMFile = ''
  DoNotErase = .T.

  Add Object htmlviewer As OleControl With ;
    Top = 0, ;
    Left = 0, ;
    Height = 600, ;
    Width = 800, ;
    Visible = .T., ;
    Name = "HTMLViewer", ;
    OleClass = 'Shell.Explorer'

  Procedure Destroy
    If !This.DoNotErase And !Empty(This.cHTMFile) And File(This.cHTMFile)
      Erase (This.cHTMFile)
    Endif
  Endproc

  Procedure Init
    Lparameters tcHTML, tlIsFile
    If m.tlIsFile And !Empty(m.tcHTML) And File(m.tcHTML)
      This.cHTMFile = m.tcHTML
      This.DoNotErase = .T.

      With Thisform.htmlviewer
        .Navigate2('file://'+This.cHTMFile)
        Do While .ReadyState # 4 && Wait for ready state
        Enddo
      Endwith
    Else
      If !Empty(m.tcHTML)
        This.cHTMFile = Forcepath(Sys(2015)+'.htm',Sys(2023))
        This.DoNotErase = .F.
        Strtofile(m.tcHTML, This.cHTMFile)

        With Thisform.htmlviewer
          .Navigate2('file://'+This.cHTMFile)
          Do While .ReadyState # 4 && Wait for ready state
          Enddo
        Endwith
      Else
        With This.htmlviewer
          .Navigate2("about:blank")
          .Document.Write(This.cHTML)
        Endwith
      Endif
    Endif
  Endproc

  Procedure htmlviewer.NavigateError
    Lparameters pdisp, url, frame, statuscode, Cancel
    TEXT to m.lcParamList textmerge noshow
  pdisp = pdisp
  url = <<url>>
  frame = <<frame>>
  statuscode = <<statuscode>>
  Cancel = <<Cancel>>
    ENDTEXT
    Messagebox(m.lcParamList)
    Cancel = .T.
  Endproc


  Procedure htmlviewer.BeforeNavigate2
    Lparameters pdisp, url, Flags, targetframename, postdata, headers, Cancel
    TEXT to m.lcParamList textmerge noshow
  pdisp = pdisp
  url = <<url>>
  flags = <<flags>>
  targetframename = <<targetframename>>
  postdata = <<postdata>>
  headers = <<headers>>
  Cancel = <<Cancel>>
    ENDTEXT
    Messagebox(m.lcParamList)

    *  oFrm = This.Object.Document.myForm
    lcVals = ""
    If This.Object.Document.Forms.Length > 0
      For Each oFrm In This.Object.Document.Forms
        lcVals = lcVals + oFrm.Name + Chr(13)
        If oFrm.elements.Length > 0
          For Each oElem In oFrm.elements
            If oElem.Name = "Treeview"
              lcVals = lcVals + "Name :" + oElem.Name + '::'+ oElem.Id +  '::'+ "/Value:"+;
                Iif(!Isnull(oElem.SelectedItem),;
                oElem.SelectedItem.Key,"NULL") + Chr(13)
            Else
              If oElem.Type = "select-multiple"
                lcList=''
                For ix=0 To oElem.Length-1
                  If oElem.Item(ix).Selected
                    lcList = lcList + Iif(Empty(lcList),'',',')+oElem.Item(ix).Value
                  Endif
                Endfor
                lcVals = lcVals + "Name :" + oElem.Name +  '::'+ oElem.Id +  '::'+ "/Value:"+lcList + Chr(13)
              Else
                lcVals = lcVals + "Name :" + oElem.Name + '::'+ oElem.Id +  '::'+ "/Value:"+oElem.Value + Chr(13)
              Endif
            Endif
            oElem = .Null.
          Endfor
        Endif
        oFrm = .Null.
      Endfor
    Endif
    Cancel = .T.  && prevents actual navigation
    lcVals = lcVals + Chr(13)+Chr(10)+;
      'Submitted by:'+Transform(This.Object.Document.All("submitter").Value)
    Messagebox(lcVals)
  Endproc

  Procedure htmlviewer.Refresh
    Nodefault
  Endproc
Enddefine
[code]

_batmanvfp_
Participa Bastante
Participa Bastante


Voltar ao Topo Ir em baixo

Anexo Re: FOX + HTML

Mensagem por Marcos Guedes em 30/1/2011, 23:58

Reputado!

_________________
Marcos Guedes - Programador e desenvolvedor Web.


Visite o nosso portal:
[Você precisa estar registrado e conectado para ver este link.]

Marcos Guedes
Webmaster
Webmaster


Voltar ao Topo Ir em baixo

Anexo Re: FOX + HTML

Mensagem por _batmanvfp_ em 9/2/2011, 11:43

Onibus percorrendo trajeto no mapa

Código:
PUBLIC oMiForm
oMiForm = CREATEOBJECT("MiForm")
oMiForm.SHOW
RETURN

DEFINE CLASS MiForm AS FORM
  HEIGHT = 600
  WIDTH = 800
  AUTOCENTER = .T.
  CAPTION = "Example with Google Maps"
  NAME = "MiForm"
  SetPoint = ""
  SHOWWINDOW = 2
  *windowstate = 2

  ADD OBJECT oleIE AS OLECONTROL WITH ;
    TOP = 5, LEFT = 5, HEIGHT = 360, WIDTH = 470, ;
    NAME = "oleIE", OLECLASS = "Shell.Explorer.2"
 
  PROCEDURE resize
  WITH THISform
        .oleIE.Width = this.Width- 2
        .oleIE.Height = this.Height - 2
    ENDWITH
  ENDPROC
 
 PROCEDURE DESTROY
    SET POINT TO (THIS.SetPoint)
  ENDPROC

 PROCEDURE LOAD
    SYS(2333,1)
    THIS.SetPoint = SET("Point")
    SET POINT TO .
    SET SAFETY OFF
    CREATE CURSOR temp (Mark C(5), Lat N(12,6), Lon N(12,6), Zoom I(4))
    INSERT INTO TEMP VALUES ('MARK',-2.142607,-79.883308,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142264,-79.883137,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141921,-79.882965,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141578,-79.882793,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141235,-79.882622,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140827,-79.882493,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140463,-79.882622,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140184,-79.882793,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139905,-79.883029,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139626,-79.883265,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139519,-79.88378,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139862,-79.884424,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140205,-79.885046,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140527,-79.885626,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140849,-79.886205,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141106,-79.886785,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141363,-79.887364,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141621,-79.887943,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141878,-79.888523,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141921,-79.889102,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142435,-79.888973,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142564,-79.888437,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142971,-79.888072,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143379,-79.887815,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143786,-79.887471,15)
   INSERT INTO TEMP VALUES ('MARK',-2.144194,-79.887128,15)
   INSERT INTO TEMP VALUES ('MARK',-2.144601,-79.886806,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145008,-79.886484,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145352,-79.886055,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145652,-79.88554,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145952,-79.885025,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146359,-79.88524,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146681,-79.885433,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147003,-79.885626,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147324,-79.885798,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147689,-79.885862,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148053,-79.886076,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148504,-79.886141,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148954,-79.886205,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149404,-79.88627,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149855,-79.886334,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150305,-79.886334,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150755,-79.886291,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150927,-79.88657,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151012,-79.887042,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150991,-79.887557,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151098,-79.888072,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151205,-79.888587,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151313,-79.889102,15)
   INSERT INTO TEMP VALUES ('MARK',-2.15142,-79.889617,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151484,-79.890132,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151548,-79.890647,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151634,-79.891162,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151763,-79.891548,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151806,-79.891934,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151613,-79.892299,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151334,-79.892664,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150862,-79.892546,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150455,-79.892331,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150133,-79.892106,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149662,-79.892052,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149318,-79.892149,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148943,-79.892288,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148514,-79.892557,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148161,-79.892836,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147775,-79.893072,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147367,-79.89334,15)
   INSERT INTO TEMP VALUES ('MARK',-2.14697,-79.893587,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146499,-79.893866,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146166,-79.894069,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145845,-79.894316,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145266,-79.894681,15)
   INSERT INTO TEMP VALUES ('MARK',-2.14488,-79.895003,15)
   INSERT INTO TEMP VALUES ('MARK',-2.144237,-79.895368,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143743,-79.895689,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143164,-79.896076,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142478,-79.896505,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141856,-79.896955,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141235,-79.897363,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140613,-79.897771,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139991,-79.898179,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139466,-79.897846,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139112,-79.897299,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138854,-79.896784,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138468,-79.896312,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138061,-79.895818,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137654,-79.895411,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137396,-79.89496,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137139,-79.894509,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136732,-79.893994,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136324,-79.893479,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135917,-79.89305,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135617,-79.892621,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135359,-79.892192,15)
   INSERT INTO TEMP VALUES ('MARK',-2.13493,-79.891677,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134394,-79.89114,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134051,-79.890625,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133558,-79.89011,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133258,-79.889767,15)
   INSERT INTO TEMP VALUES ('MARK',-2.132958,-79.889317,15)
   INSERT INTO TEMP VALUES ('MARK',-2.132915,-79.888887,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133043,-79.888437,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133365,-79.888158,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133815,-79.887815,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134266,-79.887471,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134587,-79.887214,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135166,-79.886785,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135617,-79.886441,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135831,-79.886184,15)
   INSERT INTO TEMP VALUES ('MARK',-2.13611,-79.885948,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136431,-79.885712,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136689,-79.885454,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136989,-79.885197,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137289,-79.884939,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137611,-79.884746,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137932,-79.884489,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138233,-79.884231,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138533,-79.88436,15)
   INSERT INTO TEMP VALUES ('MARK',-2.13864,-79.88466,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138833,-79.884896,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139047,-79.885175,15)

 ENDPROC

      
 PROCEDURE init
    
    TEXT TO lcHtml NOSHOW TEXTMERGE
        <html> <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <title>Google Maps</title>
        <script src="http://maps.google.com/maps?file=api&v=2&key=123"    type="text/javascript"></script>
        <script type="text/javascript">
        //<![CDATA[
       
       var data = [
   ENDTEXT
   
      SELECT temp
      rec = RECNO()
      GO top
      SCAN
         IF RECNO() <> rec
            TEXT TO lcHtml NOSHOW TEXTMERGE ADDITIVE
                {lat:<<ALLTRIM(STR(temp.Lat,12,6))>>,lon:<<TRANSFORM(temp.Lon)>>},
             ENDTEXT          
          ELSE
             TEXT TO lcHtml NOSHOW TEXTMERGE ADDITIVE
                {lat:<<ALLTRIM(STR(temp.Lat,12,6))>>,lon:<<TRANSFORM(temp.Lon)>>}
             ENDTEXT          
          ENDIF
       ENDSCAN   
       
   TEXT TO lcHtml NOSHOW TEXTMERGE ADDITIVE
         ];
         var map = null;
         var route = null;
         var busMarker = null;
         var point = null;
         var count = 0;
         var delay = 100;
         var k=0;         
         function load()
         {         
              if (GBrowserIsCompatible())
              {       
             
              
                   var baseIcon = new GIcon();
                   baseIcon.iconSize=new GSize(32,32);
                   baseIcon.shadowSize=new GSize(56,32);
                   baseIcon.iconAnchor=new GPoint(16,32);
                   baseIcon.infoWindowAnchor=new GPoint(16,0);
                                   
                      var bus = new GIcon(baseIcon, "http://maps.google.com/mapfiles/kml/shapes/bus.png");                   
                   
                     function createMarker(point,html,icon) {
                    var marker = new GMarker(point,icon);
                    GEvent.addListener(marker, "click", function() {
                      marker.openInfoWindowHtml(html);
                    });
                    return marker;
                  }
   
                 map = new GMap2(document.getElementById("map"));
                 map.setCenter(new GLatLng(-2.142264, -79.883180), 15);
[Você precisa estar registrado e conectado para ver este link.] // Vue satelite
map.setMapType(G_NORMAL_MAP); // Vue carte
[Você precisa estar registrado e conectado para ver este link.] // Vue mixte
map.addControl(new GScaleControl()) ;          
             
            
      
         
         
                 var customUI = map.getDefaultUI();
                    customUI.maptypes.hybrid = true;
                    map.setUI(customUI); 
                           
                    var point = new GLatLng(data[count].lat, data[count].lon);
                 Marker = createMarker(point,"Hola",bus);
                 map.addOverlay(Marker);
                 route = setTimeout("moveTheBus()", 3000);
   
                
              }
          }
         
          function moveTheBus()
          {
               count++;
               if(count > data.length - 1)
               {
                  count = 0;
                  map.clearOverlays(polyline);
       map.addOverlay(Marker);
                }
               point = new GLatLng(data[count].lat, data[count].lon);
               Marker.setLatLng(point);    
               route = setTimeout("moveTheBus()",delay);
         if (k++>=15){
          map.panTo( point );
          k=0;
         
          }
if (count>=1){
var polyline = new GPolyline([
new GLatLng(data[count-1].lat, data[count-1].lon),
new GLatLng(data[count].lat, data[count].lon)], "#FF6600", 10);
map.addOverlay(polyline);
          }
      
}         
        //]]>
        </script> </head>
        <body scroll="no" bgcolor="#CCCCCC" topmargin="0" leftmargin="0"
        onload="load()" onunload="GUnload()">
        <div id="map" style="width:100%; height: 100%"></div>
        </body> </html>     
    ENDTEXT
      
    STRTOFILE(lcHtml,"MiHtml.htm")
   THISFORM.oleIE.Navigate2(FULLPATH("MiHtml.htm"))

  ENDPROC
ENDDEFINE


_batmanvfp_
Participa Bastante
Participa Bastante


Voltar ao Topo Ir em baixo

Anexo Re: FOX + HTML

Mensagem por Marcos Guedes em 9/2/2011, 14:45

[Você precisa estar registrado e conectado para ver este link.] escreveu:Onibus percorrendo trajeto no mapa

Código:
PUBLIC oMiForm
oMiForm = CREATEOBJECT("MiForm")
oMiForm.SHOW
RETURN

DEFINE CLASS MiForm AS FORM
  HEIGHT = 600
  WIDTH = 800
  AUTOCENTER = .T.
  CAPTION = "Example with Google Maps"
  NAME = "MiForm"
  SetPoint = ""
  SHOWWINDOW = 2
  *windowstate = 2

  ADD OBJECT oleIE AS OLECONTROL WITH ;
    TOP = 5, LEFT = 5, HEIGHT = 360, WIDTH = 470, ;
    NAME = "oleIE", OLECLASS = "Shell.Explorer.2"
 
  PROCEDURE resize
  WITH THISform
        .oleIE.Width = this.Width- 2
        .oleIE.Height = this.Height - 2
    ENDWITH
  ENDPROC
 
 PROCEDURE DESTROY
    SET POINT TO (THIS.SetPoint)
  ENDPROC

 PROCEDURE LOAD
    SYS(2333,1)
    THIS.SetPoint = SET("Point")
    SET POINT TO .
    SET SAFETY OFF
    CREATE CURSOR temp (Mark C(5), Lat N(12,6), Lon N(12,6), Zoom I(4))
    INSERT INTO TEMP VALUES ('MARK',-2.142607,-79.883308,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142264,-79.883137,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141921,-79.882965,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141578,-79.882793,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141235,-79.882622,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140827,-79.882493,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140463,-79.882622,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140184,-79.882793,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139905,-79.883029,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139626,-79.883265,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139519,-79.88378,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139862,-79.884424,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140205,-79.885046,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140527,-79.885626,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140849,-79.886205,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141106,-79.886785,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141363,-79.887364,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141621,-79.887943,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141878,-79.888523,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141921,-79.889102,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142435,-79.888973,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142564,-79.888437,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142971,-79.888072,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143379,-79.887815,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143786,-79.887471,15)
   INSERT INTO TEMP VALUES ('MARK',-2.144194,-79.887128,15)
   INSERT INTO TEMP VALUES ('MARK',-2.144601,-79.886806,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145008,-79.886484,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145352,-79.886055,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145652,-79.88554,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145952,-79.885025,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146359,-79.88524,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146681,-79.885433,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147003,-79.885626,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147324,-79.885798,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147689,-79.885862,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148053,-79.886076,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148504,-79.886141,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148954,-79.886205,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149404,-79.88627,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149855,-79.886334,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150305,-79.886334,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150755,-79.886291,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150927,-79.88657,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151012,-79.887042,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150991,-79.887557,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151098,-79.888072,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151205,-79.888587,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151313,-79.889102,15)
   INSERT INTO TEMP VALUES ('MARK',-2.15142,-79.889617,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151484,-79.890132,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151548,-79.890647,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151634,-79.891162,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151763,-79.891548,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151806,-79.891934,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151613,-79.892299,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151334,-79.892664,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150862,-79.892546,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150455,-79.892331,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150133,-79.892106,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149662,-79.892052,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149318,-79.892149,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148943,-79.892288,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148514,-79.892557,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148161,-79.892836,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147775,-79.893072,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147367,-79.89334,15)
   INSERT INTO TEMP VALUES ('MARK',-2.14697,-79.893587,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146499,-79.893866,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146166,-79.894069,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145845,-79.894316,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145266,-79.894681,15)
   INSERT INTO TEMP VALUES ('MARK',-2.14488,-79.895003,15)
   INSERT INTO TEMP VALUES ('MARK',-2.144237,-79.895368,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143743,-79.895689,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143164,-79.896076,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142478,-79.896505,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141856,-79.896955,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141235,-79.897363,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140613,-79.897771,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139991,-79.898179,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139466,-79.897846,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139112,-79.897299,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138854,-79.896784,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138468,-79.896312,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138061,-79.895818,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137654,-79.895411,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137396,-79.89496,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137139,-79.894509,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136732,-79.893994,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136324,-79.893479,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135917,-79.89305,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135617,-79.892621,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135359,-79.892192,15)
   INSERT INTO TEMP VALUES ('MARK',-2.13493,-79.891677,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134394,-79.89114,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134051,-79.890625,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133558,-79.89011,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133258,-79.889767,15)
   INSERT INTO TEMP VALUES ('MARK',-2.132958,-79.889317,15)
   INSERT INTO TEMP VALUES ('MARK',-2.132915,-79.888887,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133043,-79.888437,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133365,-79.888158,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133815,-79.887815,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134266,-79.887471,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134587,-79.887214,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135166,-79.886785,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135617,-79.886441,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135831,-79.886184,15)
   INSERT INTO TEMP VALUES ('MARK',-2.13611,-79.885948,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136431,-79.885712,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136689,-79.885454,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136989,-79.885197,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137289,-79.884939,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137611,-79.884746,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137932,-79.884489,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138233,-79.884231,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138533,-79.88436,15)
   INSERT INTO TEMP VALUES ('MARK',-2.13864,-79.88466,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138833,-79.884896,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139047,-79.885175,15)

 ENDPROC

      
 PROCEDURE init
    
    TEXT TO lcHtml NOSHOW TEXTMERGE
        <html> <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <title>Google Maps</title>
        <script src="http://maps.google.com/maps?file=api&v=2&key=123"    type="text/javascript"></script>
        <script type="text/javascript">
        //<![CDATA[
       
       var data = [
   ENDTEXT
   
      SELECT temp
      rec = RECNO()
      GO top
      SCAN
         IF RECNO() <> rec
            TEXT TO lcHtml NOSHOW TEXTMERGE ADDITIVE
                {lat:<<ALLTRIM(STR(temp.Lat,12,6))>>,lon:<<TRANSFORM(temp.Lon)>>},
             ENDTEXT          
          ELSE
             TEXT TO lcHtml NOSHOW TEXTMERGE ADDITIVE
                {lat:<<ALLTRIM(STR(temp.Lat,12,6))>>,lon:<<TRANSFORM(temp.Lon)>>}
             ENDTEXT          
          ENDIF
       ENDSCAN   
       
   TEXT TO lcHtml NOSHOW TEXTMERGE ADDITIVE
         ];
         var map = null;
         var route = null;
         var busMarker = null;
         var point = null;
         var count = 0;
         var delay = 100;
         var k=0;         
         function load()
         {         
              if (GBrowserIsCompatible())
              {       
             
              
                   var baseIcon = new GIcon();
                   baseIcon.iconSize=new GSize(32,32);
                   baseIcon.shadowSize=new GSize(56,32);
                   baseIcon.iconAnchor=new GPoint(16,32);
                   baseIcon.infoWindowAnchor=new GPoint(16,0);
                                   
                      var bus = new GIcon(baseIcon, "http://maps.google.com/mapfiles/kml/shapes/bus.png");                   
                   
                     function createMarker(point,html,icon) {
                    var marker = new GMarker(point,icon);
                    GEvent.addListener(marker, "click", function() {
                      marker.openInfoWindowHtml(html);
                    });
                    return marker;
                  }
   
                 map = new GMap2(document.getElementById("map"));
                 map.setCenter(new GLatLng(-2.142264, -79.883180), 15);
[Você precisa estar registrado e conectado para ver este link.] // Vue satelite
map.setMapType(G_NORMAL_MAP); // Vue carte
[Você precisa estar registrado e conectado para ver este link.] // Vue mixte
map.addControl(new GScaleControl()) ;          
             
            
      
         
         
                 var customUI = map.getDefaultUI();
                    customUI.maptypes.hybrid = true;
                    map.setUI(customUI); 
                           
                    var point = new GLatLng(data[count].lat, data[count].lon);
                 Marker = createMarker(point,"Hola",bus);
                 map.addOverlay(Marker);
                 route = setTimeout("moveTheBus()", 3000);
   
                
              }
          }
         
          function moveTheBus()
          {
               count++;
               if(count > data.length - 1)
               {
                  count = 0;
                  map.clearOverlays(polyline);
       map.addOverlay(Marker);
                }
               point = new GLatLng(data[count].lat, data[count].lon);
               Marker.setLatLng(point);    
               route = setTimeout("moveTheBus()",delay);
         if (k++>=15){
          map.panTo( point );
          k=0;
         
          }
if (count>=1){
var polyline = new GPolyline([
new GLatLng(data[count-1].lat, data[count-1].lon),
new GLatLng(data[count].lat, data[count].lon)], "#FF6600", 10);
map.addOverlay(polyline);
          }
      
}         
        //]]>
        </script> </head>
        <body scroll="no" bgcolor="#CCCCCC" topmargin="0" leftmargin="0"
        onload="load()" onunload="GUnload()">
        <div id="map" style="width:100%; height: 100%"></div>
        </body> </html>     
    ENDTEXT
      
    STRTOFILE(lcHtml,"MiHtml.htm")
   THISFORM.oleIE.Navigate2(FULLPATH("MiHtml.htm"))

  ENDPROC
ENDDEFINE

Testado e reputado!
Show de bola!
Very Happy

_________________
Marcos Guedes - Programador e desenvolvedor Web.


Visite o nosso portal:
[Você precisa estar registrado e conectado para ver este link.]

Marcos Guedes
Webmaster
Webmaster


Voltar ao Topo Ir em baixo

Anexo show vc e dez parabens nota 1000, tenho ke tirar o Chapeu

Mensagem por alceu11 em 11/2/2011, 20:37

[Você precisa estar registrado e conectado para ver este link.] escreveu:Onibus percorrendo trajeto no mapa

Código:
PUBLIC oMiForm
oMiForm = CREATEOBJECT("MiForm")
oMiForm.SHOW
RETURN

DEFINE CLASS MiForm AS FORM
  HEIGHT = 600
  WIDTH = 800
  AUTOCENTER = .T.
  CAPTION = "Example with Google Maps"
  NAME = "MiForm"
  SetPoint = ""
  SHOWWINDOW = 2
  *windowstate = 2

  ADD OBJECT oleIE AS OLECONTROL WITH ;
    TOP = 5, LEFT = 5, HEIGHT = 360, WIDTH = 470, ;
    NAME = "oleIE", OLECLASS = "Shell.Explorer.2"
 
  PROCEDURE resize
  WITH THISform
        .oleIE.Width = this.Width- 2
        .oleIE.Height = this.Height - 2
    ENDWITH
  ENDPROC
 
 PROCEDURE DESTROY
    SET POINT TO (THIS.SetPoint)
  ENDPROC

 PROCEDURE LOAD
    SYS(2333,1)
    THIS.SetPoint = SET("Point")
    SET POINT TO .
    SET SAFETY OFF
    CREATE CURSOR temp (Mark C(5), Lat N(12,6), Lon N(12,6), Zoom I(4))
    INSERT INTO TEMP VALUES ('MARK',-2.142607,-79.883308,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142264,-79.883137,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141921,-79.882965,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141578,-79.882793,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141235,-79.882622,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140827,-79.882493,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140463,-79.882622,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140184,-79.882793,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139905,-79.883029,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139626,-79.883265,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139519,-79.88378,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139862,-79.884424,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140205,-79.885046,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140527,-79.885626,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140849,-79.886205,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141106,-79.886785,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141363,-79.887364,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141621,-79.887943,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141878,-79.888523,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141921,-79.889102,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142435,-79.888973,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142564,-79.888437,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142971,-79.888072,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143379,-79.887815,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143786,-79.887471,15)
   INSERT INTO TEMP VALUES ('MARK',-2.144194,-79.887128,15)
   INSERT INTO TEMP VALUES ('MARK',-2.144601,-79.886806,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145008,-79.886484,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145352,-79.886055,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145652,-79.88554,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145952,-79.885025,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146359,-79.88524,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146681,-79.885433,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147003,-79.885626,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147324,-79.885798,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147689,-79.885862,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148053,-79.886076,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148504,-79.886141,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148954,-79.886205,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149404,-79.88627,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149855,-79.886334,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150305,-79.886334,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150755,-79.886291,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150927,-79.88657,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151012,-79.887042,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150991,-79.887557,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151098,-79.888072,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151205,-79.888587,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151313,-79.889102,15)
   INSERT INTO TEMP VALUES ('MARK',-2.15142,-79.889617,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151484,-79.890132,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151548,-79.890647,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151634,-79.891162,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151763,-79.891548,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151806,-79.891934,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151613,-79.892299,15)
   INSERT INTO TEMP VALUES ('MARK',-2.151334,-79.892664,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150862,-79.892546,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150455,-79.892331,15)
   INSERT INTO TEMP VALUES ('MARK',-2.150133,-79.892106,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149662,-79.892052,15)
   INSERT INTO TEMP VALUES ('MARK',-2.149318,-79.892149,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148943,-79.892288,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148514,-79.892557,15)
   INSERT INTO TEMP VALUES ('MARK',-2.148161,-79.892836,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147775,-79.893072,15)
   INSERT INTO TEMP VALUES ('MARK',-2.147367,-79.89334,15)
   INSERT INTO TEMP VALUES ('MARK',-2.14697,-79.893587,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146499,-79.893866,15)
   INSERT INTO TEMP VALUES ('MARK',-2.146166,-79.894069,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145845,-79.894316,15)
   INSERT INTO TEMP VALUES ('MARK',-2.145266,-79.894681,15)
   INSERT INTO TEMP VALUES ('MARK',-2.14488,-79.895003,15)
   INSERT INTO TEMP VALUES ('MARK',-2.144237,-79.895368,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143743,-79.895689,15)
   INSERT INTO TEMP VALUES ('MARK',-2.143164,-79.896076,15)
   INSERT INTO TEMP VALUES ('MARK',-2.142478,-79.896505,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141856,-79.896955,15)
   INSERT INTO TEMP VALUES ('MARK',-2.141235,-79.897363,15)
   INSERT INTO TEMP VALUES ('MARK',-2.140613,-79.897771,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139991,-79.898179,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139466,-79.897846,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139112,-79.897299,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138854,-79.896784,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138468,-79.896312,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138061,-79.895818,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137654,-79.895411,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137396,-79.89496,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137139,-79.894509,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136732,-79.893994,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136324,-79.893479,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135917,-79.89305,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135617,-79.892621,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135359,-79.892192,15)
   INSERT INTO TEMP VALUES ('MARK',-2.13493,-79.891677,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134394,-79.89114,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134051,-79.890625,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133558,-79.89011,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133258,-79.889767,15)
   INSERT INTO TEMP VALUES ('MARK',-2.132958,-79.889317,15)
   INSERT INTO TEMP VALUES ('MARK',-2.132915,-79.888887,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133043,-79.888437,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133365,-79.888158,15)
   INSERT INTO TEMP VALUES ('MARK',-2.133815,-79.887815,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134266,-79.887471,15)
   INSERT INTO TEMP VALUES ('MARK',-2.134587,-79.887214,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135166,-79.886785,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135617,-79.886441,15)
   INSERT INTO TEMP VALUES ('MARK',-2.135831,-79.886184,15)
   INSERT INTO TEMP VALUES ('MARK',-2.13611,-79.885948,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136431,-79.885712,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136689,-79.885454,15)
   INSERT INTO TEMP VALUES ('MARK',-2.136989,-79.885197,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137289,-79.884939,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137611,-79.884746,15)
   INSERT INTO TEMP VALUES ('MARK',-2.137932,-79.884489,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138233,-79.884231,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138533,-79.88436,15)
   INSERT INTO TEMP VALUES ('MARK',-2.13864,-79.88466,15)
   INSERT INTO TEMP VALUES ('MARK',-2.138833,-79.884896,15)
   INSERT INTO TEMP VALUES ('MARK',-2.139047,-79.885175,15)

 ENDPROC

      
 PROCEDURE init
    
    TEXT TO lcHtml NOSHOW TEXTMERGE
        <html> <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <title>Google Maps</title>
        <script src="http://maps.google.com/maps?file=api&v=2&key=123"    type="text/javascript"></script>
        <script type="text/javascript">
        //<![CDATA[
       
       var data = [
   ENDTEXT
   
      SELECT temp
      rec = RECNO()
      GO top
      SCAN
         IF RECNO() <> rec
            TEXT TO lcHtml NOSHOW TEXTMERGE ADDITIVE
                {lat:<<ALLTRIM(STR(temp.Lat,12,6))>>,lon:<<TRANSFORM(temp.Lon)>>},
             ENDTEXT          
          ELSE
             TEXT TO lcHtml NOSHOW TEXTMERGE ADDITIVE
                {lat:<<ALLTRIM(STR(temp.Lat,12,6))>>,lon:<<TRANSFORM(temp.Lon)>>}
             ENDTEXT          
          ENDIF
       ENDSCAN   
       
   TEXT TO lcHtml NOSHOW TEXTMERGE ADDITIVE
         ];
         var map = null;
         var route = null;
         var busMarker = null;
         var point = null;
         var count = 0;
         var delay = 100;
         var k=0;         
         function load()
         {         
              if (GBrowserIsCompatible())
              {       
             
              
                   var baseIcon = new GIcon();
                   baseIcon.iconSize=new GSize(32,32);
                   baseIcon.shadowSize=new GSize(56,32);
                   baseIcon.iconAnchor=new GPoint(16,32);
                   baseIcon.infoWindowAnchor=new GPoint(16,0);
                                   
                      var bus = new GIcon(baseIcon, "http://maps.google.com/mapfiles/kml/shapes/bus.png");                   
                   
                     function createMarker(point,html,icon) {
                    var marker = new GMarker(point,icon);
                    GEvent.addListener(marker, "click", function() {
                      marker.openInfoWindowHtml(html);
                    });
                    return marker;
                  }
   
                 map = new GMap2(document.getElementById("map"));
                 map.setCenter(new GLatLng(-2.142264, -79.883180), 15);
[Você precisa estar registrado e conectado para ver este link.] // Vue satelite
map.setMapType(G_NORMAL_MAP); // Vue carte
[Você precisa estar registrado e conectado para ver este link.] // Vue mixte
map.addControl(new GScaleControl()) ;          
             
            
      
         
         
                 var customUI = map.getDefaultUI();
                    customUI.maptypes.hybrid = true;
                    map.setUI(customUI); 
                           
                    var point = new GLatLng(data[count].lat, data[count].lon);
                 Marker = createMarker(point,"Hola",bus);
                 map.addOverlay(Marker);
                 route = setTimeout("moveTheBus()", 3000);
   
                
              }
          }
         
          function moveTheBus()
          {
               count++;
               if(count > data.length - 1)
               {
                  count = 0;
                  map.clearOverlays(polyline);
       map.addOverlay(Marker);
                }
               point = new GLatLng(data[count].lat, data[count].lon);
               Marker.setLatLng(point);    
               route = setTimeout("moveTheBus()",delay);
         if (k++>=15){
          map.panTo( point );
          k=0;
         
          }
if (count>=1){
var polyline = new GPolyline([
new GLatLng(data[count-1].lat, data[count-1].lon),
new GLatLng(data[count].lat, data[count].lon)], "#FF6600", 10);
map.addOverlay(polyline);
          }
      
}         
        //]]>
        </script> </head>
        <body scroll="no" bgcolor="#CCCCCC" topmargin="0" leftmargin="0"
        onload="load()" onunload="GUnload()">
        <div id="map" style="width:100%; height: 100%"></div>
        </body> </html>     
    ENDTEXT
      
    STRTOFILE(lcHtml,"MiHtml.htm")
   THISFORM.oleIE.Navigate2(FULLPATH("MiHtml.htm"))

  ENDPROC
ENDDEFINE

avatar
alceu11
Usuário 5 Estrelas
Usuário 5 Estrelas


Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo


 
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum