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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:01:24+00:00 2026-06-06T22:01:24+00:00

I am creating an object like this: markers[name] = {}; markers[name].id = id; markers[name].lat

  • 0

I am creating an object like this:

  markers[name] = {};
  markers[name].id = id;
  markers[name].lat = lati;
  markers[name].lng = longi;
  markers[name].state = state;
  markers[name].position = posi;
  markers[name].selected = false;

then i have a new function where i want to loop through the markers object and change the marker image .selected has been set to true.

Here is what i have tried:

function setMarkerImage() { 

        for (var key in markers) { 
           console.log("test 1: " + key + key.selected);
            if (key.selected === true)
          {
          console.log("test 2");        
             var newImage = new google.maps.MarkerImage('img/presence/' + state + '_sel.png');
             var marker = $("#dispatcher").gmap3({action: 'get', name:'marker', tag: key})
               if (marker){
               marker.setIcon(newImage);
               }
          }
        } 
} 

Problem is i am getting

test 1: Vinceundefined 

in the console, i take it i cannot use key.selected like this?

  • 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-06T22:01:26+00:00Added an answer on June 6, 2026 at 10:01 pm

    key isn’t an object, so it hasn’t a selected key. Try instead with

    console.log("test 1: " + key + markers[key]["selected"]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a new object like this: TestObject->new(@array1, @array2) My new method looks like
In my application I am creating an object pretty much like this : connect()
I am creating a model object like this: $object1 = new Object1(); There is
I am creating a object in javascript like this function myobject() { this.myvar1 =
I am creating an object that has a constuctor like this... public class BusinessLogic()
i am creating an object like this: var myObj:Object = new Object(); myObj[someProperty] =
i am creating a Geocoder object like. Geocoder geoCoder = new Geocoder(getBaseContext(), Locale.getDefault()); here
I'm creating a JSON object like tags = {jon:[beef,pork],jane:[chicken,lamb]}; which was generated using php
In Ember.js, I'm creating a user object like so, populating it from a JSON
Having a simple Python class like this: class Spam(object): __init__(self, description, value): self.description =

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.