4

My PSET8 function for Pickup seems to work perfectly except that I can pickup the same student multiple times. The way I understood it, once the placemark is removed, PASSENGERS.placemark for that specific student shouldn't exist, and therefore, when I calculate the distance, there should be nothing to calculate and the student shouldn't be within range. This clearly does not seem to be the case, since I am continuing to pick up the student and can even access that value in the Console.

I have a few workaround solutions, but I would rather understand conceptually what I am doing wrong. If the placemark has been removed, why are it's coordinates still attainable? I removed it visually on Google Earth and Google Maps so something must have changed...

Workarounds:

  1. After removing the placemark from GE, implicitly set the coordinates to null.
  2. Make a condition that will check if the individual is already in the car and if so not add their information to the roster. This will however become a problem if someone clicks the pickup button in the location where a placemark once was AFTER already dropping off that individual.
3
  • I have the same problem and have not been able to solve it yet!
    – Lucas
    Commented Dec 12, 2014 at 9:20
  • @Lucas: Upvote my question and it will bring it more attention Commented Dec 16, 2014 at 4:42
  • I have the same problem, I have upvoted...
    – aharris
    Commented Dec 21, 2014 at 13:52

1 Answer 1

1

This seems to have fixed it for me, I think this is what you were talking about as your workaround number 1. Basically banish the person to 0,0

if (PASSENGERS[i].name == shuttle.seats[nextseat][0].name)
{              
   PASSENGERS[i].placemark.getGeometry().setLatitude(0);
   PASSENGERS[i].placemark.getGeometry().setLongitude(0);
}
1
  • A fix... but I imagine there should be a golden goose in this scenario. Commented Dec 31, 2014 at 21:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .