Google Map integration in PHP to Calculate Latitude and Longitude

This code will calculate the latitude and longitude of the place in background on entering the place name.

For integration of Google map to calculate Latitude and Longitude major script is :

<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>

To make the autocomplete of the address create a object of the class:

google.maps.places.Autocomplete

Here is the complete code to get the exact location latitude and longitude using Google map. Hope it may help you somewhere.

<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script>
<script type="text/javascript">
function initialize() {
var address = (document.getElementById('my_address'));
var autocomplete = new google.maps.places.Autocomplete(address);
autocomplete.setTypes(['geocode']);
google.maps.event.addListener(autocomplete, 'place_changed', function() {
var place = autocomplete.getPlace();
if (!place.geometry) {
return;
}

– See Full Code at: http://findnerd.com/list/view/Google-Map-integration-in-PHP-to-Calculate-Latitude-and-Longitude/3558/

For queries about PHP Programming Questions and Answers, You can also Visit to PHP Developer Forum

Advertisements
Google Map integration in PHP to Calculate Latitude and Longitude

5 thoughts on “Google Map integration in PHP to Calculate Latitude and Longitude

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s