Commit 37596b3855a5c3a63b1ad8f51cb6370d7d2c4e82
1 parent
5533b842
Exists in
master
and in
7 other branches
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 | 173 | parametros += '&tilemode=gmap'; |
| 174 | 174 | parametros += '&tile={X}+{Y}+{Z}'; |
| 175 | 175 | return(cgi+parametros); |
| 176 | - | |
| 177 | 176 | } |
| 178 | 177 | function ativaI3geo() |
| 179 | 178 | { |
| ... | ... | @@ -219,6 +218,7 @@ include_once("../../ms_configura.php"); |
| 219 | 218 | counterClick = 0; |
| 220 | 219 | GEvent.removeListener(rotaEvento) |
| 221 | 220 | constroiRota() |
| 221 | + montaRota(); | |
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
| ... | ... | @@ -263,8 +263,6 @@ include_once("../../ms_configura.php"); |
| 263 | 263 | place = response.Placemark[0]; |
| 264 | 264 | point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]); |
| 265 | 265 | marker = new GMarker(point); |
| 266 | - | |
| 267 | - /* | |
| 268 | 266 | marker.openInfoWindowHtml( |
| 269 | 267 | '<b>orig latlng:</b>' + response.name + '<br/>' + |
| 270 | 268 | '<b>latlng:</b>' + place.Point.coordinates[0] + "," + place.Point.coordinates[1] + '<br>' + |
| ... | ... | @@ -273,7 +271,6 @@ include_once("../../ms_configura.php"); |
| 273 | 271 | '<b>Address:</b>' + place.address + '<br>' + |
| 274 | 272 | '<b>Accuracy:</b>' + place.AddressDetails.Accuracy + '<br>' + |
| 275 | 273 | '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode); |
| 276 | - */ | |
| 277 | 274 | endereco1 = place.address; |
| 278 | 275 | endereco1 = window.prompt("Endereco do inicio",endereco1) |
| 279 | 276 | if (endereco1!=null && endereco1!="") |
| ... | ... | @@ -282,10 +279,8 @@ include_once("../../ms_configura.php"); |
| 282 | 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 | 285 | function montaRota() |
| 291 | 286 | { |
| ... | ... | @@ -301,7 +296,8 @@ include_once("../../ms_configura.php"); |
| 301 | 296 | descrota.innerHTML = "" |
| 302 | 297 | } |
| 303 | 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 | 301 | GEvent.addListener(directions, "load", function() { |
| 306 | 302 | var linha = directions.getPolyline(); |
| 307 | 303 | var nvertices = linha.getVertexCount(); | ... | ... |