Hi,
Is it possible in PHPRunner to do or setup with pickup and dropoff in map?
I've this manually outside phprunner in my other project. Im thinking if its possible to this in PHPRunner.
Thanks in advance.
This is MYSQL database Only . MSSQL may differ a little on queries , Access not suggested at all.
It can be done , but if you never used maps before in PHPrunner along with google GEOCODING , Start Here.
Make sure you read the bottom where it tells you how to GEOCODE the records and get the lat and lng coordinates. If you did not have these coordinates, you would not get value/pairs for each record . ( Google - will only geocode about 3000 records every 24 hours to one key ( you need to get a key from google maps - preferred method click here) so you have to geocode over several days if you have more records ) When you go to google to sign up for a key , just get the key and continue here ( go to pages screen in PHPrunner and click ( GEOCODING ) enter your key and code key there. Get the map to work first . I put the main map above the list page ( right click / Insert Map give space for map ) , with all the customers and addresses below in the data grid. Do not use clustering or heat map , as you want to see all points.
Then I sort by my alias
Then you have to add "Haversine formula" to the query of your table with the above ALIAS . This I do in a custom view as not to fool with my users main view , or now in 10.2 a second list page with inline edit of all the address info as well as lat, lng.
Now:Distance from one point to the next closest point : HAVERSINE FORMULA ( click here - very complicated , but use my query below to get started , You will have to change the query in red after you GEOCODE. ) Use the suggested field names lat and lng in your database although you can call them anything ( check documentation as to what datatype they must be in PHPrunner manual , just easier this way.
This is just a sample of my query to go from SOUTHEAST to NORTHEAST stating the distance from the first point to second to third etc....... ( can be sorted in the opposite direction just by clicking on distance on the list page )
For Example take a look at the map of Connecticut my lat field is on the New York - New York City Border , but my finishing latitude and longitude is on the Massachusetts and Rhode Island Border. As I stated just hit the alias on your table DISTANCE and you route the other way .
This is where you can change your field for PICKUP AND DROPOFF by adding your fields and distance from each point. This will give you a better idea of how involved this is and you will have to adjust to your objectives.
Like Pickup Point cordinates and dropoff point cordinates. and get distance totals with a little work on the below query and possible in events before record added and after record added. or edited.
Sample QUERY:,
SELECT
ID
,
custname
,
CustomerID
,
address
,
town
,
Employee
,
EmployeeID
,
orderdate
,
brand
,
fldzip
,
fldstate
,
Lat
,
Lng
,
[b]size="2") * sin((
fldmap,
fldgoing
FROM
[color="#ff0000"]MYCUSTOMTABLEVIEW`
in my custom list page2 or custom view . Change everything in red when you get to this point.
Once you get the hang of the inserting the map and getting the data , it is not that intensive to just change the query to your liking.
In your situation ( Pickup and Dropoff you need to add the fields and sort them by distance ) There are many ways to do this but hopefully this is a start.
Hope this helps a little.
Sources: "Google Maps API, Wikipedia Haversine Forumula, PHPRunner Manual"