Пример #1
0
$circle_options = array('fillColor' => '#00ff00', 'strokeWeight' => 1, 'fillOpacity' => 0.05, 'clickable' => false);
// Create a circle with radius of 100m
$circle = \PHPGoogleMaps\Overlay\Circle::createFromLocation('San Diego, CA', 100, $circle_options);
// Create some marker options
$marker_options = array('title' => 'San Diego, CA', 'content' => '<p><strong>San Diego, CA</strong></p>', 'draggable' => true);
// Create a marker
$marker = \PHPGoogleMaps\Overlay\Marker::createFromLocation('San Diego, CA', $marker_options);
// Add the circle and marker to the map
$circle_map = $map->addObject($circle);
$marker_map = $map->addObject($marker);
// Set map options
$map->setCenter('San Diego, CA');
$map->setZoom(15);
$map->disableAutoEncompass();
// bind the center of the circle to the position of the marker
$map->bind($circle_map, 'center', $marker_map, 'position');
?>

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>Binding Objects - <?php 
echo PAGE_TITLE;
?>
</title>
	<link rel="stylesheet" type="text/css" href="_css/style.css">
	<?php 
$map->printHeaderJS();
?>
	<?php