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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:18:32+00:00 2026-06-14T20:18:32+00:00

I have a JSON feed that includes coordinates and info about the type of

  • 0

I have a JSON feed that includes coordinates and info about the type of business to be listed on a Google Maps canvas. In the JSON feed, the industry field is represented by integers, and can be 1, 2 or both. A less abstract way to present this is that a business can be either a restaurant, retail or both.

I managed the get the toggle working between these 2 types by checking whether the initial array value is equal to first type array value, I but can’t figure out how to handle a situation where a business is both. I have searched for “in” operator in Javascript that can check the presence of a value in array and return true or false but not able to find anything useful.

http://jsfiddle.net/serkanh/BVjGh/16/

Current way of checking the type of business:

for(i=0; i < markers.length; i++){                     
    if(markers[i].category === category){                 
           markers[i].setVisible(true);            
    }else{                 
           markers[i].setVisible(false);            
    }          
}
  • 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-14T20:18:33+00:00Added an answer on June 14, 2026 at 8:18 pm

    If your values are 1 and 2, it should be pretty easy: set the value for both types to 3. And test with

    if(markers[i].category&3) {
      // Both
    } else if(markers[i].category&2) {
      // type 2
    } else if(markers[i].category&1) {
      // type 1
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a dynamic json feed that is parsed into markers on our google
I have a JSON feed that is pulling into an each statement. What I
I am very new to Python and I have a json news feed that
So I have an app that downloads and parses a JSON feed with some
I have a web service class that successfully pulls my JSON from a feed
I have a JSON feed that drupal spits out time in this format: 2010-12-16T04:41:35Z
I have a json-feed that looks like this that I need to decode using
So basically I have a JSON feed that returns a boolean if there is
I have a mapView that has annotation added through JSON (feed is stored in
I have a JSON feed that I'm parsing. Here's the following code samples: JSON

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.