please i'm trying to get details of a json result from an API but getting (NaNa, NaNa).. Here is a break down of the code.
Here's the API..
public function lat($label)
{
$lat = Location::where('label', $label)->select('lat', 'lng')->get();
$myJSON = json_encode($lat);
return $myJSON;
}
Raw Data Result From API
[{"lat":"5.475577","lng":"7.519388"}]
User.js
var stateUrl = "/home/lat/" + $scope.locationState;
$http({
method: "GET",
url: stateUrl
}).then(
function successCallback(response) {
var source1 = new google.maps.LatLng(
response.data[1],
response.data[3]
);
Thank you..