PHP Snippets – print variable

New home Forums Pro Add-on General queries PHP Snippets – print variable

  • This topic has 3 replies, 2 voices, and was last updated 5 months ago by Matthew.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #72855
    prakash
    Participant

    Hi,
    how is it possible with a PHP snippet (in theme or with a plugin) print the value of Latitude/longitude/address/other-values properly setup with your plugin inside a post?
    Thank you!

    #72869
    Matthew
    Moderator

    Hi there,

    Thank you for getting in touch with us, we do appreciate your time.

    Please may I ask if you may confirm if you would simply like to retrieve specific marker data and output it onto the page in HTML?

    If so, please may you also confirm how you would like to display the data so that I may get a better understand of how you would like the output to look, as well as if you may provide me with the link to your map page/post so that I may take a closer look?

    I look forward to hearing back from you.

    Kindest Regards,
    Matthew

    #72901
    prakash
    Participant

    Hi Matthew,
    the idea is that in a website like http://test.masterunits.net I can click on one Marker (e.g. the Portuguese one, with name “Ananda Valley”), and then I arrive to a post where I added the Ananda Valley location, and some description of the place.

    In the same page I would like (apart from seeing a map with only this marker! but this I added as a separate question), to have a box where some information, like Latitude, Longitude, Address,… are shown (in a PHP snippet, or in a future in a block or in my theme customization).

    Can you tell me how can I extract these informations (like Latitude, Longitude, and so on) from JS/PHP ?
    Thank you!
    prakash

    #72919
    Matthew
    Moderator

    Hi Prakash,

    Thank you for getting back to me and for your time on this, it is much appreciated.

    Thank you for the confirmation, you may use some JS code which I have written for you in my following Gist to retrieve the information of the marker when a marker is clicked on the map: https://gist.github.com/MatthewCodeCabin/8a8b3580d4afa169a6a76be7139da6a9

    In the above Gist, the “markerInfo” variable contains the information of the marker that is clicked.

    Please do let me know if this helps?

    Kindest Regards,
    Matthew

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.