Thank you for your interest in my script.
If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here.
To download it, please click here.
Thanks so much!
Taxi Fare Calculator is a JavaScript code that calculates taxi fare.
Autocomplete has been added so that to make address selection easy.
You can also click on a location on the map to get the address instead of typing via keyboard.
You can also optimize the path to minimize the travel time and save money.
It utilizes Google Places, Geocoding and Directions APIs.
Click the Add Location button to add multiple locations.
The first location should be the start location.
The last location should be the destination location.
You can also click on the map on your desired location to get address of that location.
The address will be displayed in the Location text box. First click
inside the location box and then click on the desired location on the map.
Path Optimization:
Check Optimize Path check box if you want to optimize the path. If you want to visit multiple locations
and you don't know where to visit first, second and so on, then check this option to display the directions in the proper
order so that to minimize your travel time and hence save money.
Remove Location:
To remove a location, click the cross icon on the right side of the location box.
Calculate Fare:
Click the Calculate Fare button to calculate fare.
This will also display the directions on the map.
The fare break down will be displayed in a separate panel (below the locations).
Clearing Locations:
If you want to clear all locations then click the Reset button and click OK
from the confirmation dialog. The form will also be reset.
Get JSON:
If you want to get JSON of all the locations and fare break down, click Get JSON button.
Add your key in the following line (replace YOUR_API_KEY with your Google Maps API key).
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=places&key=YOUR_API_KEY"></script>
Please make sure to enable below APIs for your API key from the Google Console.
Currently the taxi fare calculator has been set to operate in limited countries. But you can enable more countries easily. Please see the steps below.
Open the JavaScript file '<root>/scripts/googleMap.js'.
Find the JavaScript array 'fareList'.
Add the new country to the list by specifying the country name, currency, starting price as well as the price per KM.
Save the file.
Once again, thank you so much for your interest in this script.
As I said at the beginning, I'd be glad to help you if you have any questions relating to this script.
No guarantees, but I'll do my best to assist. If you have a more general question relating to the
apps on CodeCanyon, you might consider visiting the forums and asking your question in the "Item Discussion" section.