Skip to content

Instantly share code, notes, and snippets.

View josefadamcik's full-sized avatar

Josef Adamčík josefadamcik

View GitHub Profile
@josefadamcik
josefadamcik / gist:1082091
Created July 14, 2011 08:18
GMAP fit markers to view
var targetBounds, i, markerPositions;
markerPositions = ; //pole objektu google.mapsLatLng pro jdnotlive markery
targetBounds = new google.maps.LatLngBounds();
for (i = 0; i < markerPositions.length; i++) {
targetBounds.extend(markerPositions[i]);
}
map.fitBounds(targetBounds); //map je objekt google.maps.Map
<?php
class BaseDoctrineForm extends sfFormDoctrine
{
public function __construct($object = null, $options = array(), $CSRFSecret = null)
{
parent::__construct($object, $options, $CSRFSecret);
// tell the widget schema which fields are required
$this->widgetSchema->addOption('required_fields', $this->getRequiredFields());