Fix: kontakt

This commit is contained in:
2026-05-18 09:49:49 +02:00
parent a294675c16
commit d7c5ac64e7
4 changed files with 50 additions and 42 deletions

View File

@@ -68,49 +68,15 @@ class Page_Controller extends Base_Front_Controller
$this->view->meta_keywords = $page->meta_keywords;
}
$gmap = new Gmap('gmap', array
(
#'ScrollWheelZoom' => true,
'DoubleClickZoom' => true,
'ContinuousZoom' => true,
#'InfoWindow' => true,
));
$center = Kohana::config('application.gmaps.center');
// Set the map center point
$gmap->center($center['lat'], $center['lon'], $center['zoom'])->controls('small');
// Add a custom marker icon
/* $gmap->add_icon('tinyIcon', array
(
'image' => 'http://labs.google.com/ridefinder/images/mm_20_red.png',
'shadow' => 'http://labs.google.com/ridefinder/images/mm_20_shadow.png',
'iconSize' => array('12', '20'),
'shadowSize' => array('22', '20'),
'iconAnchor' => array('6', '20'),
'infoWindowAnchor' => array('6', '20')
));
*/
$gmap->add_icon('markerIcon', array
(
'image' => 'http://www.google.com/intl/en_ALL/mapfiles/marker.png',
'shadow' => 'http://www.google.com/intl/en_ALL/mapfiles/shadow50.png',
'iconSize' => array('20', '34'),
'shadowSize' => array('37', '34'),
'iconAnchor' => array('10', '34'),
'infoWindowAnchor' => array('10', '34')
));
$marker = Kohana::config('application.gmaps.marker');
// Add a new marker
$gmap->add_marker($marker['lat'], $marker['lon'], $marker['html'], array('icon' => 'markerIcon', 'title' => $marker['title']));
$page_view->page = $page;
$page_view->map_center = $center;
$page_view->map_marker = $marker;
$this->view->content = $page_view;
$this->view->api_url = Gmap::api_url();
$this->view->gmap = $gmap->render();
$this->view->message = $this->session->get('message');
$this->view->render(true);
}
}
}

View File

@@ -4,6 +4,27 @@
<?php endif;?>
<div class="text"><?php echo $page->content ?></div>
<div id="gmap-frame">
<div id="gmap">mapa</div>
<?php
$map_lat = isset($map_marker['lat']) ? $map_marker['lat'] : $map_center['lat'];
$map_lon = isset($map_marker['lon']) ? $map_marker['lon'] : $map_center['lon'];
$map_zoom = isset($map_center['zoom']) ? $map_center['zoom'] : 14;
$map_query = $map_lat.','.$map_lon;
$map_src = 'https://maps.google.com/maps?'.http_build_query(array(
'q' => $map_query,
'll' => $map_query,
'z' => $map_zoom,
'output' => 'embed',
));
?>
<iframe
id="gmap"
src="<?php echo html::specialchars($map_src) ?>"
title="Centrum Copy - mapa dojazdu"
width="500"
height="400"
frameborder="0"
scrolling="no"
marginheight="0"
marginwidth="0"></iframe>
</div>
</div>