title: Gmaps.js add/remove markers from array
body: <p>I would like to display or hide some markers when a user click on a checkbox. I'm using <a href="http://hpneo.github.io/gmaps/" rel="nofollow">Gmaps.js</a> and the code responsible for this is:</p>
  
  <pre><code>// Check if the user wants to display points of interest
  $("#poi").click(function() {
      var poi_markers = [];
  
      if ($("#poi").is(':checked')) {
          // Get points of interest and display them on the map
          $.ajax({
              type: "POST",
              url: "/ajax/poi.php",
              dataType: "JSON",
              cache: false,
              success: function(data) {
                  $.each(data, function(key, value) {
                      poi_marker = {
                          marker: {
                              lat: value.latitude,
                              lng: value.longitude,
                              icon: '/images/marker-sight.png',
                              infoWindow: {
                                  content: value.name
                              }
                          }
                      }
                      poi_markers.push(poi_marker);
                  });
  
                  console.log(poi_markers);
  
                  map.addMarkers(poi_markers);
              }
          });
      } else {
          map.removeMarkers(poi_markers);
      }
  });
  </code></pre>
  
  <p>Sample JSON:</p>
  
  <pre><code>[{"name":"Biserica Neagra","latitude":"45.640981","longitude":"25.587723"}]
  </code></pre>
  
  <p>In Firebug I get this error: "uncaught exception: No latitude or longitude defined.".</p>
  
  <p>What am I doing wrong?</p>