title: How can I check the marker is or isn't in the bounds using google maps v3
body: <p>This is my code, I think it may has some mistakes:</p>
  
  <pre><code>        var bounds_array;
          google.maps.event.addListener(map,'bounds_changed', function (){
              var bounds_=map.getBounds();
              if(bounds_){
                  var leftBottom=[bounds_.getSouthWest().lat(),bounds_.getSouthWest().lng()]
                  var rightTop=[bounds_.getNorthEast().lat(),bounds_.getNorthEast().lng()]
                  bounds_array=[leftBottom,rightTop];
              }
          });
  
      function check_is_in_or_out(marker){
          var leftBottom=bounds_array[0],rightTop=bounds_array[1];
          var marker_p=[marker.getPosition().lat(),marker.getPosition().lng()];
          if(marker_p[0]&lt;leftBottom[0]||marker_p[0]&gt;rightTop[0]||
              marker_p[1]&lt;leftBottom[1]||marker_p[1]&gt;rightTop[1])return 0;//0 is out
          else return 1;//1 is in
      }
  </code></pre>
  
  <p>Is this code enough to check the bounds is in or out?</p>