Tuesday, 15 September 2015

javascript - Want to use Google map api on localhost -


After

I have encountered a problem with my Google Map API while getting the nearest location

< P> code :.

  var header = {'access-control-permission-origin': '*', 'content-type': 'application / jason'}; Var request = {method: 'get by' url: 'Https://mapskgoogleapiskcom/maps/api/place/nearbysearch/json?location=-33k8670522,l5lkl957362&radius=500&types=food&name ? = Cruise & amp; Key = AIzaSyCLf2OhSgKKOju1hpUBirFtZ-W26zObyVI sensor = false ', header: header} $ http (request) .success (function (d) {warning (d)});  

Error:

XMLHttpRequest can not load ... = Food & amp; Name = cruise & amp; Key = AIzaSyCLf2OhSgKKOju1hpUBirFtZ-W26zObyVI sensor = false. No accessible on the requested resource-Control-Allow-Origin "header does not exist, therefore, does not allow Genesis response HTTP status code was 405.

  var headers = { 'access -kantrol-allow-origin': '*', 'Content-Type': 'Application / Jason'}; Var request = {url: 'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=cruise&key=AIzaSyCLf2OhSgKKOju1hpUBirFtZ -W26zObyVI? Sensor = false ', header: header) $ http.get (req.url, header) .success (function (d) {alert (D)});  

No comments:

Post a Comment