मैं उपयोगकर्ता के भौगोलिक स्थान के लिए अनुरोध कर रहा हूँ navigator.geolocation
के माध्यम से, लेकिन मैं त्रुटि फेंक दिया हो रही है:जियोलोकेशन - 'https://www.googleapis.com/' पर नेटवर्क स्थान प्रदाता: लौटाया गया त्रुटि कोड 400
Network location provider at ' https://www.googleapis.com/ ' : Returned error code 400.
यह त्रुटि क्रोम 54.0.2840.98 पर होती है। यह फ़ायरफ़ॉक्स 50.0 पर ठीक मुद्दों के बिना काम करता है। मैं http-server
यहाँ के साथ एक स्थानीय सर्वर समारोह चल रहा हूँ है:
_getLocation: function() {
if (!navigator.geolocation) {
alert('Geolocation is not supported by this browser, maybe use a pop-up and ask user for zipcode?');
}
function success(position) {
var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
this.setState({
location: {
latitude: latitude,
longitude: longitude
}
});
this._getWeather(this.state.location.latitude, this.state.location.longitude);
}
function error(err) {
console.warn('ERROR(' + err.code + '): ' + err.message);
this.setState({
location: 'ERROR(' + err.code + '): ' + err.message
});
}
navigator.geolocation.getCurrentPosition(success.bind(this), error.bind(this));
},
मैं इस मुद्दे को अंतःस्थापित भी करें। – stueynet