• Hia,

    How can I use the last know coordinates of a track and use those specifications to update the meta of another post?

    So I would like to have the most current location of a user and have that as a value for the coordinates of a truck, order or package.

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author tinuzz

    (@tinuzz)

    Hi,

    I assume you’re asking how you would implement this in a plugin.

    First, I’m not sure if updating the metadata is the correct way to do it, since it would require you to update the metadata quite often, and possibly far more often than necessary, if no one is looking at the page.

    I would probably choose a different solution, and implement something like a shortcode that would get the most recent location in its handler code.

    If you must use the metadata way, I think it should be done using a hook in Trackserver that is called each time a new location is added to the database.

    In your own plugin, you can add a handler for the (action) hook and update the metadata accordingly. If you want me to add a hook for that, can you create a feature request issue on Github?

    https://github.com/tinuzz/wp-plugin-trackserver/issues/new

    Thanks,
    Martijn.

    Thread Starter opwolken.com

    (@opwolkencom)

    Hoi Martijn,

    Thank you for your suggestion and I think that a hook is the best sollution. I’m aware that it would be a bit of a burden on the server and will think about the best solution in my case.

    what I would like to achieve one way or another is to have a OSRM route from last know location of the driver to the next delivery address.

    Or do you think i can make that already with your shortcode?

    Plugin Author tinuzz

    (@tinuzz)

    Hi,

    No, Trackserver does not support that out of the box.

    Cheers,
    Martijn.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Update meta of post with last know coordinates’ is closed to new replies.