Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
how can i retrieve data from database and put in javascript code to process with maps api?

hey i have latitude and longtitude data that i put in database can i get that data and put it in javascript code to process with map api?

here is my javascript code that i want to change the "latitude and longtitude" in database

<script type='text/javascript'>
jsMaps.loader(function (){
    var tiles = new jsMaps.Native.Tiles();
    var map = jsMaps.api.init(
            '#map',
            'native',
            {
                center: {
                    latitude: (change data from database),
                    longitude: (change data from database)
                },
                zoom: 14,
                mouse_scroll: true,
                zoom_control: true,
                map_type: true
            },tiles
    );

    var polyLine1 = [
        {lat: (change data from database),lng:  (change data from database)},    
        {lat: (change data from database),lng:  (change data from database)},   
        {lat: (change data from database),lng:  (change data from database)},     
        {lat: (change data from database),lng:  (change data from database)}    
    ];
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

so i made json file to grab data that i need to process to javascript. Then i use async funtion to extract json file and obtain latitude and longtitude from database. here is my javascript code to extract the json file :

const api_url = 'jsonlatest.php'
        async function getjsonlatest() {
            const response = await fetch(api_url);
            const data = await response.json();
            let i = 0;
            while (i<10) {
                i++;
                array = JSON.parse(JSON.stringify(data[i]))
                sip = [array.latitude, array.longtitude]
                oke = [sip]
                
                console.log(oke)
                                   
            }
        
                


    }
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!