Fix incorrect coordinates determination in gmaps ce

This commit is contained in:
Björn Fromme
2018-07-03 09:13:27 +02:00
parent 272ca0bd8a
commit 36e3a09682
3 changed files with 26 additions and 22 deletions
@@ -97,11 +97,10 @@ class PageLayoutView implements PageLayoutViewDrawItemHookInterface
$drawItem = false;
$region = BackendUtility::getRecord('tx_epproducts_domain_model_region', $row['tx_eptheme_context_region']);
$itemContent = '<strong>Google Map</strong><br />' . $region['name'];
if ((int) $row['tx_eptheme_context_hotel'] > 0) {
$hotel = BackendUtility::getRecord('tx_epproducts_domain_model_hotel',
$row['tx_eptheme_context_hotel']);
$itemContent .= ', ' . $hotel['name'];
}
} elseif ((int) $row['tx_eptheme_context_hotel'] > 0) {
$drawItem = false;
$hotel = BackendUtility::getRecord('tx_epproducts_domain_model_hotel', $row['tx_eptheme_context_hotel']);
$itemContent = '<strong>Google Map</strong><br />' . $hotel['name'];
}
break;
case 'disturber':
@@ -9,18 +9,15 @@ tt_content.gmap {
where.wrap = uid=|
pidInList = {$plugin.tx_epproducts.settings.hotelsStoragePid}
as = hotel
dataProcessing {
10 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
10 {
table = tx_epproducts_domain_model_region
where.data = field:region
where.wrap = uid=|
pidInList = {$plugin.tx_epproducts.settings.destinationsStoragePid}
recursive = 2
as = region
}
}
}
20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
20 {
table = tx_epproducts_domain_model_region
where.data = field:tx_eptheme_context_region
where.wrap = uid=|
pidInList = {$plugin.tx_epproducts.settings.destinationsStoragePid}
recursive = 2
as = region
}
}
settings.googleMapsApiKey = {$plugin.tx_eptheme.settings.googleMapsApiKey}
@@ -1,17 +1,25 @@
<html data-namespace-typo3-fluid="true" lang="en"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
xmlns:v="http://typo3.org/ns/FluidTYPO3/Vhs/ViewHelpers">
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers">
<f:layout name="Default"/>
<f:section name="Content">
<f:if condition="{hotel}">
<f:render section="Map" arguments="{latitude: hotel.0.data.latitude, longitude: hotel.0.data.longitude, googleMapsApiKey: settings.googleMapsApiKey}"/>
</f:if>
<f:if condition="{region}">
<f:render section="Map" arguments="{latitude: region.0.data.latitude, longitude: region.0.data.longitude, googleMapsApiKey: settings.googleMapsApiKey}"/>
</f:if>
</f:section>
<f:section name="Map">
<div class="row">
<gmap
lat="{hotel.0.data.latitude -> v:or(alternative: hotel.0.region.0.data.latitude)}"
lng="{hotel.0.data.longitude -> v:or(alternative: hotel.0.region.0.data.longitude)}"
lat="{latitude}"
lng="{longitude}"
:zoom="17"
api-key="{settings.googleMapsApiKey}"
api-key="{googleMapsApiKey}"
></gmap>
</div>
</f:section>