This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double latitude = -23.65465; | |
double longitude = -46.45675; | |
Point point = new Point(latitude, longitude); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view.startMapOn(<coloque_seu_token_aqui>, <ponto_inicial>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mapTemplate drawRoute:routeInfo]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RouteInfo * routeInfo = [RouteQuery doRoute:route withToken:TOKEN]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MLRoute *route = [[MLRoute alloc] initWithStartGeocodedAddress:startAddress | |
andEndGeocodedAddress:endAddress | |
andRouteOptions:routeOptions]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MLRouteOptions * routeOptions = [[MLRouteOptions alloc] | |
initWithRouteStyle:[MLRouteStyle FASTEST] | |
andUnitOfMeasurement:[MLUnitOfMeasurement KM]]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Cria endereço de saída | |
MLAddress *saida = [[MLAddress alloc] | |
initWithStreet:@"Rua Funchal" | |
andBuildingNumber:@"129" | |
andNeighborhood:@"Vila Olímpia" | |
andCity:@"São Paulo" | |
andState:@"SP" | |
andPostalCode:nil]; | |
MLGeocodedAddress *startAddress = [[MLAddressGeocoder geocodeWithToken:TOKEN address:saida]objectAtIndex:0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map.drawRouteOnMap(routeInfo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RouteInfo routeInfo = null; | |
try { | |
//Calcula a rota | |
routeInfo = RouteQuery.doRoute(token, route); | |
} catch (CouldNotCompleteRouteException e) { | |
e.printStackTrace(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Route route = new Route(geocodedStartAddress.get(0), geocodedEndAddress.get(0), routeOptions); |