Skip to content

Instantly share code, notes, and snippets.

@gordonbanderson
Created April 3, 2013 07:51
Show Gist options
  • Save gordonbanderson/5299266 to your computer and use it in GitHub Desktop.
Save gordonbanderson/5299266 to your computer and use it in GitHub Desktop.
public function MapWithDataList() {
$flickrPhotos = DataList::create( 'FlickrPhoto' )->where( 'Lat != 0 AND Lon !=0' );
if ( $flickrPhotos->count() == 0 ) {
return ''; // don't render a map
}
$map = $flickrPhotos->getRenderableMap();
$map->setZoom( $this->ZoomLevel );
$map->setAdditionalCSSClasses( 'fullWidthMap' );
$map->setShowInlineMapDivStyle( true );
if ( $this->ClusterExampleDataset ) {
$map->setClusterer( true );
}
return $map;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment