Originally posted by chumb
Is there any variable holding the ID (owner_id) of the currently "selected" or "active" vehicle in VehicleTracker?You can reach the currently active vehicle as
Code: Select all
Another question: if we have our own code to add overlays, where would be a good place to add a call to our code, in order to force an automatic refresh of overlays whenever a new position is received for the "active" vehicle?
vTracker exposes an event called 'onpositionupdated' that is intended for this purpose. See vehicletrackermain.js, aprox line 330, for an example of how to use it.
I'd recommend that you place your code in a separate file and then hook to this event after vtMain.start() has been called (see page_load in VehicleTracker.aspx). (If you edit the original source-code your changes won't be available when running using compressed scripts, and you'd have to do more patching when new versions are released)