PHP Form Builder Class / Examples / Google Maps

Version: Released:

Google Maps - This project leverages v3 of the Google Maps API to provide functionality for capturing latitude/longitude information. Below you will find a detailed list of the various form/element attributes that affect the Google Maps API v3 integration.

Below you'll find several ways you can use the addLatLng function in your development.

Processing


Processing

<?php
$form 
= new form("googlemaps_0");
$form->setAttributes(array(
    
"width" => 500
));

if(!empty(
$_GET["errormsg_0"]))
    
$form->errorMsg filter_var(stripslashes($_GET["errormsg_0"]), FILTER_SANITIZE_SPECIAL_CHARS);

$form->addHidden("cmd""submit_0");
$form->addLatLng("Latitude/Longitude:""MyLatLng");
$form->addLatLng("Latitude/Longitude w/Default Value:""MyLatLngPrefilled", array(40.689, -74.045));
$form->addLatLng("Latitude/Longitude w/Custom Dimensions:""MyLatLngDimensions""", array("style" => "width: 300px;""height" => 150"width" => 300));
$form->addLatLng("Latitude/Longitude w/zoom Attribute:""MyLatLngZoom""", array("zoom" => 13));
$form->addButton();
$form->render();
?>

<br/><br/>

<?php
$form 
= new form("googlemaps_1");
$form->setAttributes(array(
    
"latlngDefaultLocation" => array(52.52313.411),
    
"width" => 500
));

if(!empty(
$_GET["errormsg_1"]))
    
$form->errorMsg filter_var(stripslashes($_GET["errormsg_1"]), FILTER_SANITIZE_SPECIAL_CHARS);

$form->addHidden("cmd""submit_1");
$form->addLatLng("Latitude/Longitude w/latlngDefaultLocation Attribute:""MyLatLng");
$form->addButton();
$form->render();
?>