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 8851063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:03:24+00:00 2026-06-14T13:03:24+00:00

Edit: Problem solved I am trying to assign types using variable like this check

  • 0

Edit: Problem solved
I am trying to assign types using variable like this

    check = [];

if($("#transport").attr("checked"))
check.push('airport','bus_station','train_station','taxi_stand','travel_agency');

if($("#bars").attr("checked"))
check.push('bar','restaurant');

if($("#tourist").attr("checked"))
check.push('art_gallery','campground','museum','aquarium','zoo','library','amusement_park','park');

if($("#shopping").attr("checked"))

check.push(‘shopping_mall’,’shoe_store’,’jewelry_store’,’grocery_or_supermarket’,’furniture_store’,’electronics_store’,’clothing_store’,’book_store’);

 var tmp_types = "";
for(i=0;i<1;i++)
{
    tmp_types += '"'+check[i]+'"';
}

var request = {
    location: latlng,
    radius: '50000',
    types: [ tmp_types ]
  };

service = new google.maps.places.PlacesService(map);
service.nearbySearch(request, callback);

but its not working… can anybody help me… thanks

solution: just use check in place of tmp_types and remove square brackets..like this types: check.. thanks to Bruno

  • 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-14T13:03:25+00:00Added an answer on June 14, 2026 at 1:03 pm

    Your for loop exits at 0 because your condition is i < 1

    for( var i=0, len = check.length; i < len; i++ ) {
        // your code here
    }
    

    Also according to the API documentation the function you are calling expects types in the request object to be:

    An array containing one or more of the supported types listed in the
    Google Places API: Supported Place Types list.

    So just use the check object like so

    var request = {
        location: latlng,
        radius: '50000',
        types: check
    };
    

    More info here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: This problem has been solved. See below. Hey all. I'm building an iPhone
EDIT: Problem solved. This was (yet another) situation where the problem wasn't really where
EDIT: Solved the problem, thanks to this forum post: http://forums.aptana.com/viewtopic.php?f=20&t=7563&p=27407&hilit=libmysql.dll#p27407 . Thanks everyone! I've
Edit: Problem solved I'm trying to port over a popular rating algorithm which analyses
edit: I was trying to solve a spoj problem. Here is the link to
[EDIT: Problem solved. Please see my answer below.] In my app I call the
edit: Solved - mod_rewrite was the problem I can't get CI to work as
Edit: This problem was down to me passing the wrong view to the Touch
[Edit: This problem applies only to 32-bit systems. If your computer, your OS and
PROBLEM SOLVED: I was overlooking a very simple issue, and that is that this

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.