|
MapAddItinerary to Windev Mobile for < version 20 |
Iniciado por adrianoboller, 13,dic. 2014 20:35 - 18 respuestas |
| |
| | | |
|
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 13,diciembre 2014 - 20:35 |
Link de como fazer um itinerario
http://maps.googleapis.com/maps/api/directions/xml?origin=dr.+goulin+1661&destination=clavio+molinari+1029
Xml Result
<status>OK</status> <route> <summary>Av. Victor Ferreira do Amaral</summary> <leg> <step> <travel_mode>DRIVING</travel_mode> <start_location> <lat>-25.4189503</lat> <lng>-49.2445516</lng> </start_location> <end_location> <lat>-25.4189929</lat> <lng>-49.2440539</lng> </end_location> <polyline> <points>lsczClaqkHFcB</points> </polyline> <duration> <value>6</value> <text>1 min</text> </duration> <html_instructions>Siga na direção <b>leste</b> na <b>R. Dr. Goulin</b> em direção Ă <b>Rua Flávio Dallegrave</b></html_instructions> <distance> <value>50</value> <text>50 m</text> </distance> </step> <step> <travel_mode>DRIVING</travel_mode> <start_location> <lat>-25.4189929</lat> <lng>-49.2440539</lng> </start_location> <end_location> <lat>-25.4177243</lat> <lng>-49.2437741</lng> </end_location> <polyline> <points>tsczCh~pkHUGa@Ka@G[Eq@IuAK</points> </polyline> <duration> <value>38</value> <text>1 min</text> </duration> <html_instructions>Vire Ă <b>esquerda</b> na <b>Rua Flávio Dallegrave</b></html_instructions> <distance> <value>144</value> <text>0,1 km</text> </distance> <maneuver>turn-left</maneuver> </step> <step> <travel_mode>DRIVING</travel_mode> <start_location> <lat>-25.4177243</lat> <lng>-49.2437741</lng> </start_location> <end_location> <lat>-25.4179433</lat> <lng>-49.2411403</lng> </end_location> <polyline> <points>vkczCp|pkHD_@Bu@@S@U@e@@K@o@@UDy@@a@HsB@a@@c@</points> </polyline> <duration> <value>39</value> <text>1 min</text> </duration> <html_instructions>Pegue a 1ÂŞ <b>Ă direita</b> para <b>R. Augusto Stresser</b></html_instructions> <distance> <value>266</value> <text>0,3 km</text> </distance> </step> <step> <travel_mode>DRIVING</travel_mode> <start_location> <lat>-25.4179433</lat> <lng>-49.2411403</lng> </start_location> <end_location> <lat>-25.4280589</lat> <lng>-49.2415964</lng> </end_location> <polyline> <points>bmczCblpkHnAq@RKb@UHEr@_@jAm@`Ag@`@QPIf@QJEHAJAHAPA^@NBPD@@b@VvCrBZX`D|Bf@^ZV`Av@TNvA|@h@VVJXHXDfANV@T?T?VCTC`@Eb@IfAQfAS^M|Bm@ZKb@SXK@AJENIj@U</points> </polyline> <duration> <value>91</value> <text>2 minutos</text> </duration> <html_instructions>Vire Ă <b>direita</b> na <b>Av. Nossa Senhora da Luz</b></html_instructions> <distance> <value>1259</value> <text>1,3 km</text> </distance> <maneuver>turn-right</maneuver> </step> <step> <travel_mode>DRIVING</travel_mode> <start_location> <lat>-25.4280589</lat> <lng>-49.2415964</lng> </start_location> <end_location> <lat>-25.4282871</lat> <lng>-49.2414666</lng> </end_location> <polyline> <points>jlezC~npkHl@Y</points> </polyline> <duration> <value>2</value> <text>1 min</text> </duration> <html_instructions>Continue para <b>Av. Mal. Humberto de Alencar Castelo Branco</b></html_instructions> <distance> <value>29</value> <text>29 m</text> </distance> </step> <step> <travel_mode>DRIVING</travel_mode> <start_location> <lat>-25.4282871</lat> <lng>-49.2414666</lng> </start_location> <end_location> <lat>-25.4276407</lat> <lng>-49.2405798</lng> </end_location> <polyline> <points>xmezCdnpkHJSBGBG@C@E?C?A?C?CAECCWGWEKCKEIGIEACEEGGGGGKKOKO</points> </polyline> <duration> <value>20</value> <text>1 min</text> </duration> <html_instructions>Curva acentuada Ă <b>esquerda</b> na rampa de acesso a <b>R. Papa Rafael</b></html_instructions> <distance> <value>142</value> <text>0,1 km</text> </distance> </step> <step> <travel_mode>DRIVING</travel_mode> <start_location> <lat>-25.4276407</lat> <lng>-49.2405798</lng> </start_location> <end_location> <lat>-25.4273992</lat> <lng>-49.2394639</lng> </end_location> <polyline> <points>viezCrhpkHEIEKMg@I_@G]CSAQ?Y@c@</points> </polyline> <duration> <value>8</value> <text>1 min</text> </duration> <html_instructions>Continue para <b>R. Papa Rafael</b></html_instructions> <distance> <value>117</value> <text>0,1 km</text> </distance> </step> <step> <travel_mode>DRIVING</travel_mode> <start_location> <lat>-25.4273992</lat> <lng>-49.2394639</lng> </start_location> <end_location> <lat>-25.4308316</lat> <lng>-49.2076653</lng> </end_location> <polyline> <points>fhezCrapkHNsCJqC?KZ_GF_AN}CP_DN}CHiABo@Da@@MZyE@[VyDH_BJ_BFoAFkADkA@_@BY@[NcCFiADo@Do@ZaHR}DV{DBc@TcEFwAFqBBq@Do@Bi@B_@f@uJP_DJkBHeBNoCNgC@YPgDPgD@W?E@KBWZmGBw@R}CD{@LiCDq@f@_K</points> </polyline> <duration> <value>212</value> <text>4 minutos</text> </duration> <html_instructions>Continue para <b>Av. Victor Ferreira do Amaral</b></html_instructions> <distance> <value>3216</value> <text>3,2 km</text> </distance> </step> <step> <travel_mode>DRIVING</travel_mode> <start_location> <lat>-25.4308316</lat> <lng>-49.2076653</lng> </start_location> <end_location> <lat>-25.4392423</lat> <lng>-49.2122606</lng> </end_location> <polyline> <points>t}ezC|zikHr@Vp@X|DfB\NnD~AdBv@dBv@bB|@fB|@bEdB~Ap@~Ar@p@Zn@Xn@Xn@Xn@Xn@Zp@Xn@X</points> </polyline> <duration> <value>136</value> <text>2 minutos</text> </duration> <html_instructions>Vire Ă <b>direita</b> na <b>R. Pastor Manoel VirgĂnio de Souza</b></html_instructions> <distance> <value>1043</value> <text>1,0 km</text> </distance> <maneuver>turn-right</maneuver> </step> <step> <travel_mode>DRIVING</travel_mode> <start_location> <lat>-25.4392423</lat> <lng>-49.2122606</lng> </start_location> <end_location> <lat>-25.4404691</lat> <lng>-49.2094845</lng> </end_location> <polyline> <points>frgzCrwjkHfAaDfAaDdAaD^eA</points> </polyline> <duration> <value>59</value> <text>1 min</text> </duration> <html_instructions>Vire Ă <b>esquerda</b> na <b>R. Clávio Molinari</b><div style="font-size:0.9em">O destino estará Ă esquerda</div></html_instructions> <distance> <value>310</value> <text>0,3 km</text> </distance> <maneuver>turn-left</maneuver> </step> <duration> <value>611</value> <text>10 minutos</text> </duration> <distance> <value>6576</value> <text>6,6 km</text> </distance> <start_location> <lat>-25.4189503</lat> <lng>-49.2445516</lng> </start_location> <end_location> <lat>-25.4404691</lat> <lng>-49.2094845</lng> </end_location> <start_address>Rua Doutor Goulin, 1661 - Alto da GlĂłria, Matriz, Curitiba - PR, 80040-280, Brasil</start_address> <end_address>Rua Clávio Molinari, 1029 - CapĂŁo da Imbuia, Cajuru, Curitiba - PR, 82810-210, Brasil</end_address> </leg> <copyrights>Dados cartográficos ©2014 Google</copyrights> <overview_polyline> <points>lsczClaqkHFcBUGcASmAOuAKD_@DiAB{@JkCN{EpCyAbFgCx@[TGTCp@?`@Hd@X|JjH|AnAlBlA`Ab@r@N~APj@?rBWnCe@|C{@zAm@tB_ATg@@OAI[Kc@IUMYWg@s@KUWgAKq@Ak@\uIdA}Rb@yHv@}Lr@}Nb@mHn@_NZ_F\{GJcDLyBbCae@lAmU`AwRdBp@zEvBtGvChEtBfB|@bEdB~DdB`EhB`EhBtFkP</points> </overview_polyline> <bounds> <southwest> <lat>-25.4404691</lat> <lng>-49.2445516</lng> </southwest> <northeast> <lat>-25.4177243</lat> <lng>-49.2076653</lng> </northeast> </bounds> </route> |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 13,diciembre 2014 - 20:37 |
Procedure WS_CEP_Rota(LOCAL Origem, LOCAL Destino, LOCAL DebugSN)
IF GloDebugSN = "S" THEN DebugSN = "S" END
IF Origem <> "" AND Destino = "" THEN Destino = Origem END
nVirgula is int = 0
nID_Numero is int = 1 nID_Endereco is int = 1 nID_Bairro01 is int = 1 nID_Bairro02 is int = 1 nID_Cidade01 is int = 1 nID_Cidade02 is int = 1 nID_Estado is int = 1 nID_Pais is int = 1 nID_CEP is int = 1 nQTD_ADDRESS_COMPONENT is int = 0
GloVoceEnderecoLongo = "ERRO" GloDestinoEnderecoLongo = "ERRO" GloVoceLatitude = 0 GloVoceLongitude = 0 GloDestinoLatitude = 0 GloDestinoLongitude = 0
GloLatitudeNorte = "" GloLongitudeNorte = ""
GloLatitudeSul = "" GloLongitudeSul = ""
GloTempoDestino = "" GloTempoDestinoText = "" GloTempoTaxi = ""
GloDistanciaDestino = "" GloDistanciaDestinoText = "" GloDistanciaTaxi = ""
ok is boolean = False
IF Origem <> "" AND Destino <> ""
ChangeCharset(charsetOccidental)
Origem = Replace(Origem," ","+")
Origem = Capitalize(WS_RemoveAcentos(Origem))
Destino = Replace(Destino," ","+")
Destino = Capitalize( WS_RemoveAcentos(Destino))
UrlRota is string = "http://maps.googleapis.com/maps/api/directions/xml?origin="+Origem+"&destination="+Destino+"&sensor=false&mode=driving"
IF DebugSN ="S" THEN Info("URL Busca Origem Google",UrlRota) END ok = HTTPRequest(UrlRota)
IF ok = True THEN
XmlResultado is string = WS_Android_IOS_HTTPGetResult()
IF PositionOccurrence(XmlResultado,"<status>OK</status>",firstRank,FromBeginning) > 0 OR PositionOccurrence(XmlResultado,"<status>ok</status>",firstRank,FromBeginning) > 0
XmlResultado = WS_RemoveAcentos(XmlResultado)
IF Length(XmlResultado) > 0 THEN
GloRotaEncode = XmlResultado nInicioPoint is int = PositionOccurrence(XmlResultado,"<copyrights>",firstRank,FromBeginning) GloRotaEncode = Middle(XmlResultado,nInicioPoint,Length(XmlResultado)) nInicioPoint = PositionOccurrence(XmlResultado,"<points>",firstRank,FromBeginning) nFinalPoint is int = PositionOccurrence(XmlResultado,"</points>",firstRank,FromBeginning) GloRotaEncode = Middle(XmlResultado,nInicioPoint,nFinalPoint-nInicioPoint)
Info("POINT",GloRotaEncode)
sXmlResultadoRecorte is string = XmlResultado
XmlResultado = WS_RemoveCaracteresRota(XmlResultado)
IF DebugSN ="S" THEN Info("Retorno XML Busca Origem",XmlResultado) END
nInicio is int = PositionOccurrence(XmlResultado,"</step>",lastRank,FromBeginning) + 7 XmlResultado = Middle(XmlResultado,nInicio,Length(XmlResultado)) XmlResultado = "<leg>"+XmlResultado
nFim is int = PositionOccurrence(XmlResultado,"</leg>",firstRank,FromBeginning) + 5 XmlResultado = Middle(XmlResultado,1,nFim)
IF IniOSMode() = True THEN
NoXml is string = XMLExtractString(XmlResultado,"leg")
GloVoceEnderecoLongo = XMLExtractString(NoXml,"start_address") GloVoceEnderecoLongo = Capitalize(GloVoceEnderecoLongo)
GloDestinoEnderecoLongo = XMLExtractString(NoXml,"end_address") GloDestinoEnderecoLongo = Capitalize(GloDestinoEnderecoLongo)
NoXml1 is string = XMLExtractString(NoXml,"duration") GloTempoDestino = XMLExtractString(NoXml1,"value") GloTempoDestinoText = XMLExtractString(NoXml1,"text") GloTempoTaxi = GloTempoDestino
NoXml1 = XMLExtractString(NoXml,"distance") GloDistanciaDestino =XMLExtractString(NoXml1,"value") GloDistanciaDestinoText = XMLExtractString(NoXml1,"text") GloDistanciaTaxi = GloDistanciaDestino
NoXml1 = XMLExtractString(NoXml,"start_location") IF Val(XMLExtractString(NoXml1,"lat")) < 0 GloVoceLatitude = XMLExtractString(NoXml1,"lat") GloVoceLongitude = XMLExtractString(NoXml1,"lng") END
NoXml1 = XMLExtractString(NoXml,"end_location") IF Val(XMLExtractString(NoXml1,"lat")) < 0 THEN GloDestinoLatitude = XMLExtractString(NoXml1,"lat") GloDestinoLongitude = XMLExtractString(NoXml1,"lng") END
ELSE IF InAndroidMode() = True
XmlDoc02 is XMLDocument XmlDoc02 = XMLOpen(XmlResultado,fromString)
GloVoceEnderecoLongo = XmlDoc02.leg.start_address GloVoceEnderecoLongo = Capitalize(GloVoceEnderecoLongo)
GloDestinoEnderecoLongo = XmlDoc02.leg.end_address GloDestinoEnderecoLongo = Capitalize(GloDestinoEnderecoLongo)
GloTempoDestino = XmlDoc02.leg.duration.value GloTempoDestinoText = XmlDoc02.leg.duration.text GloTempoTaxi = GloTempoDestino
GloDistanciaDestino = XmlDoc02.leg.distance.value GloDistanciaDestinoText = XmlDoc02.leg.distance.text GloDistanciaTaxi = GloDistanciaDestino
IF XmlDoc02.leg.start_location.lat < 0 GloVoceLatitude = XmlDoc02.leg.start_location.lat GloVoceLongitude = XmlDoc02.leg.start_location.lng END
IF XmlDoc02.leg.end_location.lat < 0 THEN GloDestinoLatitude = XmlDoc02.leg.end_location.lat GloDestinoLongitude = XmlDoc02.leg.end_location.lng END
END
END
ELSE GloDestinoEndereco = "" GloDestinoEnderecoLongo = ""
GloTempoDestino = "" GloDistanciaDestino = "" END
END
END
IF DebugSN = "S" THEN Info(GloRotaEncode) Info("Origem:",GloVoceEnderecoLongo,GloVoceEndereco,"","Destino:",GloDestinoEnderecoLongo,GloDestinoEndereco,"","Tempo: "+GloTempoDestino,"Distancia: "+GloDistanciaDestino,"","Latitude Origem: "+GloVoceLatitude,"Longitute Origem: "+GloVoceLongitude,"","Latitude Destino: "+GloDestinoLatitude,"Longitude Destino: "+GloDestinoLongitude) END
IF QtdeOccurrence(GloVoceEnderecoLongo," - ") = 1 GloVoceEndereco = "" GloVoceNumero = "" GloVoceEnderecoLongo = "ERRO" GloVoceLatitude = 0 GloVoceLongitude = 0 END
IF QtdeOccurrence(GloDestinoEnderecoLongo," - ") = 1 GloDestinoEndereco = "" GloDestinoNumero = "" GloDestinoEnderecoLongo = "ERRO" END IF DebugSN = "S" IF GloVoceEnderecoLongo = "ERRO" OR GloDestinoEnderecoLongo = "ERRO" Info("Endereço inválido") END END
RESULT(GloVoceEnderecoLongo) |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 13,diciembre 2014 - 20:38 |
Procedure WS_Rota_DecodePoints(encoded is string)
encoded ="lsczClaqkHFcBUGcASmAOuAKM`DW~GMzDa@rKo@hQ]~KzF\TuHHoBFeBa@c@eBgB"
poly is array of LatLng
b, Shift, Tempresult is int = 0 Index, nLen is int = 0 Lat, Lng is real
nLen = Length(encoded)
WHILE (Index < nLen)
LOOP
Index++ b = Asc(encoded[[Index]]) - 63 Tempresult = BinaryOR(Tempresult,bitLeftShift(BinaryAND(b,0x1f),Shift)) Shift = Shift + 5
DO WHILE(b >= 0x20)
dlat is int
IF BinaryAND(Tempresult,1) <> 0 THEN
dlat = BinaryNOT(bitRightShift(Tempresult,1))
ELSE
dlat = bitRightShift(Tempresult,1)
END
Lat += dlat Shift = 0 Tempresult = 0
LOOP
Index++ b = Asc(encoded[[Index]]) - 63 Tempresult = BinaryOR(Tempresult,bitLeftShift( BinaryAND(b,0x1f),Shift)) Shift += 5;
DO WHILE (b >= 0x20)
Dlng is int
IF BinaryAND(Tempresult, 1) <> 0 THEN
Dlng = BinaryNOT(bitRightShift(Tempresult,1)) ELSE
Dlng = bitRightShift(Tempresult,1)
END
Lng += Dlng; Shift = 0 Tempresult = 0
point is LatLng point.Latitude = Lat / 100000 point.Longitude = Lng / 100000 ArrayAdd(poly,point)
END
RESULT poly
|
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 13,diciembre 2014 - 20:38 |
Procedure WS_Rota_DistanciaEntrePontos(x1 is real, x2 is real, y1 is real, y2 is real)
Dist is real = 0
IF x1 <> "" AND x2 <> "" AND y1 <> "" AND y2 <> "" THEN
Dist = Root( Power(x1-x2,2) + Power(y1-y2,2) )
ELSE
Info("Falta parametros para calcular a distancia da reta entre 2 pontos")
END
RESULT (Dist) |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 13,diciembre 2014 - 20:38 |
Procedure WS_Rota_Pitagoras(pA is real, pB is real, pC is real)
ABC is real = 0
IF pA = "" AND pB <> "" AND pC <> "" THEN
pA = Root(Power(pB,2) + Power(pC,2))
ABC = pA
ELSE IF pA <> "" AND pB = "" AND pC <> "" THEN
pB = Root(Power(pA,2) - Power(pC,2))
ABC = pB
ELSE IF pA <> "" AND pB <> "" AND pC = "" THEN
pC = Root(Power(pA,2) - Power(pB,2))
ABC = pC
END
RESULT(ABC) |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 13,diciembre 2014 - 20:39 |
Procedure WS_Rota_PlotarPontos(GoogleMapsPoint is string)
gloDesenhaItinerario = True
x is int = 1
MapDeleteAll(WIN_Taxi62.ControleMapa)
nInicial is int = 0 arryPoints is array of LatLng
pointA is LatLng pointB is LatLng
arryPoints = WS_Rota_DecodePoints(GoogleMapsPoint)
WHILE( x < ArrayCount(arryPoints))
pointA = arryPoints[x] pointB = arryPoints[x+1] nomeMaker++ MarkerPonto..Position.Latitude = pointA.Latitude MarkerPonto..Position.Longitude = pointA.Longitude MarkerPonto..Image = WIN_Taxi62.IMG_Ponto MarkerPonto..Name = "Itinerary"+nomeMaker MarkerPonto..Description = "Itinerary"+nomeMaker MapAddMarker(WIN_Taxi62.ControleMapa , MarkerPonto)
WS_Rota_PlotarXLinhas(pointA,pointB)
x++
END
MarkerPonto..Position.Latitude = pointB.Latitude MarkerPonto..Position.Longitude =pointB.Longitude MarkerPonto..Image = WIN_Taxi62.IMG_Ponto MarkerPonto..Name = "Itinerary"+x MarkerPonto..Description = "Itinerary"+x MapAddMarker(WIN_Taxi62.ControleMapa , MarkerPonto)
MapDisplayPosition(WIN_Taxi62.ControleMapa,WS_CentroReta(arryPoints[1],pointB))
|
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 15,diciembre 2014 - 11:57 |
This above code works on both Android and iOS, now in version 20 already has developed resource, but to the old versions use this encoding when the project is to run on the iphone and ipad.
Este codigo acima funciona tanto no Android como no iOS, já na versão 20 já tem o recurso desenvolvido, mas para as versões antigas use essa codificação quando o projeto for para rodar no iphone e no ipad.
|
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 15,diciembre 2014 - 12:28 |
Procedure MarcadorVoce()
IF GloDebugSN = "S" THEN Info("MarcadorVoce") END
IF gnPlane = 1 THEN
IF GloLatitude <> 0 AND GloLongitude <>0
IF gbBuscaPelaMira = True GeoVoce..Latitude = GloLatitude GeoVoce..Longitude = GloLongitude ELSE IF gbBuscaPelaMira = False GeoVoce..Latitude = GloVoceLatitude GeoVoce..Longitude = GloVoceLongitude END
END
END
IF (gnPlane = 2) THEN
IF GeoVoce <> Null AND GeoVoce..Latitude <> 0 AND GeoVoce..Longitude <> 0 THEN
MarkerVoce..Position = GeoVoce MarkerVoce..Name = "Voce" MarkerVoce..Image = IMG_Voce MapDeleteMarker(ControleMapa, MarkerVoce) MapAddMarker(ControleMapa , MarkerVoce) MapDisplayPosition(ControleMapa, GeoVoce)
END
END |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 15,diciembre 2014 - 12:28 |
Procedure MarcadorTaxi()
IF GloDebugSN = "S" THEN Info("MarcadorTaxi") END
MarkerTaxi..Position = GeoTaxi MarkerTaxi..Name = "Taxi" MarkerTaxi..Image = IMG_Taxi MapDeleteMarker(ControleMapa,MarkerTaxi) MapAddMarker(ControleMapa, MarkerTaxi) |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 15,diciembre 2014 - 12:29 |
Procedure GoogleMapsCentroReta(pointa is geoPosition, pointb is geoPosition)
cpoint is geoPosition cpoint..Latitude = (Min(pointa..Latitude,pointb..Latitude) + ((Max(pointa..Latitude,pointb..Latitude) - Min(pointa..Latitude,pointb..Latitude))/2)) cpoint..Longitude = (Min(pointa..Longitude,pointb..Longitude) + ((Max(pointa..Longitude,pointb..Longitude) - Min(pointa..Longitude,pointb..Longitude))/2))
RESULT cpoint |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 15,diciembre 2014 - 12:30 |
Procedure WS_Rota_PlotarPontos(GoogleMapsPoint is string,distancia is int)
ok is boolean = False
IF Length(GoogleMapsPoint) > 6
gloDesenhaItinerario = True
x is int = 1
nInicial is int = 0 arryPoints is array of LatLng
pointA is LatLng pointB is LatLng
arryPoints = WS_Rota_DecodePoints(GoogleMapsPoint)
WHILE( x < ArrayCount(arryPoints))
pointA = arryPoints[x] pointB = arryPoints[x+1] nomeMaker++ MarkerPonto..Position.Latitude = pointA.Latitude MarkerPonto..Position.Longitude = pointA.Longitude MarkerPonto..Image = WIN_Taxi62.IMG_Ponto MarkerPonto..Name = "Itinerary"+nomeMaker MarkerPonto..Description = "Itinerary"+nomeMaker MapAddMarker(WIN_Taxi62.ControleMapa , MarkerPonto)
WS_Rota_PlotarXLinhas(pointA,pointB,distancia)
x++
END
MarkerPonto..Position.Latitude = pointB.Latitude MarkerPonto..Position.Longitude = pointB.Longitude MarkerPonto..Image = WIN_Taxi62.IMG_Ponto MarkerPonto..Name = "Itinerary"+x MarkerPonto..Description = "Itinerary"+x MapAddMarker(WIN_Taxi62.ControleMapa , MarkerPonto)
gloDesenhaItinerario = False
IF pointB.Latitude <> "" AND pointB.Longitude <> "" THEN ok = True ELSE ok = False END
END
RESULT (ok) |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 15,diciembre 2014 - 12:49 |
Em caso de ter diversos pontos de coordenadas deve ordernar eles da seguinte forma
Em uma tabela terá que ter as seguintes informações ================================================ Pontos || latitude || longitude || distancia DO ponto inicial ================================================ 1 || -25.4544 || -49.45845 || 0 (Portão da Empresa OU GPS Atual)
2 || -25.4201646 ||-49.2458865 || 0
3 || -25.4000 || -49.65419 || 0
...
1 - Estabelecer o ponto de origem qual é o ponto inicial, sé é o valor da latitude / longitude atual DO GPS OU a porta de saida da empresa para fazer as entregas.
2 - Aplicar a função WS_CEP_Rota e descobrir as distancias
Em uma tabela terá que ter as seguintes informações - Order by distancia ================================================ Pontos || latitude || longitude || distancia DO ponto inicial ================================================ 1 || -25.4544 || -49.45845 || 0 (Portão da Empresa OU GPS Atual)
3 || -25.4000 || -49.65419 || 1276 = 1,3 km
2 || -25.4201646 ||-49.2458865 || 5132 = 5,1 km
http: ... |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 15,diciembre 2014 - 12:55 |
IN CASE you have different points of coordinates must to Sort them as follows
On a table will have to have the following information ====================================================== Points || latitude || longitude || from the starting point ====================================================== [quote][quote]1 || -25.4544 || -49.45845 || 0 (Gate Company OR Current GPS)[/quote][/quote]
2 || -25.4201646 || -49.2458865 || 0
[quote][quote]3 || -25.4000 || -49.65419 || 0[/quote][/quote]
...
1 - Establish the point of origin which is the starting point, sé is the value of latitude / longitude current GPS OR the company's outlet port to make deliveries.
2 - Apply the WS_CEP_Rota FUNCTION AND find the distances
On a table will have to have the following information - Order by distance ====================================================== Points || latitude || longitude || from the starting point ====================================================== 1 || -25.4544 ||-49.45845 || 0 (Gate Company OR Current GPS)
[quote][quote]3 || -25.4000 ||-49.65419 || 1276 = 1.3 km <
2 || -25.4201646 ||-49.2458865 || 5132 = 5.1 km
...
http:
..
http: ... |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 15,diciembre 2014 - 12:59 |
Applying HTTPRequest this Link below to Get distanca, time, coordinates of Address, Address, AND routes coded tracing the points that are coordinated arrays from the nearest route.
Aplicando HTTPRequest nesse Link abaixo obtem a distanca, o tempo, as coordenadas dos endereços, o endereço, e as rotas codificadas DO traçado nos points que são arrays de coordenadas da rota mais próxima.
http: |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 15,diciembre 2014 - 13:14 |
ProcedureGPS_Itinerario15Pontos_Iniciar(LOCALControleMapa,LOCALEnderecoSaida,LOCALEndInt01,LOCALEndInt02,LOCALEndInt03,LOCALEndInt04,LOCALEndInt05,LOCALEndInt06,LOCALEndInt07,LOCALEndInt08,LOCALEndInt09,LOCALEndInt10,LOCALEndInt11,LOCALEndInt12,LOCALEndInt13,LOCALEndInt14,LOCALEndInt15,LOCALEnderecoChegada,LOCALModoCBMP,LOCALCorRed,LOCALCorGreen,LOCALCorBlue,LOCALTransparencia,LOCALPixels)
Retorno isstring=""
IFControleMapa=""THEN ControleMapa=gloControleMapa END
IFModoCBMP="Carro"THEN ModoCBMP=itineraryCar ELSE IFModoCBMP="Bicicleta"THEN ModoCBMP=itineraryCyclist ELSE IFModoCBMP="Manual"THEN ModoCBMP=itineraryManual ELSE IFModoCBMP="Bicicleta"THEN ModoCBMP=itineraryPedestrian ELSE ModoCBMP=itineraryCar END
CorIntinerario isint=RGB(CorRed,CorGreen,CorBlue) IFCorIntinerario=0THEN CorIntinerario=RGB(255,0,0) END
IFTransparencia=""THEN Transparencia=60 END
IFPixels=""THEN Pixels=8 END
IFEndInt01="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt01<>""ANDEndInt02="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt02<>""ANDEndInt03="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt03<>""ANDEndInt04="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt04<>""ANDEndInt05="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt05<>""ANDEndInt06="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EndInt05,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt06<>""ANDEndInt07="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EndInt05,EndInt06,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt07<>""ANDEndInt08="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EndInt05,EndInt06,EndInt07,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt08<>""ANDEndInt09="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EndInt05,EndInt06,EndInt07,EndInt08,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt09<>""ANDEndInt10="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EndInt05,EndInt06,EndInt07,EndInt08,EndInt09,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt10<>""ANDEndInt11="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EndInt05,EndInt06,EndInt07,EndInt08,EndInt09,EndInt10,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt11<>""ANDEndInt12="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EndInt05,EndInt06,EndInt07,EndInt08,EndInt09,EndInt10,EndInt11,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt12<>""ANDEndInt13="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EndInt05,EndInt06,EndInt07,EndInt08,EndInt09,EndInt10,EndInt11,EndInt12,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt13<>""ANDEndInt14="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EndInt05,EndInt06,EndInt07,EndInt08,EndInt09,EndInt10,EndInt11,EndInt12,EndInt13,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt14<>""ANDEndInt15="" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EndInt05,EndInt06,EndInt07,EndInt08,EndInt09,EndInt10,EndInt11,EndInt12,EndInt13,EndInt14,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEndInt15<>"" gloGPS_ItinerarioID=MapAddItinerary(WIN_OS_04GPS.ControleMapa, [EnderecoSaida,EndInt01,EndInt02,EndInt03,EndInt04,EndInt05,EndInt06,EndInt07,EndInt08,EndInt09,EndInt10,EndInt11,EndInt12,EndInt13,EndInt14,EndInt15,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) END END
IFgloGPS_ItinerarioID=""THEN Info("Ocorreu um erro ao gerar o intinerario.",ErrorInfo()) Retorno=False ELSE Retorno=True END
RESULT(Retorno) |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 15,diciembre 2014 - 13:15 |
ProcedureGPS_Itinerario_Iniciar(LOCALControleMapa,LOCALEnderecoSaida,LOCALEnderecoChegada,LOCALModoCBMP,LOCALCorRed,LOCALCorGreen,LOCALCorBlue,LOCALTransparencia,LOCALPixels)
Retorno isstring=""
IFControleMapa=""THEN ControleMapa=gloControleMapa END
IFGPSStatus() =gpsEnabledORGPSStatus() =gpsAvailableTHEN
IFModoCBMP="Carro"THEN ModoCBMP=itineraryCar ELSE IFModoCBMP="Bicicleta"THEN ModoCBMP=itineraryCyclist ELSE IFModoCBMP="Manual"THEN ModoCBMP=itineraryManual ELSE IFModoCBMP="Bicicleta"THEN ModoCBMP=itineraryPedestrian END
CorIntinerario isint=RGB(CorRed,CorGreen,CorBlue)
IFEnderecoSaida<>""ANDEnderecoChegada<>"" gloGPS_ItinerarioID=MapAddItinerary(ControleMapa, [EnderecoSaida,EnderecoChegada],ModoCBMP,CorIntinerario,Transparencia,Pixels) ELSE IFEnderecoSaida=""ANDEnderecoChegada<>"" Info("Endereço de SaĂda Vazio!...") ELSE IFEnderecoChegada="" Info("Endereço de Chegada Vazio!...") END
IFgloGPS_ItinerarioID=""THEN Info("Ocorreu um erro ao gerar o intinerario.",ErrorInfo()) Retorno=False ELSE Retorno=True END
ELSE IFGPSStatus() =gpsDisabledTHEN
Info("GPS Desabilitado!")
ELSE IFGPSStatus() =gpsOffServiceORGPSStatus() =gpsUnavailableORGPSStatus() =gpsErrorTHEN
Info("Região sem serviço de GPS",ErrorInfo())
END
RESULT(Retorno) |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 17,noviembre 2015 - 21:28 |
Procedure WS_Rota_PlotarXLinhas(pointA is LatLng , pointB is LatLng, distancia is int)
IF pointA.Latitude <> "" AND pointB.Latitude <> "" AND pointA.Longitude <> "" AND pointB.Longitude <> ""
CountPoints is int nomeMaker is int metrosEntrePontos is int = 10
IF distancia>= 20000 THEN metrosEntrePontos = 50 ELSE IF distancia>= 15000 THEN metrosEntrePontos = 40 ELSE IF distancia>= 10000 THEN metrosEntrePontos = 30 ELSE IF distancia>= 5000 THEN metrosEntrePontos = 20 END
c1 is real = pointA.Latitude - pointB.Latitude c2 is real = pointA.Longitude - pointB.Longitude
CountPoints = Root(Power(c1,2) + Power(c2,2)) * (metrosDistancia / metrosEntrePontos)
IF CountPoints = 1 THEN CountPoints = 2 IF CountPoints > 0 THEN
c1 = c1 / CountPoints c2 = c2 / CountPoints
END
WHILE (CountPoints > 1)
CountPoints pointA.Latitude -= c1 pointA.Longitude -= c2 nomeMaker++
MarkerPonto..Position.Latitude = pointA.Latitude MarkerPonto..Position.Longitude = pointA.Longitude MarkerPonto..Image = WIN_Taxi62.IMG_Ponto MarkerPonto..Name = "Itinerary"+ nomeMaker MarkerPonto..Description = "Itinerary"+ nomeMaker MapAddMarker(WIN_Taxi62.ControleMapa , MarkerPonto)
END
END
-- Adriano Jose Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller ______________________________________________ |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 20,julio 2016 - 18:44 |
Prezados,
Como colocar eventos no controle de mapa no mobile:
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.com.br/ |
| |
| |
| | | |
|
| | |
| |
Miembro registrado 3.662 mensajes Popularité : +175 (223 votes) |
|
Publicado el 30,agosto 2016 - 02:11 |
Resumo de uso:
gPosicionPasajero is geoPosition HReadSeekFirst(ParticipantesEvento,ParticipantesEventoID,gnCodPasajero) IF HFound(ParticipantesEvento) THEN gPosicionPasajero..Latitude = ParticipantesEvento.LATITUD gPosicionPasajero..Longitude = ParticipantesEvento.LONGITUD END MapDisplayPosition(MAP_NoName1,MYPSOITION) gPosicionChofer is Marker gPosicionChofer..Position = MYPSOITION gPosicionChofer..Image = "car.png" MapAddMarker(MAP_NoName1,gPosicionChofer)
gPosicionCliente is Marker gPosicionCliente..Position = gPosicionPasajero gPosicionCliente..Image = "client.png" MapAddMarker(MAP_NoName1,gPosicionCliente) MapAddItinerary(MAP_NoName1,[gPosicionChofer,gPosicionCliente],itineraryCar,iDarkBlue,70,8) MAP_NoName1..Zoom = 12
-- Adriano José Boller ______________________________________________ Consultor e Representante Oficial da PcSoft no Brasil +55 (41) 9949 1800 adrianoboller@gmail.com skype: adrianoboller http://wxinformatica.com.br/ |
| |
| |
| | | |
|
| | | | |
| | |
|