Dynamic code to pull-in post_latitude and post_longitude data

This topic contains 1 reply, has 2 voices, and was last updated by  Paolo 9 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #57023

    Laurence Maisey
    Free User
    Post count: 1

    I may be using the wrong terminology here but..

    What code do I enter in place of “position: {lat: 37.869260, lng: -122.254811}” in the following JS code, so that the post_latitude and post_longitude coordinates from the imported CSV file are dynamically pulled-in/inserted for each individual listing’s long/lat coordinates for this Google.maps code:

    
    
    var panorama;
    function initialize() {
      panorama = new google.maps.StreetViewPanorama(
          document.getElementById('street-view'),
          {
            position: {lat: 37.869260, lng: -122.254811},
            pov: {heading: 165, pitch: 0},
            zoom: 1
          });
    }
    #57066

    Paolo
    Site Admin
    Post count: 31211

    Hi,

    I can tell you how to do that with PHP, both values are saved in the post global variable:

    
    
    $post -> post_latitude;
    $post -> post_longitude;
    

    Not sure how to pass that to JS though.

    I’ll ask Stiofan to let us know,

    Thanks

Viewing 2 posts - 1 through 2 (of 2 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount