Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7773993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:16:01+00:00 2026-06-01T17:16:01+00:00

I am working with Google Map API v3 and I have my code working

  • 0

I am working with Google Map API v3 and I have my code working calling from a JSON file through jQuery.

$.getJSON("/temp/google_maps/json/google_map.json", {}, function(data){
        $.each(data.location, function(i, item){
            $("#markers").append('<li><a href="#" rel="' + i + '">' + item.title + '</a></li>');
            var marker = new google.maps.Marker({
                position: new google.maps.LatLng(item.lat, item.lng),
                map: map,
                title: item.title
            });
            arrMarkers[i] = marker;
            var infowindow = new google.maps.InfoWindow({
                content: "<h3>"+ item.title +"</h3><p>"+ item.description +"</p>"
            });
            arrInfoWindows[i] = infowindow;
            google.maps.event.addListener(marker, 'click', function() {
                infowindow.open(map, marker);
            });
        });
    });

The JSON file looks like:

{
"location": [
    {
        "title": "Castillo San Felipe del Morro - San Juan",
        "description": "Fort San Felipe del Morro —or El Castillo San Felipe del Morro in Spanish— is a sixteenth-century citadel which lies on the northwestern-most point of the islet of San Juan, Puerto Rico. Named in honor of King Philip II of Spain, the fort, also referred to as \"El Morro\" or \"promontory\", was designed to guard the entrance to San Juan bay, and defend the city of San Juan from seaborne enemies. <a href=\"http://en.wikipedia.org/wiki/Fort_San_Felipe_del_Morro\">More Info</a>",
        "lat": 18.470186,
        "lng": -66.122096
    },
    {
        "title": "Playa de Jobos - Isabela",
        "description": "Beautiful beach, great for surfing and soaking up the sun.",
        "lat": 18.51379572782087,
        "lng": -67.07676887512207
    },
    {
        "title": "Radiotelescopio de Arecibo - Arecibo",
        "description": "The Arecibo Observatory is a very sensitive radio telescope located approximately 9 miles (14 km) south-southwest from the city of Arecibo in Puerto Rico. It is operated by Cornell University under cooperative agreement with the National Science Foundation. The observatory works as the National Astronomy and Ionosphere Center (NAIC) although both names are officially used to refer to it. NAIC more properly refers to the organization that runs both the observatory and associated offices at Cornell University. <a href=\"http://en.wikipedia.org/wiki/Arecibo_Observatory\">More Info</a>",
        "lat": 18.344179271158357,
        "lng": -66.75267219543457
    }
]
}

As I said works great, but now I have to adjust the script to pull from a file that starts with:

{
    "TYPE" : ["location"], "DATA" :[
        {

Instead if the previous:

{
    "location": [
        {

How do I change my jQuery to call this data set? Any help would be greatly appreciated. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:16:03+00:00Added an answer on June 1, 2026 at 5:16 pm

    Unless I am mistaken you are just changing data.location to data.data e.g.:

    $.getJSON("/temp/google_maps/json/google_map.json", {}, function(data){
        $.each(data.DATA, function(i, item){
            $("#markers").append('<li><a href="#" rel="' + i + '">' + item.title + '</a></li>');
            var marker = new google.maps.Marker({
                position: new google.maps.LatLng(item.lat, item.lng),
                map: map,
                title: item.title
            });
            arrMarkers[i] = marker;
            var infowindow = new google.maps.InfoWindow({
                content: "<h3>"+ item.title +"</h3><p>"+ item.description +"</p>"
            });
            arrInfoWindows[i] = infowindow;
            google.maps.event.addListener(marker, 'click', function() {
                infowindow.open(map, marker);
            });
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a google Map Api using fusion. I have multiple search
i have a google map api key which is working in my website but
I'm working on an advanced map application in Google Maps API V3. I'm using
I am working with viewports and bounds returned from Google Geocoding API . When
I have a question regarding map api. I was using the the google map
I have this simple hello world version of a google map api javascript v3
This is my first time working with the Google Maps API. I have a
I've been working with Google Maps API v3 and created a map which allows
I'm working with the Google Maps v3 API, and I have a custom overlay
I am currently working on google map api V3 using cakephp with prototype.js. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.