bjorn2404 / jQuery-Store-Locator-Plugin

A store locator plugin using Google Maps API version 3
MIT License
495 stars 235 forks source link

Data Location , can it be a REST call ? #137

Closed pranireddy9 closed 8 years ago

pranireddy9 commented 8 years ago

Hi ,

Is there any specific thing do i need to change to make a REST call for the datalocation ?

Thanks, Pranitha.

bjorn2404 commented 8 years ago

You probably need to change the dataType setting to jsonp. dataType is one of the plugin settings.

pranireddy9 commented 8 years ago

Hi ,

I am not getting any response when i change to jsonp as my data type and i am having following issue.

XMLHttpRequest cannot load http://localhost:8082/SpringRestfulWebServicesWithJSONExample/locations?ori…%20TX%2078759%2C%20USA&formattedAddress=&boundsNorthEast=&boundsSouthWest=. No 'Access-Control-Allow-Origin' header is present on the requested resource. Thanks, Pranitha

bjorn2404 commented 8 years ago

I guess I should back up and say I'm confused by the original question. I was assuming that you're pulling the location data from another location/domain. If that's the case you'll want to enable CORS if JSONP isn't doing it. If that's not the case, I'm not following what you're trying to do. The jQuery plugin makes the ajax() request and as far as I can tell there's nothing in the plugin that would change if it was making a request to a RESTful service/location or not.