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

  • Home
  • SEARCH
  • 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 6952531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:21:41+00:00 2026-05-27T14:21:41+00:00

I am creating a simple apps using html5 and JavaScript. I want to show

  • 0

I am creating a simple apps using html5 and JavaScript.
I want to show nearest places of any one city
so already I set long and lat of a country.

If user click school I want to show all school names nearest of long and lat with radius.
If user click church I want to show all church names nearest of long and lat with radius.
If user click hospital I want to show all hospital names nearest of long and lat with radius. etc.

I only have this link and sample related code:

https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=AIzaSyC1BIAzM34uk6SLY40s-nmXMivPJDfWgTc


$.getJSON("https://maps.googleapis.com/maps/api/place/search/json?",{
        location:"-33.8670522,151.1957362",
        radius: 500,
        types:'food',
        name: 'harbour',
        sensor: false,
        key: 'AIzaSyC1BIAzM34uk6SLY40s-nmXMivPJDfWgTc'
        format: "json"  
    },
    function(data) {
      $.each(data.results, function(i,item){
      $("<img/>").attr("src", results.name).appendTo("#images");
      if ( i == 3 ) return false;
    });
  }); 

so where I want to change to get place name.
initially what do I do?

  • 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-05-27T14:21:41+00:00Added an answer on May 27, 2026 at 2:21 pm

    Maps v3 does not support callback/JSONP from a jQuery get/getJSON at this time

    http://www.quora.com/Why-doesnt-the-Google-Maps-API-support-JSONP

    That said – if you have the patience try looking at

    http://code.google.com/intl/no-NO/apis/maps/documentation/javascript/services.html#Geocoding

    To load async, you need to do something like this:

    function loadScript() {
      var script = document.createElement("script");
      script.type = "text/javascript";
      script.src = "http://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize";
      document.body.appendChild(script);
    }
    

    http://code.google.com/apis/maps/documentation/javascript/basics.html#Async


    If not, here is what I suggest.

    USING PROXY:

    Unless someone can find a new resource that shows how to do this with jsonp (I could only find resources telling me it was not supported) a way is to write a proxy.

    This works FROM THE SAME SERVER

    DEMO

    HTML:

    <html>
    <head>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> 
    <script>
    $(document).ready(function() {
      $.getJSON("googleapijson.php?type=food",
        function(data, textStatus){
          $.each(data.results,function(i, item) {;
           $("#placenames").append(i+':'+item.vicinity+'<br/>');
        });
      });
    });
    </script>
    </head>
    <body> 
     <div id="placenames"></div>
    </body>
    </html>
    

    PHP:

    <?PHP
    
    header("Content-type: application/json");
    
    /** note you need to grab and clean the parameters from the   
     *  get/post request and build your querystring:   
     */
    
    $type = $_GET["type"]; // this needs to be cleaned
    
    $URL="https://maps.googleapis.com/maps/api/place/search/json?location=-33.8670522,151.1957362&radius=500&types=".$type."&name=harbour&sensor=false&key=AIzaSyC1BIAzM34uk6SLY40s-nmXMivPJDfWgTc"
    
    $json = file_get_contents($URL);
    
    echo $json;
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a simple(ish) website for one of my iPhone apps using the
I am creating a simple RESTful interface on one of my apps and I
Background : I'm currently, for my University, creating some simple apps showcasing the possible
Is there any guidance on creating apps that will run on both professional (touch-screen)
I'm creating a simple HTTP proxy that will sit between mobile apps and a
Simple problem, actually. I am trying to evaluate the possibilities of Google Apps, using
When creating a simple object hierarchy in Python, I'd like to be able to
Was creating a simple console application to do some prototyping and was shocked to
I'm creating a simple API that creates typed classes based on JSON data that
I'm creating a simple tag system that allows me to link a tag to

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.