Posts

Showing posts from November, 2018

distance in km between two points in php using curl

<?php $origin="indore"; $destination="delhi"; //$origin = urlencode($_SESSION['source1']); //$destination = urlencode($_SESSION['dest1']); $url = "https://maps.googleapis.com/maps/api/distancematrix/json?origins=$origin&destinations=$destination&key=AIzaSyCBK8biD4eeBl4E1GoRdh57ndMTHWfYQX4"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_PROXYPORT, 3128); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); $response = curl_exec($ch); curl_close($ch); $response_a = json_decode($response, true); ?> <div class="">   <?php echo $response_a['rows'][0]['elements'][0]['distance']['text']; ?> </div>

get lat and long from address in jquery

<html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&libraries=places"></script> <link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"> </head> <body> <textarea placeholder="Enter Area name to populate Latitude and Longitude" name="address" onFocus="initializeAutocomplete()" id="locality" ></textarea><br> <input type="text" name="city" id="city" placeholder="City" value="" ><br> <input type="text" name="latitude" id="latitude" placeholder="Latitude" value="" ><br> <input type="tex...

calculate distance between two points in jquery

<!doctype html> < html class = " no-js " lang = " " > < head > < meta charset = " utf-8 " > < meta http-equiv = " X-UA-Compatible " content = " IE=edge,chrome=1 " > < meta name = " author " content = " Green Ido | @greenido | plus.google.com/+greenido " > < meta name = " viewport " content = " width=device-width, initial-scale=1.0 " /> < title >Geo - Calculate the distance</ title > < meta name = " description " content = " Geo - Calculate the distance " > < meta name = " viewport " content = " width=device-width, initial-scale=1 " > < style type = " text/css " > body { font-size : 120 % ; } #demo { padding : 1 em ; background : yellow ; width : 20 em ; border-radius : 1 em ; } Button { p...