PHP Classes

File: ex15.php

Recommend this page to a friend!
  Classes of Vagharshak Tozalakyan  >  Map Builder  >  ex15.php  >  Download  
File: ex15.php
Role: Example script
Content type: text/plain
Description: Example 15 - Detecting user location.
Class: Map Builder
Display maps using Google Maps API v3
Author: By
Last change: Foo
Date: 1 year ago
Size: 727 bytes


Class file image Download
if (isset($_POST['lat']) && isset($_POST['lng'])) {
$lat = floatval($_POST['lat']);
$lng = floatval($_POST['lng']);
// do something...
die($lat . ' ' . $lng);
<!DOCTYPE html>
<meta charset="utf-8">
<title>Maps Test</title>
<script src=""></script>
function mbOnAfterLocationDetected(lat, lng) {
    $.post("ex15.php", {lat: lat, lng: lng});
    alert(lat + ' ' + lng);
require_once 'class.MapBuilder.php';
$map = new MapBuilder('', 'AIzaSyB230QxSetZoJiM9noon7FiAQXbc-HPSLU');