Skip to content

Commit

Permalink
Fix issue with map loading while using the backend geopicker
Browse files Browse the repository at this point in the history
  • Loading branch information
croastforge committed Jan 21, 2025
1 parent 5077b3c commit f029144
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions src/Classes/GeoPicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Contao\BackendTemplate;
use Contao\Backend;
use Contao\ContentModel;
use Contao\Environment;
use Contao\FrontendTemplate;
use Contao\System;
use Contao\DC_Table;
Expand Down Expand Up @@ -82,11 +83,11 @@ public function run()
$this->Template = new BackendTemplate('c4g_geopicker');

$this->Template->theme = $this->getTheme();
$this->Template->base = $this->Environment->base;
$this->Template->base = Environment::get('base');
$this->Template->language = $GLOBALS['TL_LANGUAGE'];
$this->Template->title = $GLOBALS['TL_CONFIG']['websiteTitle'];
$this->Template->title = Environment::get('websiteTitle');
$this->Template->headline = $GLOBALS['TL_LANG']['c4g_maps']['geopicker'];
$this->Template->charset = $GLOBALS['TL_CONFIG']['characterSet'];
$this->Template->charset = Environment::get('characterSet');

$objMapData = MapDataConfigurator::prepareMapData($this, $this->Database, ['backend' => true, 'type' => 'geopicker']);

Expand All @@ -111,11 +112,11 @@ public function generate()
$this->Template = new BackendTemplate('c4g_geopicker');

$this->Template->theme = $this->getTheme();
$this->Template->base = $this->Environment->base;
$this->Template->base = Environment::get('base');
$this->Template->language = $GLOBALS['TL_LANGUAGE'];
$this->Template->title = $GLOBALS['TL_CONFIG']['websiteTitle'];
$this->Template->title = Environment::get('websiteTitle');
$this->Template->headline = $GLOBALS['TL_LANG']['c4g_maps']['geopicker'];
$this->Template->charset = $GLOBALS['TL_CONFIG']['characterSet'];
$this->Template->charset = Environment::get('characterSet');

$c4gSettings = C4gSettingsModel::findSettings();
$objMap = ContentModel::findByPk($c4gSettings->position_map);
Expand Down
6 changes: 3 additions & 3 deletions src/Resources/contao/templates/backend/c4g_geopicker.html5
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
<div id="main">
<fieldset id="pal_general_legend" class="tl_tbox">

<div class="w50" style="margin-left:16px" >
<h3 style="margin-bottom: 1em;"><label>X-Koordinate</label></h3>
<div class="w50" style="margin-left:16px; margin-top: 10px;" >
<!-- <h3 style="margin-bottom: 1em;"><label>X-Koordinate</label></h3>-->
<input id="c4gGeoPickerGeoX" class="tl_text" type="text" value="<?php echo $this->mapData['geopicker']['value_geoX'] ?>" name="geoX" readonly>
<p class="tl_help tl_tip" title="">X-Koordinate</p>
</div>

<div class="w50" style="margin-left:16px" >
<h3 style="margin-bottom: 1em;"><label>Y-Koordinate</label></h3>
<!-- <h3 style="margin-bottom: 1em;"><label>Y-Koordinate</label></h3>-->
<input id="c4gGeoPickerGeoY" class="tl_text" type="text" value="<?php echo $this->mapData['geopicker']['value_geoY'] ?>" name="geoY" readonly>
<p class="tl_help tl_tip" title="">Y-Koordinate</p>
</div>
Expand Down

0 comments on commit f029144

Please sign in to comment.