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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:31:30+00:00 2026-06-10T01:31:30+00:00

When I add more Markers to Google Map with different icon types like: …

  • 0

When I add more Markers to Google Map with different icon types like:

...
var marker = new google.maps.Marker({
             position: markerLatLng,
             map: map,
             icon: "http://www.test.com/marker.png",
             zIndex: 10
         });
...

and

...
var resultIcon = {
            path: google.maps.SymbolPath.CIRCLE,
            fillColor: "black",
            strokeColor: "black",
            strokeWeight: 1,
         };

var marker = new google.maps.Marker({
             position: markerLatLng,
             map: map,
             icon: resultIcon,
             zIndex: 5
         });
...

Than the zIndex doesn’t work and the Symbol marker appears on the top.

Am I wrong with my code or how can I make the zIndex working?

  • 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-10T01:31:31+00:00Added an answer on June 10, 2026 at 1:31 am

    You have to both specify a zIndex and add

    optimized: false
    

    to every marker constructor, eg.

    var marker = new google.maps.Marker({
        position: markerLatLng,
        map: map,
        icon: resultIcon,
        optimized: false,
        zIndex: 5
    })
    

    This seems to be an issue with the new canvas based rendering of the markers.

    Edit:

    This really solves the issue.
    One thing to mention though is that every marker has to have the “optimized: false” attribute. As long as one marker does not have it, it will not work.

    Remove any of the “optimized: false” attributes from LeJared’s fiddle and you will encounter the bug.

    http://jsfiddle.net/BNWYq/1/

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

Sidebar

Related Questions

In my application i want to add more than two markers in a Google
I am trying to create a google map with custom icon markers. I need
I'm trying to add markers to a map on my page using Google's Javascript
Is it possible to add more objects of different types to the same list
I have a Google Map with a bunch of markers. I add markers to
Can I add more permit to a semaphore in Java? Semaphore s = new
I am trying to add a bunch of map markers to a map using
as part of my last.fm/google maps event mashup, I have to plot markers dynamically
I want to add more details in MKAnnotation like location title, description, date, location
I'm creating a custom Google map that plots multiple markers. View the link as

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.