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
[…] <?php /** * Define ClassA */ class ClassA { public $a = 1; protected $b = 2; private $c = 3; function detail() { echo $this->a; echo $this->b; echo $this->c; } } $obj = new ClassA(); echo $obj->a; // Works echo $obj->b; // Fatal Error echo $obj->c; // Fatal Error $obj->detail(); // Shows Public, Protected and Private […]
LikeLike
[…] can create our prefix route as […]
LikeLike
[…] query within 2 hours. Please view this blog and know the process how you can ask & resolve your PHP programming questions […]
LikeLike
[…] you would like to calculate air distance between two location without any API or mysql query. You can use below code to get distance between two […]
LikeLike
[…] is one of the scripting language. In which session handling is one of the key thing mostly using in web […]
LikeLike