title: The marker disappears depending on the scale and type of the marker
body: <p>I want to make the markers of a certain type disappear depending on the scale
  I achieved that all markers would be switched off at a scale of &lt;= 14
  Tell me how to correctly write a condition for disabling markers with the type "ps1" for a scale &lt;= 14     </p>
  
  <pre><code>&lt;script&gt;
  
  var markerType = {
      "ps1": [], "tp1": [], "rtp0": []
  };
  
    function initMap() {
    var map = new google.maps.Map(document.getElementById('map'), {
    center: new google.maps.LatLng(47.82034163, 31.19833049),
    zoom: 14,
          });
            var image =  {
            rtp0: {
            url: './image/rtp0.png',scaledSize: new google.maps.Size(28, 40)},
            ps1: {
            url: './image/ps1.png',scaledSize: new google.maps.Size(28, 40)},
            tp1: {
            url: './image/tp1.png',scaledSize: new google.maps.Size(28, 40)},
  };
            downloadUrl('phpsqlinfo.php', function(data) {
              var xml = data.responseXML;
              var markers = xml.documentElement.getElementsByTagName('marker');
              Array.prototype.forEach.call(markers, function(markerElem) {
                var point = new google.maps.LatLng(
                    parseFloat(markerElem.getAttribute('lat')),
                    parseFloat(markerElem.getAttribute('lng')));
                var type = markerElem.getAttribute('type');
  
                  var icon = image[type] || {};              
                  var marker = new google.maps.Marker({
                  icon: icon,
                  map: map,
                  position: point,
                });
  
      markerType[type].push(marker);
  
      google.maps.event.addListener(map, 'zoom_changed', function() {
      zoomLevel = map.getZoom();
  
      for (var i = 0; i &lt; markerType[type].length; i++) {
      var markers = markerType[type][i];
  
      if (zoomLevel &lt;= 14) {
      (!markers.getVisible())
       markers.setVisible(false);
        } 
      else {
      markers.setVisible(true);
       }
      }
  
  });
    });
       });
  
   }
  
   &lt;/script&gt;
  </code></pre>