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

The Archive Base Latest Questions

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

Ok, almost solved. I am trying to use the place attribute from a nearbySearch

  • 0

Ok, almost solved. I am trying to use the place attribute from a nearbySearch (shown below)

var request = {
  location: pyrmont,
  radius: '500',
  types: ['atm','bus_station','parking']
};
infowindow = new google.maps.InfoWindow();
service = new google.maps.places.PlacesService(map);
service.nearbySearch(request, callback);

The markers are stored in an array ( below)

    function createMarker(place) {
      var iconType = {};
      iconType['atm'] = "http://maps.google.com/mapfiles/ms/micons/dollar.png";
      iconType['bus_station'] = "http://maps.google.com/mapfiles/ms/micons/bus.png";
      //iconType['restaurant'] = "http://maps.google.com/mapfiles/ms/micons/restaurant.png";
      iconType['parking'] = "http://maps.google.com/mapfiles/ms/micons/parkinglot.png";
      var placeLoc = place.geometry.location;
      var marker = new google.maps.Marker({
      map : map,
      icon : iconType[place.types[0]],
      position : place.geometry.location,
      types : place.types
    });

    google.maps.event.addListener(marker, 'click', function() {
      infowindow.setContent(place.name);
      infowindow.open(map, this);
    });

    return marker;
  }

Now the problem is that the ‘if’ statement below is not matching the place in the array, with the string I enter, Im not sure if the statement itself is wrong, or if I am not retrieving the place.types attribute correctly from the Google request.

      function onRemoveBtn_Clicked() {
    var i;
    for (i = 0; i < markers.length; i++) {
      if (markers[i].get("types") != ATM) {
      markers[i].setMap(null);
    }
  }

I have had great help with this problem up until now and would like to thank all those who have taken the time to help me, this is the last that I will bother 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-14T13:38:16+00:00Added an answer on June 14, 2026 at 1:38 pm

    If you set an array of types to a marker, marker.get(“types”) return the array.
    So the code should be like this:

    function onRemoveBtn_Clicked() {
      var i, j, isHit, types;
      for (i = 0; i < markers.length; i++) {
        types = markers[i].get("types");
        if (types) {
          isHit = false;
          for (j = 0; j < types.length; j++) {
            if (types[j] == "atm") {
              isHit = true;
              break;
            }
          }
          if (isHit) {
            markers[i].setMap(null);
          }
        }
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Almost all of the examples in the jQuery tutorials that I've read, usually use
I've been trying to solve this mystery almost 2 hours, this is giving me
i'm almost there but I'm not able to solve the last problem. I'm trying
I almost have this solved but need a little push. Here's what I have:
I use try catch statements in almost every one of my insert or update
I'm trying to unit-test some classes that make use of a Singleton class whose
I'm trying to decide whether to switch from Vows to Mocha for a large
I've been trying for 4 hours to discover how to use the keytool stuff.
I am trying to use jquery to find a div inside an iframe. Is
I am very new in MVC trying to expand my asp.net knowledge after almost

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.