<?php echo getAddress("28.6100", "77.2300"); function getaddress($lat,$lng) { $url = 'http://maps.googleapis.com/maps/api/geocode/json?latlng='.trim($lat).','.trim($lng).'&sensor=false'; $json = @file_get_contents($url); $data=json_decode($json); $status = $data->status; if($status=="OK") return $data->results[0]->formatted_address; else return false; } ?>
Html, JAVA,DOTNET,Javascript, PHP, and JQuery Scripts and its issues with solutions
Showing posts with label Gete Latitude & longitude. Show all posts
Showing posts with label Gete Latitude & longitude. Show all posts
Wednesday, 6 August 2014
Get address by using lattitude and longitude Google APi
Friday, 18 July 2014
How to get IP based country,state,currency and countrycode and Internet connection Provider and lattitude & longitude in PHP?
<?php echo getipaddress(); function getipaddress(){ $xml = simplexml_load_file("http://www.geoplugin.net/xml.gp?ip=".getRealIpAddr()); print_r($xml); $ccode=$xml->geoplugin_countryCode; return $ccode; } function getRealIpAddr(){ if (!empty($_SERVER['HTTP_CLIENT_IP'])) { $ip=$_SERVER['HTTP_CLIENT_IP']; }elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; }else{ $ip=$_SERVER['REMOTE_ADDR']; } //$ip="YOUR IP"; return $ip; } echo "<hr>"; $details = ip_details(getRealIpAddr()); print_r($details); function ip_details($ip) { $json = file_get_contents("http://ipinfo.io/{$ip}"); $details = json_decode($json); return $details; } ?>
Friday, 11 April 2014
Get Latitdue and longitude from google map
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="http://maps.google.com/maps?file=api&v=2&key=" type="text/javascript"></script> <script type="text/javascript"> $( document ).ready(function() { $("#map").show(); show_popup(); }); function show_popup(){ $("#map").show(); if (GBrowserIsCompatible()) { var map = new GMap2(document.getElementById("map")); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); var center = new GLatLng(11.00, 78.00); map.setCenter(center, 7); geocoder = new GClientGeocoder(); var marker = new GMarker(center, {draggable: true}); map.addOverlay(marker); document.getElementById("lat").value = center.lat().toFixed(5); document.getElementById("lng").value = center.lng().toFixed(5); GEvent.addListener(marker, "dragend", function() { var point = marker.getPoint(); map.panTo(point); document.getElementById("lat").value = point.lat().toFixed(5); document.getElementById("lng").value = point.lng().toFixed(5); }); GEvent.addListener(map, "moveend", function() { map.clearOverlays(); var center = map.getCenter(); var marker = new GMarker(center, {draggable: true}); map.addOverlay(marker); document.getElementById("lat").value = center.lat().toFixed(5); document.getElementById("lng").value = center.lng().toFixed(5); GEvent.addListener(marker, "dragend", function() { var point =marker.getPoint(); map.panTo(point); document.getElementById("lat").value = point.lat().toFixed(5); document.getElementById("lng").value = point.lng().toFixed(5); }); }); } } </script> <table align='center'> <tr> <td><label>Latitude</label></td> <td><label>:</label></td> <td><input type="text" name="latitude" id="lat" onclick="show_popup();" readonly value=""/> <em></em> </td> <td><label>Longitude</label></td> <td><label>:</label></td> <td><input type="text" name="longitude" onclick="show_popup();" id="lng" readonly value=""/> <em></em> </td> </tr> <tr><td colspan='6'><div align="center" id="map" style="width:700px;height:450px;-webkit-border-radius: 18px 20px 20px 20px;-moz-border-radius: 18px 20px 20px 20px;border-radius: 18px 20px 20px 20px;border:2px solid #82B5CF;background:rgba(231,228,237,0.5);"></div></td></tr> </table>
Subscribe to:
Posts (Atom)