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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:14:07+00:00 2026-05-31T07:14:07+00:00

I am working on a prototype bike parking map for my school using Google

  • 0

I am working on a prototype bike parking map for my school using Google Maps API.
I have saved all the bike rack locations in MYSQL with only attributes being lattitude
and longitude of the location. Now I’m trying to add a feature where when the users click
on the markers, they would show the pictures of the corresponding bike racks.

I am trying to do this using InfoWindow object.

Now the problem is, although InfoWindow is almost exclusively used with Markers, a Marker object cannot have an InfoWindow object as one of its properties/attributes.

So I was thinking creating a fresh new InfoWindow every time users click on markers. But i feel like it’s going to create some lagging.

Another option I had in mind was creating another table or a column in the current table
which contains all the InfoWindow object.

However, I really want to make the InfoWindow objects to be part of Marker objects because
intuitively it makes the most sense.

  • 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-31T07:14:08+00:00Added an answer on May 31, 2026 at 7:14 am

    Not saying the best way to do it is this, but a marker object sure can have an infoWindow as one of it’s properties! Google’s API doesn’t restrict/throw errors when you put random properties/methods on it’s marker objects. The following is perfectly valid code:

    var someMarker = new google.maps.Marker(properties);
    someMarker.infoWindow = new google.maps.InfoWindow(properties);
    someMarker.infoWindow.setMap(map);
    someMarker.infoWindow.open();
    

    That being said, on a lot of google maps implantations there’s generally only a single infoWindow object on the map. The reason for this if you opened up 4 or 5 infoWindows in a single map view, they tend to clutter up the map and you can’t see any of the base map tiles anymore.

    For that reason, you can have a single infoWindow object, and just change the contents of it, depending on which marker is clicked:

    var yourGlobalInfoWindow = new google.map.InfoWindow(properties);
    var someMarkerA = new google.maps.Marker(properties);
    var someMarkerB = new google.maps.Marker(properties);
    someMarkerA.infoWindowContent = 'some A HTML content here';
    someMarkerB.infoWindowContent = 'some B HTML content here';
    
    google.maps.event.addListener(someMarkerA,'click',function() { yourGlobalInfoWindow.setContent(someMarkerA.infoWindowContent); });
    
    google.maps.event.addListener(someMarkerB,'click',function() { yourGlobalInfoWindow.setContent(someMarkerB.infoWindowContent); });
    

    Note that the code above is for illustrative purposes only and is far from optimized or elegant, but it gets the point across.

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

Sidebar

Related Questions

I have a working prototype of a Java application that is using Apache Commons
I have been working on a prototype site using a mamp server and the
I have a working prototype of a concurrent Scala program using Actors. I am
Hi! I have a working prototype of a game engine and right now I'm
I have a simple code fragment in JS working with prototype inheritance. function object(o)
Background: We have an offshore group working up a Silverlight 2 prototype for us.
Here's the thing, I now have a working prototype of what I want and
I am working on game engine prototype and have the following question: Right now
I am currently working on a prototype that is using CSS3 multi columns for
I'm working on a prototype EF application, using POCOs. Mainly as an introduction 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.