title: Google's Places API and JQuery request - Origin http://localhost is not allowed by Access-Control-Allow-Origin
body: <p>I doing some testing for a project I got in mind which involves using places nearby. So I went with the big guy and started messing around with Google's Places Api. I'm using leaflet with openstreet tiles for my map. Now everything is fine until I try to use the dang thing.  </p>
  
  <pre><code>var lat = coords.lat;
  var lng = coords.lng;
  var apiUrl = "https://maps.googleapis.com/maps/api/place/nearbysearch/json";
  var data = {
      key: 'AIzaSyBl8bmE8kQT7RjoXhP6k2yDti44h9-fSUI',
      location: lat+','+lng,
      radius: '10000',
      sensor: 'false',
      rankby: 'prominence',
      types: 'bar|night_club'
  };
  $.ajax({
    url: apiUrl,
    type: 'POST',
    data: data,    
    dataType:"jsonp",
    crossDomain: true,
    success: function(data) {
              var obj = $.parseJSON(data);
                  // console.log(data.next_page_token);
            }
  });
  </code></pre>
  
  <p>Changing the <code>dataType</code> property to <code>json</code> I get <code>Origin http://localhost is not allowed by Access-Control-Allow-Origin.</code> Using jsonp I get a parsing error <code>Unexpected token :</code> Obviusly <code>$.parseJSON</code> does not work... Is there a way to make this work without having to use Google Maps Api? If the answer is no... Is there another places api as good as google's?</p>
  
  <p>Thanks!</p>