echo '<div class="section" id="map_container_section_container">';
 $map_url = '//maps.googleapis.com/maps/api/staticmap?size=310x310&amp;maptype=terrain&amp;mobile=true&amp;sensor=false&amp;key=' . sfConfig::get('app_google_api_key') . '&amp;';
 $map_options = array();
 $module = $document->module;
 if ($module == 'summits' || $module == 'parkings' || $module == 'sites' || $module == 'huts' || $module == 'products' || $module == 'users' || $module == 'images') {
     $map_options[] = 'markers=shadow:false|icon:' . _marker_url($module) . '|' . $document['lat'] . ',' . $document['lon'];
     $map_options[] = 'zoom=12';
 } elseif ($document->get('geom_wkt') && ($module == 'outings' || $module == 'routes')) {
     $tolerance = _compute_tolerance(gisQuery::getBox2d($document->id, $module), true);
     $geoms = explode('),(', gisQuery::getEWKT($document->id, true, $module, null, $tolerance));
     foreach ($geoms as $geom) {
         $map_options[] = 'path=weight:2|color:0xffff00cc|enc:' . _polyline_encode(str_replace(array('(', ')'), '', $geom));
     }
 } elseif ($document->get('geom_wkt') && ($module == 'maps' || $module == 'areas')) {
     // we cannot use donut geometries, so we instead create multiple lines
     $tolerance = _compute_tolerance(gisQuery::getBox2d($document->id, $module));
     $geoms = gisQuery::getEWKT($document->id, true, $module, null, $tolerance);
     $geoms = explode('),(', $geoms);
     foreach ($geoms as $geom) {
         $map_options[] = 'path=weight:2|color:0xff0000cc|enc:' . _polyline_encode(str_replace(array('(', ')'), '', $geom));
     }
 }
 // display linked summits, parkings and huts, if any
 $markers = array();
 $nb_printed_docs = 0;
 foreach (array('parkings', 'summits', 'huts') as $type) {
     if (!isset($document->{$type})) {
         continue;
     }
     foreach ($document->{$type} as $doc) {
         if (!empty($doc['pointwkt'])) {