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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:56:43+00:00 2026-05-30T21:56:43+00:00

Hello i have this Gmap v3 code that shown the multiple markers (20 markers)

  • 0

Hello i have this Gmap v3 code that shown the multiple markers (20 markers) only in Firefox and after a while not instantly.

    var geocoder;
var map;
//var map2;
var places = [];
var popup_price = [];
var popup_rooms = [];
var popup_area = [];
var popup_pic = [];
var popup_description = [];


var address = [];
var address_position = 0;

var timeout = 600;


var myStyles =[
    {
        featureType: "transit",
        elementType: "label",
        stylers: [
              { visibility: "on" }
        ]
    }
];
function initialize() {
    geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(42.36741824284927, -71.071085890625);
    var myOptions = {
      zoom: 10,
      center: latlng,
      mapTypeId: 'roadmap',
      streetViewControl: false,
      styles: myStyles 
    }

    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

    addMarker(address_position);
}



function addMarker(position)
{
    geocoder.geocode({'address': address[position]}, function(results, status)
    {
        if (status == google.maps.GeocoderStatus.OK) {
         if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
            places[position] = results[0].geometry.location;
            //map.addOverlay(new MarkerLight(latlng, {image: "red_dot.png"})); if slow actual implemetation then follow http://www.svennerberg.com/2009/01/handling-large-amounts-of-markers-in-google-maps/
            var marker = new google.maps.Marker({
                position: places[position],
                //content:html,
                map: map


            });


            // Creating an InfoWindow object
        var infowindow = new google.maps.InfoWindow({        
           content: '<div style="font-family:arial;font-size:11px;color:#333333;"><div style=float:left;width:83px;><img src=/listings/'+popup_pic[position]+'.jpg.rbm?w=80&h=80&f=cover > </div><div style=float:left;width:205px;text-align:justify;padding:5px;><strong>$'+popup_price[position] +'<br>'+popup_rooms[position]+'</strong><br>'+popup_area[position]+'<br>'+popup_description[position]+'...</div><div style="float:left;width:96px;"><img src="/upload/custom_screens/rb/viewBtnMap.gif" class="imgPopup"><img src="/upload/custom_screens/rb/saveBtnMap.gif" class="imgPopup"><img src="/upload/custom_screens/rb/reqBtnMap.gif" class="imgPopup"></div></div>',
          maxWidth: 400
        });
            google.maps.event.addListener(marker, 'click', function() 
            {
                infowindow.open(map, marker);
            });
            //infowindow.open(map,marker);

google.maps.event.addListener(map, 'zoom_changed', function() {
    zoomLevel = map.getZoom();

    if (zoomLevel >= 16) 
    {

        marker.setVisible(false);

        var circleOptions = 
        {
          strokeColor: "#c4c4c4",
          strokeOpacity: 0.35,
          strokeWeight: 0,
          fillColor: "#ca0d33",
          fillOpacity: 0.1,
          map: map,
          center: results[0].geometry.location,
          radius: 50
        };

        //add draw circle
         var circle = new google.maps.Circle(circleOptions);


        circle.bindTo('center', marker, 'position');



    }
    else
    {
    //circle.setMap(null);
    marker.setVisible(true);

    }
});

        }
        }
        else
        {
            if (status == google.maps.GeocoderStatus.OVER_QUERY_LIMIT)
            {
                setTimeout(function() { addMarker(position); }, (timeout * 3));
            }
        }
        address_position++;
        if (address_position < address.length)
        {
            setTimeout(function() { addMarker(address_position); }, (timeout));
        }
    });

}

How i could improve the speed and make them work in IE and Chrome? I don’t receive any error in console .

thank 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-05-30T21:56:44+00:00Added an answer on May 30, 2026 at 9:56 pm

    Right now your map doesn’t show any markers for me, because address is empty. I was testing it with some values:

    var address = ['Brookline','Wayland','Bedford'];
    

    …and all 3 markers appear in IE, Chrome, FF & Opera.

    However, the major problem is that you use addresses and not LatLng’s , because addresses first have to be requested by geocoding to get the LatLng, furthermore addresses are not unique, you may receive changing results(e.g. it may happen that the result returns a location somewhere else outside the viewport where you didn’t recognize it).

    So if the addresses are known in your application you better store the LatLng’s of these addresses and show the markers based on these positions(should be faster too because you don’t need the geocoding)

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

Sidebar

Related Questions

Hello i have this code that works perfect in Firefox but in IE 8
Hello I have this snippet of code that will fire some even after time
Hello I have this code I am trying to fix, the issue is that
Hello i have this foreach loop that gives weird result , it displays only
Hello i have this pager added with success on Firefox but not visible in
Hello i have this form filling javascript: function onLine(code,nn) { document.writeform.bericht.value+=code; document.writeform.bericht.focus(); document.writeform.nickname.value+=nn; write1();
Hello I have this list that i am working on. When i move the
Suppose I have this code: String encoding = UTF-16; String text = [Hello StackOverflow];
Problem Hello all! I have this code which takes my jpg image loops through
Lets say I have this code: <?php class hello { var $greeting = hello;

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.