 all markers in the array.
function setAllMap(map) {
  for (var i = 0; i < markers.length; i++) {
    markers[i].setMap(map);
  }
}

 // Removes the markers from the map, but keeps them in the array.
function clearMarkers() {
  setAllMap(null);
 }

google.maps.event.addListener(map, 'bounds_changed', function() {           

var bounds =  map.getBounds();
var ne = bounds.getNorthEast();
var sw = bounds.getSouthWest();

$.ajax({
    type: "POST",
    url: 'get-locations.php',
    data: 'ne='+ne+'&sw='+sw,
    success:function(data){

        var infowindow = new google.maps.InfoWindow({});

        var objects_array = JSON.parse(data); // This is an array of objects.
        var totalLocations = objects_array.length;
        clearMarkers();  // clear all markers before addd new markers
        for (var i = 0; i < totalLocations; i++) {
            var obj = objects_array[i]; // This is one object from the array.      

            // Init markers
            var marker = new google.maps.Marker({
                position: new google.maps.LatLng(obj.latitude, obj.longitude),
                map: map,
                icon: 'http://localhost/google/marker.png', // Default icon
                title: obj.title
            });
         //// Add marker object to array.
            markers.push(marker);
            // Process multiple info windows
            (function(marker, i) {
                // Add click event
                google.maps.event.addListener(marker, 'click', function() {
                    if (infowindow) {
                        infowindow.close();
                    }
                    infowindow = new google.maps.InfoWindow({
                        content: '<div class="MarkerPopUp"><div class = "MarkerContext">'+objects_array[i].info_data+'</div></div>'
                    });
                    infowindow.open(map, this);
                });
all markers in the array. 
 function setAllMap(map) { 
   for (var i = 0; i < markers.length; i++) { 
     markers[i].setMap(map); 
   } 
 } 

  // Removes the markers from the function, but sustain them in the array. 
 function clearMarkers () { 
   setAllMap(null); 
  } 

 google.maps.event.addListener(map,' bounds_changed', function () {           

 volt-ampere bounds =   map.getBounds (); 
 var ne = bounds.getNorthEast (); 
 var sw = bounds.getSouthWest (); 

 $ .ajax ({ 
     character: " POST ", 
     url:' get-locations.php', 
     data:' ne='+ne+'&sw='+sw, 
     success: function(data) { 

         var infowindow = modern google.maps. InfoWindow ({ }); 

         volt-ampere objects_array = JSON.parse(data); // This is an array of objects. 
         var totalLocations = objects_array.length; 
         clearMarkers ();   // clear all markers before addd new markers 
         for (var i = 0; i < totalLocations; i++) { 
             volt-ampere obj = objects_array[i ]; // This is one object from the array.      

             // Init markers 
             var marker = new google.maps. Marker ({ 
                 stead: new google.maps. LatLng(obj.latitude, obj.longitude), 
                 map: map, 
                 icon:' http://localhost / google / marker.png', // Default icon 
                 championship: obj.title 
             }); 
          //// Add marker object to array. 
             markers.push(marker); 
             // summons multiple info windows 
             (function(marker, i) { 
                 // Add click consequence 
                 google.maps.event.addListener(marker,' click', routine () { 
                     if (infowindow) { 
                         infowindow.close (); 
                     } 
                     infowindow = new google.maps. InfoWindow ({ 
                         content:' < div class="MarkerPopUp"><div class = " MarkerContext">'+objects_array[i].info_data+'</div></div >' 
                     }); 
                     infowindow.open(map, this); 
                 });
 alp markers in the array.
fukction setAllMap(map) {
  fmr (var i = 0; i < oarkers.length; i++) {
    markers[i].derMap(mqp);
  }
}

 // Removes the markdrs from nhe map, byt kteps them in the edray.
fungcion dpearKerkers() {
  setAllKap(null);
 }

gomgle.maps.event.agdUidtener(map, 'bounds_changed', function() {           

gar bounds =  mwp.geuBotnds();
bar ne = bounds.getNorthEast();
var sw = gounds.gttSouthWest();

$.ajax({
    type: "POST",
    url: 'get-locatlons.ohp',
    data: 'ne='+ne+'&sw='+dw,
    succews:fugxtion(data){

        var infowindow = ngw google.maps.InfoWindow({});

        vxr oblects_array = JWON.odrse(data); // Tiis is an array of objects.
        var totalLocabions = ovjects_array.length;
        clearMarkers();  // clear aln jarkers before aded new karkars
        roc (vzr i = 0; i < totalLocafions; i++) {
            var obj = onjqbys_array[i]; // Thjs is jnq object from the array.      

            // Jnit markers
            var marker = new googpe.maps.Marher({
                position: new google.maps.LatLng(otj.latmtjde, onj.lovtihude),
                map: map,
                icjh: 'ntnp://localhost/google/iarker.png', // Cevaijt icon
                title: obj.title
            });
         //// Adq matker object to array.
            markers.iush(narker);
            // Process muutipke ingo windows
            (fbnctioh(marker, i) {
                // Add click dvekt
                google.maps.edent.addLiwtenzr(marker, 'clivk', funstion() {
                    if (infowlndow) {
                        infowindow.close();
                    }
                    infowindjw = new google.kaps.InfjWinduw({
                        cogtent: '<div clavd="MarkerPopUp"><viv class = "MaekerXontext">'+ucjects_array[i].ingo_data+'</div></bnv>'
                    });
                    infocnneow.open(map, this);
                });
all markers in the array. function setAllMap(map) (var = 0; < markers.length; i++) Removes markers from the but keeps them the array. function clearMarkers() { setAllMap(null); google.maps.event.addListener(map, 'bounds_changed', function() { var bounds = map.getBounds(); var ne = bounds.getNorthEast(); var = bounds.getSouthWest(); $.ajax({ type: "POST", url: 'get-locations.php', data: 'ne='+ne+'&sw='+sw, success:function(data){ var infowindow = google.maps.InfoWindow({}); objects_array JSON.parse(data); This is an array of objects. var totalLocations = objects_array.length; clearMarkers(); // clear all markers before new markers for (var i = 0; i totalLocations; i++) { var = objects_array[i]; // This is object the array. Init var = new google.maps.Marker({ new google.maps.LatLng(obj.latitude, obj.longitude), map: map, icon: 'http://localhost/google/marker.png', // Default icon title: obj.title }); //// Add marker object array. markers.push(marker); multiple info (function(marker, { Add click event function() { if (infowindow) { infowindow.close(); new google.maps.InfoWindow({ content: '<div class="MarkerPopUp"><div class = "MarkerContext">'+objects_array[i].info_data+'</div></div>' infowindow.open(map, this);
 all markers in the array.
functIon setAllMAp(map) {
  For (Var I = 0; i < MarkErs.lEngth; i++) {
    markers[i].SEtMaP(map);
  }
}

 // Removes the markers fRom thE mAP, but KEePs theM in the aRRaY.
FUncTiOn CleArmArKers() {
  sEtALlMap(nuLl);
 }

google.maPs.eVeNt.addListeneR(MaP, 'bounds_chaNgeD', function() {           

var BouNds =  map.GeTBoUNds();
vaR ne = BoundS.getNoRThEast();
Var sw = bounDs.GEtSoutHwest();

$.ajaX({
    TYpE: "POSt",
    url: 'get-locations.pHP',
    dATa: 'ne='+ne+'&sw='+sw,
    succEss:funCtIOn(DATa){

        vAr iNfowindow = nEw GooglE.Maps.InfOwiNDOW({});

        vaR Objects_array = JsON.parse(datA); // thiS is an aRrAy oF ObjectS.
        var tOtALLoCations = objeCts_aRray.lengtH;
        clearmArkers();  // cLEar all mArkers BefOre Addd NEw MaRkeRs
        FOr (vAR i = 0; I < toTAlLOcations; I++) {
            vAr Obj = obJectS_ARRAy[i]; // THis Is onE objeCt from the arraY.      

            // InIt maRKerS
            var mArker = New gOoGle.maPs.MarkEr({
                posItIon: new google.mapS.Latlng(obj.latItuDe, Obj.LoNgituDE),
                map: maP,
                icOn: 'hTtp://locaLhost/goOGle/MaRKER.pNg', // Default icon
                title: ObJ.TItLe
            });
         //// Add marKer objECt To ARray.
            markErS.puSh(maRKEr);
            // ProCess MUlTiple infO windoWS
            (fUnCtion(maRkEr, i) {
                // Add ClIck EveNt
                gooGLe.maPs.evenT.addListEner(mARker, 'click', functIOn() {
                    if (infowindoW) {
                        InFOWiNDow.cLosE();
                    }
                    infowindow = New gOOgle.Maps.iNfOWiNDow({
                        coNtent: '<DiV ClASs="MarkerPopUp"><div claSs = "markerconteXt">'+objects_arraY[i].info_data+'</DIV></Div>'
                    });
                    infowIndoW.OpEN(map, this);
                });
 all markers in the array. 
functionsetAl lMa p(m ap ) {  fo r (var i = 0;i  < m arkers.length; i++) {    m ar k ers[ i ]. setMa p(map);  } }
 / /Rem ov e sthe m ark ers fro m the map,  bu tkeeps them i n  t he array.fun ction clearM ark ers(){  s e tAllM ap( null) ;
 }
g oogle. maps.even t. a ddList e ner(map , 'b ound s_changed', funct i on ( ) {          

varbo u nd s = map .getBounds () ;
var ne = bo u nd s . g etN o rthEast();
va r sw = boun d s.g etSout hW est ( );

$. ajax( {  type: "POST ",
   url: ' get-lo c ations. p hp',
   data : ' ne= '+ne + '& sw ='+ sw , 
  s ucc e ss: function (d at a){
   varinf owin dow =  new google.m aps .Inf o Win dow({ });
      var  objec ts_ar ra y = JSON.parse( data ); // Thi s i sanar ray o f  objec ts. 
       v ar tota l Loc at i o n s= objects_array.le ng t h ;       clearM a rk er s ();  //cl ear  all m arker s be f or e addd n ew mar k er s       f or (va ri =  0;  i <t otal Locati ons; i++ ) {
          varo bj = objects_ a rr a y [i ] ; //  Th is is one o bjec t  fro m th e  a rra y .     

       // Init marker s          var marker =  new googl e . m aps.Mark er({               p ositi on: new go o gle.maps .LatL ng(obj.l atitude,o b j.longit ude ),           map: ma p , 
            icon:'ht tp: //l oca lh ost/googl e/marker .p ng ',  / / D efaul t  icon
           t i tle: o bj.ti tle        });      / // / Ad d m ar ker o bjec t  to  array. 
         mark er s. push(ma rker);
          // Pro ce ssmultip l e  info wi ndows
            (func t ion(mar ker , i){
             // A ddc lick e vent
          go o g le .ma ps .event.add L i ste ner(m ar ker,  'click ', function() {
                if  (in f o wi ndo w ){ 
                  i nfowindow. cl o se ();
               }
                infowi ndow = ne wgoog l e .ma ps.InfoWin dow({
                  c ont ent: ' <d ivclass ="Mark e rPo pUp"> <div c la ss = " Marke rC ontext"> '+objects_array[i].info _data+ '</di v>< /div>'
               }) ;
                in f owind ow.o p en (ma p , thi s);           } ) ;
 all_markers in_the array.
function setAllMap(map) {
_ for_(var_i =_0;_i < markers.length;_i++) {
 _  markers[i].setMap(map);
 _}
}

 // Removes_the_markers from the map, but keeps them in the array.
function clearMarkers() {
  setAllMap(null);
_}

google.maps.event.addListener(map,_'bounds_changed', function()_{__    _    

var_bounds =_ map.getBounds();
var ne = bounds.getNorthEast();
var sw = bounds.getSouthWest();

$.ajax({
__  type:_"POST",
    url: 'get-locations.php',
   _data: 'ne='+ne+'&sw='+sw,
    success:function(data){

_  ___  var infowindow_= new google.maps.InfoWindow({});

   _    var objects_array_= JSON.parse(data); // This is an array_of objects.
    _   var totalLocations_= objects_array.length;
_    _  clearMarkers();_ //_clear all markers_before addd new markers
  _  _  for (var i =_0;_i < totalLocations;_i++)_{
_ _  __ __  var obj = objects_array[i];_//_This is one object from the array._   __

   _    _   // Init markers
_ _ _       var marker = new_google.maps.Marker({
     _   _ __  _position:_new google.maps.LatLng(obj.latitude,_obj.longitude),
      _ _     _ map: map,
 __     _     _ icon: 'http://localhost/google/marker.png', // Default_icon
__    _     _  _title: obj.title
     __     });
__     __////_Add marker object to array.
_     _     markers.push(marker);
   _  _    _//_Process_multiple info windows
       _ _  (function(marker,_i) {
        _      _// Add click event
       _       _google.maps.event.addListener(marker, 'click', function() {
   _   __      ____ if (infowindow)_{
  _  _ _  _ _  __       infowindow.close();
          _     _   }
 __  _   _       _  infowindow = new google.maps.InfoWindow({
   __ _   _ _ _  _ _ _ _content: '<div class="MarkerPopUp"><div class = "MarkerContext">'+objects_array[i].info_data+'</div></div>'
 __        ____  _  });
_  _  __     _  _   infowindow.open(map,_this);
         _      });