Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geolocation returning 0,0 for all addresses #53

Closed
sparky672 opened this issue Dec 27, 2016 · 1 comment
Closed

Geolocation returning 0,0 for all addresses #53

sparky672 opened this issue Dec 27, 2016 · 1 comment

Comments

@sparky672
Copy link

sparky672 commented Dec 27, 2016

I have two CodeIgniter projects both using the same version of your software. Neither project is using an API key. Both take a street address and use Google Maps geolocation to get coordinates.

Both projects worked fine until recently and none of my code has changed. On one project, the geolocation coordinates for ALL addresses are coming back 0,0 with no error message.

$this->load->library('googlemaps');
$location = $data['this_event']['location']; // street address
$geocode = $this->googlemaps->get_lat_long_from_address($location);
$config_map = array(
    'center'    => $location,
    'map_width'  => '375px',
    'map_height' => '300px',
    'map_type'    => 'TERRAIN',
    'zoom'    => 13,
    'ontilesloaded' => 'iw_map.setContent(marker_0.get("content"));'
);
$marker_map = array(
    'position'    => $location,
    'infowindow_content'  => '<div class="infobox">' . $location . '</div>'
);
$this->googlemaps->initialize($config_map);
$this->googlemaps->add_marker($marker_map);
$data['map'] = $this->googlemaps->create_map();

And then in the rendered view, I'm getting latitude and longitude as 0, 0 in the generated JavaScript.

var myLatlng = new google.maps.LatLng(0, 0);

I'm at a loss trying to figure out why it's suddenly failing in one of my two websites.

@sparky672
Copy link
Author

Something must have changed with how Google interprets the street address. Where the name of the business used to be ignore/acceptable is now causing geolocation to return 0,0 lat/lng coordinates.

Everything works fine when the name of the business is removed from the street address string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant