PHP

Click on map and get Longitude -Latitude.

How To Get Longitude – Latitude When Clicked On Map? <div id=”MyMap” style=”width:100%;height:500px;”></div> <script> function myMap() {   var mapCanvas = document.getElementById(“MyMap”);   var myCenter=new google.maps.LatLng(51.508742,-0.120850);   var mapOptions = {center: myCenter, zoom: 5};   var map = new google.maps.Map(mapCanvas, mapOptions);   google.maps.event.addListener(map,’click’, function(event) {     LocationMarker(map, event.latLng);   }); } function LocationMarker(map, location) {   var marker = new google.maps.Marker({     position: location, …

Click on map and get Longitude -Latitude. Read More »

How to Calculate distance between two address using latitude and longitude.

According To me it’s one of important requirement in many projects related to address. To Calculate distance between two address using latitude and longitude use this method. function LongLatDistance($Latitude1, $Longitude1, $Latitude2, $Longitude2) {   $theta = $Longitude1 – $Longitude2;   $miles = (sin(deg2rad($Latitude1))*sin(deg2rad($Latitude2)))+(cos(deg2rad($Latitude1))*cos(deg2rad($Latitude2)) * cos(deg2rad($theta)));   $miles = acos($miles);   $miles = rad2deg($miles);   $result[‘miles’] = $miles * 60 * …

How to Calculate distance between two address using latitude and longitude. Read More »

Scroll to Top