Commit 37596b3855a5c3a63b1ad8f51cb6370d7d2c4e82

Authored by Edmar Moretti
1 parent 5533b842

MOdificação na função de cálculo de rotas, passando a utilizar os valores das co…

…ordenadas ao invés do endereço.
Showing 1 changed file with 4 additions and 8 deletions   Show diff stats
ferramentas/googlemaps/index.php
@@ -173,7 +173,6 @@ include_once("../../ms_configura.php"); @@ -173,7 +173,6 @@ include_once("../../ms_configura.php");
173 parametros += '&tilemode=gmap'; 173 parametros += '&tilemode=gmap';
174 parametros += '&tile={X}+{Y}+{Z}'; 174 parametros += '&tile={X}+{Y}+{Z}';
175 return(cgi+parametros); 175 return(cgi+parametros);
176 -  
177 } 176 }
178 function ativaI3geo() 177 function ativaI3geo()
179 { 178 {
@@ -219,6 +218,7 @@ include_once("../../ms_configura.php"); @@ -219,6 +218,7 @@ include_once("../../ms_configura.php");
219 counterClick = 0; 218 counterClick = 0;
220 GEvent.removeListener(rotaEvento) 219 GEvent.removeListener(rotaEvento)
221 constroiRota() 220 constroiRota()
  221 + montaRota();
222 } 222 }
223 } 223 }
224 224
@@ -263,8 +263,6 @@ include_once("../../ms_configura.php"); @@ -263,8 +263,6 @@ include_once("../../ms_configura.php");
263 place = response.Placemark[0]; 263 place = response.Placemark[0];
264 point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]); 264 point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
265 marker = new GMarker(point); 265 marker = new GMarker(point);
266 -  
267 - /*  
268 marker.openInfoWindowHtml( 266 marker.openInfoWindowHtml(
269 '<b>orig latlng:</b>' + response.name + '<br/>' + 267 '<b>orig latlng:</b>' + response.name + '<br/>' +
270 '<b>latlng:</b>' + place.Point.coordinates[0] + "," + place.Point.coordinates[1] + '<br>' + 268 '<b>latlng:</b>' + place.Point.coordinates[0] + "," + place.Point.coordinates[1] + '<br>' +
@@ -273,7 +271,6 @@ include_once(&quot;../../ms_configura.php&quot;); @@ -273,7 +271,6 @@ include_once(&quot;../../ms_configura.php&quot;);
273 '<b>Address:</b>' + place.address + '<br>' + 271 '<b>Address:</b>' + place.address + '<br>' +
274 '<b>Accuracy:</b>' + place.AddressDetails.Accuracy + '<br>' + 272 '<b>Accuracy:</b>' + place.AddressDetails.Accuracy + '<br>' +
275 '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode); 273 '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode);
276 - */  
277 endereco1 = place.address; 274 endereco1 = place.address;
278 endereco1 = window.prompt("Endereco do inicio",endereco1) 275 endereco1 = window.prompt("Endereco do inicio",endereco1)
279 if (endereco1!=null && endereco1!="") 276 if (endereco1!=null && endereco1!="")
@@ -282,10 +279,8 @@ include_once(&quot;../../ms_configura.php&quot;); @@ -282,10 +279,8 @@ include_once(&quot;../../ms_configura.php&quot;);
282 geocoder.getLocations(pontoRota2, pt2); 279 geocoder.getLocations(pontoRota2, pt2);
283 } 280 }
284 } 281 }
285 -  
286 -  
287 } 282 }
288 - geocoder.getLocations(pontoRota1, pt1); 283 + //geocoder.getLocations(pontoRota1, pt1);
289 } 284 }
290 function montaRota() 285 function montaRota()
291 { 286 {
@@ -301,7 +296,8 @@ include_once(&quot;../../ms_configura.php&quot;); @@ -301,7 +296,8 @@ include_once(&quot;../../ms_configura.php&quot;);
301 descrota.innerHTML = "" 296 descrota.innerHTML = ""
302 } 297 }
303 directions = new GDirections(map, descrota); 298 directions = new GDirections(map, descrota);
304 - directions.load("from: "+endereco1+" to: "+endereco2); 299 + //directions.load("from: "+endereco1+" to: "+endereco2);
  300 + directions.load("from: "+pontoRota1.lat()+","+pontoRota1.lng()+" to: "+pontoRota2.lat()+","+pontoRota2.lng());
305 GEvent.addListener(directions, "load", function() { 301 GEvent.addListener(directions, "load", function() {
306 var linha = directions.getPolyline(); 302 var linha = directions.getPolyline();
307 var nvertices = linha.getVertexCount(); 303 var nvertices = linha.getVertexCount();