Se ha producido un error al procesar la plantilla.
The following has evaluated to null or missing: ==> Kml [in template "37703#37743#1558915" at line 32, column 55] ---- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign dlFileEntryKML = dlTool.getDL... [in template "37703#37743#1558915" at line 32, column 1] ----
1<#-- Services -->
2<#assign assetEntryLocalServiceUtil = serviceLocator.findService("com.liferay.asset.kernel.service.AssetEntryLocalService")/>
3<#assign assetLinkLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetLinkLocalService")/>
4<#assign journalArticleResourceServiceUtil = serviceLocator.findService("com.liferay.journal.service.JournalArticleResourceLocalService")/>
5<#assign assetVocabularyLocalService = serviceLocator.findService("com.liferay.asset.kernel.service.AssetVocabularyLocalService")! />
6
7<#-- Reserved vbles -->
8<#assign title = .vars['reserved-article-title'].data>
9<#assign articleId=.vars["reserved-article-id"].data />
10<#assign description=.vars["reserved-article-description"].data />
11<#assign smallImageUrl=.vars["reserved-article-small-image-url"].data />
12<#assign date=.vars["reserved-article-display-date"].data />
13<#assign request = .vars['request']>
14
15<#-- Init -->
16<#assign assetEntry = journalTool.getAssetEntryByArticleId(groupId, articleId)>
17<#assign journalArticle = journalTool.getJournalArticleByAssetEntry(assetEntry)>
18<#assign articleURL = themeDisplay.getURLPortal()+themeDisplay.getURLCurrent()>
19<#assign articleSocialBookmarks = themeDisplay.getThemeSetting("article-social-bookmarks")!>
20<#assign layoutSetBannerPath = layoutTool.getLayoutSetBannerPath(groupId, themeDisplay.getLayout().isPrivateLayout())!>
21<#assign articleMainImageThumbnail3 = dlTool.getThumbnail(smallImageUrl, "3", layoutSetBannerPath)! />
22<#assign articleMainImageThumbnail1 = dlTool.getThumbnail(smallImageUrl, "1")! />
23<#assign ddmStructureNameNormalize = "template-${friendlyURLNormalizerTool.normalize(journalArticle.getDDMStructure().getName(localeUtil.getDefault()))}" />
24<#assign baseUrl = themeDisplay.getURLPortal()/>
25
26<#-- Build -->
27<#if Nombre.data?has_content>
28 <#assign title = Nombre.data>
29</#if>
30
31<#-- KML -->
32<#assign dlFileEntryKML = dlTool.getDLFileEntryByPath(Kml.getData())/>
33<#assign document = saxReaderUtil.read(dlFileEntryKML.getContentStream())/>
34<#assign rootElement = document.getRootElement()/>
35
36<#-- Recuperación de parámetros de KML -->
37<#assign xpath = saxReaderUtil.createXPath("//root:Placemark/root:LineString/root:coordinates", "root", "http://www.opengis.net/kml/2.2")/>
38<#assign coordinates_all = xpath.selectSingleNode(document)!>
39<#assign coordinates_array = coordinates_all.data?split(" ")>
40<#assign coordinate_middle_pos = getterUtil.getInteger(coordinates_array?size/2)>
41<#assign coordinate_middle = coordinates_array[coordinate_middle_pos]?split(",")>
42<#assign lookAtLongitude = coordinate_middle[0]>
43<#assign lookAtLatitude = coordinate_middle[1]>
44<#assign coordinate_start = coordinates_array[0]?split(",")>
45<#assign startLongitude = coordinate_start[0]>
46<#assign startLatitude = coordinate_start[1]>
47
48<#-- Id de los tramos -->
49<#assign counter = 1>
50<#assign count = 0>
51
52<#-- Obtener el nombre de los tramos -->
53<#assign xpath = saxReaderUtil.createXPath("//root:LineString/ancestor::root:Placemark/root:name", "root", "http://www.opengis.net/kml/2.2")>
54<#assign placemarksName = xpath.selectNodes(document)>
55
56<#-- Obtener el nombre de los albergues -->
57<#assign xpath = saxReaderUtil.createXPath("//root:LookAt/ancestor::root:Placemark/root:name", "root", "http://www.opengis.net/kml/2.2")>
58<#assign placemarksAlberguesName = xpath.selectNodes(document)>
59<#assign caminoCategories = journalTool.getCategories(groupId, journalArticle.getArticleId(), ["Camino"])/>
60
61<article class="template ${ddmStructureNameNormalize} template-etapa" role="article">
62
63 <header class="article-header-wrapper row no-gutters">
64
65 <div class="article-header-container article-header-container-static">
66 <div class="container">
67 <div class="row no-gutters">
68 <div class="col-md-6">
69 <div class="article-image" style="background-image: url('${articleMainImageThumbnail3}')">
70 <img class="sr-only" src="${articleMainImageThumbnail3}" alt="${languageUtil.format(request,'go-to-x','image')} ${title}"/>
71 </div>
72 </div>
73 <div class="article-info-wrapper col-md-6">
74 <div class="article-info">
75
76 <div class="article-title">${title}</div>
77 <div class="article-list-wrapper">
78
79 <ul class="article-list list-unstyled article-list-info">
80 <li class="article-list-item mb-4">
81 <span class="fas fa-map">
82 <span class="hide-accessible">${languageUtil.get(request, "infoasturias-itinerario")}</span>
83 </span>
84 <#if caminoCategories?size !=0>
85 <#list caminoCategories as ctg>
86 <#if ctg.getParentCategoryId() == 0>
87 <span class="field-wrapper text-uppercase">
88 <span class="field">${languageUtil.get(request, "infoasturias-itinerario")}:</span>
89 <span class="text">${ctg.getTitle(locale)}</span>
90 </span>
91 </#if>
92 </#list>
93 </#if>
94 </li>
95 <#if Sumario.Resumen.data?has_content>
96 <li class="article-list-item mb-4">
97 <span class="fas fa-map-marker-alt">
98 <span class="hide-accessible">${languageUtil.get(request, "infoasturias-recorrido")}</span>
99 </span>
100 <span class="field-wrapper">
101 <span class="field">${languageUtil.get(request, "infoasturias-recorrido")}:</span>
102 <span class="text">${htmlUtil.extractText(Sumario.Resumen.data)}</span>
103 </span>
104 </li>
105 </#if>
106
107 <#if Sumario.Distancia.data?has_content>
108 <li class="article-list-item">
109 <span class="fas fa-ruler-horizontal">
110 <span class="hide-accessible">${languageUtil.get(request,"infoasturias-distancia")}</span>
111 </span>
112 <span class="field-wrapper">
113 <span class="field">${languageUtil.get(request, "infoasturias-distancia")}:</span>
114 <#list Sumario.Distancia.getSiblings() as Item>
115 <span class="btn btn-primary route-distance">${Item.data} Kms</span>
116 </#list>
117 </span>
118 </li>
119 </#if>
120
121 <#if Kml.data?has_content>
122 <li class="article-list-item document">
123 <span class="fas fa-route">
124 <span class="hide-accessible">${languageUtil.get(request,"infoasturias-trazado-de-la-ruta")}</span>
125 </span>
126 <span class="field-wrapper">
127 <span class="field">${languageUtil.get(request, "infoasturias-trazado-de-la-ruta")}:</span>
128 <span class="text">
129 <#if Kml.data?has_content >
130 <#assign dlFileEntryKML = dlTool.getDLFileEntryByPath(Kml.data) />
131 <#if validator.isNotNull(dlFileEntryKML)>
132 <#assign downloadURLkml = "/documents/${groupId}/${dlFileEntryKML.getUuid()}" />
133 <#assign extKML = dlFileEntryKML.getExtension()/>
134 <span class="text">
135 <a href="${downloadURLkml}" class="${extKML}" title="${languageUtil.get(request,'infoasturias-download')} ${extKML}">${languageUtil.get(request,'infoasturias-download')} ${extKML}</a>
136 </span>
137 </#if>
138 </#if>
139 </span>
140 </span>
141 </li>
142 </#if>
143 </ul>
144 </div>
145 </div>
146 </div>
147 </div>
148 </div>
149 </div>
150 </header>
151
152 <div class="sheet sheet-lg">
153
154
155 <div class="article-great hide">
156 <div class="route-resume-tracks-box hide">
157 <div class="route-resume-tracks">
158 <div class="route-resume-track-marker route-resume-track-marker-first"><div class="route-point-text"></div><div class="route-km-text">Km 0</div></div>
159 <div class="route-resume-track-marker route-resume-track-marker-last"><div class="route-point-text"></div><div class="route-km-text">Km 0</div></div>
160 </div>
161 </div>
162 </div>
163
164
165 <#assign hasTab1 = Kml.data?has_content>
166 <#assign hasTab2 = Sumario.Distancia.data?has_content || Descripcion.data?has_content>
167 <#assign showFirstTab = true>
168
169 <div class="article-accordion accordion">
170
171 <#if Visualizador.Slide.getData()?has_content>
172 <div class="slick article-slick article-section <#if Visualizador.Slide.getSiblings()?size==1>hide</#if>">
173 <#list Visualizador.Slide.getSiblings() as Slide>
174 <#if validator.isNotNull(Slide.getData()) || validator.isNotNull(Slide.SlideUrl.getData())>
175 <#assign slideThumbnail3 = dlTool.getThumbnailByJSON(Slide.data, "3")! />
176 <#assign slideThumbnail2 = dlTool.getThumbnailByJSON(Slide.data, "2")! />
177 <#assign slidePath = dlTool.getPathByJSON(Slide.data, themeDisplay.getScopeGroupId())! />
178 <#assign slideUrl = Slide.SlideUrl.data />
179 <#assign dataMap = "" />
180
181 <#if slideUrl?has_content>
182
183 <#assign slideTitle = "${languageUtil.get(request, 'video')} ${Slide?index}" />
184 <#if Slide.SlideTitulo.data?has_content>
185 <#assign slideTitle = Slide.SlideTitulo.data />
186 </#if>
187
188 <#-- Youtube -->
189 <#assign slideUrl = stringUtil.replace(slideUrl, 'watch?v=', 'embed/') />
190 <#assign slideThumbnail2 = stringUtil.replace(slideUrl, 'www', 'img') />
191 <#assign slideThumbnail2 = stringUtil.replace(slideThumbnail2, 'embed', 'vi') />
192 <#assign slideThumbnail2 = '${slideThumbnail2}/mqdefault.jpg' />
193
194 <#-- Vimeo -->
195 <#if slideUrl?contains("vimeo")>
196 <#assign slideUrl = stringUtil.replace(slideUrl, 'http://vimeo.com/', 'https://player.vimeo.com/video/') />
197 <#assign slideVimeoId = stringUtil.extractLast(slideUrl, 'https://player.vimeo.com/video/') />
198 <#if slideVimeoId?has_content>
199 <#assign slideVimeoJsonPath = 'http://vimeo.com/api/v2/video/${slideVimeoId}.json' />
200 <#assign slideVimeoJsonContent = getUrlContent.getContent(slideVimeoJsonPath)! />
201 <#if slideVimeoJsonContent?has_content>
202 <#assign slideVimeoJsonArray = jsonFactoryUtil.createJSONArray(slideVimeoJsonContent) />
203 <#assign slideVimeoJsonItem = slideVimeoJsonArray.get(0) />
204 <#assign slideThumbnail2 = slideVimeoJsonItem.thumbnail_medium />
205 </#if>
206 </#if>
207 </#if>
208
209 <div id="slide-${Slide?index}" class="slide">
210 <a class="card card-simple card-video" href="#" onclick="javascript: event.preventDefault(); showDialogIframe('${slideUrl}', '${slideTitle}', 800, 600, 'videoPopup', 'videoPopupIframe');" title="${slideTitle}">
211 <span class="d-block image-wrapper aspect-ratio-bg-cover aspect-ratio-4-to-3" style="background-image: url('${slideThumbnail2}');">
212 <img class="hide-accessible" alt="${slideTitle}" src="${slideThumbnail2}">
213 </a>
214 </div>
215 <#else>
216
217 <#assign slideTitle = "${languageUtil.get(request, 'image')} ${Slide?index}" />
218 <#if Slide.SlideTitulo.data?has_content>
219 <#assign slideTitle = Slide.SlideTitulo.data />
220 </#if>
221
222 <div class="slide">
223 <a class="card card-simple lightbox" href="${slidePath}" title="${slideTitle}">
224 <span class="d-block image-wrapper aspect-ratio-bg-cover aspect-ratio-4-to-3" style="background-image: url('${slideThumbnail2}');">
225 <img class="hide-accessible" alt="${slideTitle}" src="${slideThumbnail2}">
226 </a>
227 </div>
228 </#if>
229 </#if>
230 </#list>
231 </div>
232 </#if>
233
234 <#if hasTab1>
235 <div id="tab1" class="article-section accordion-item">
236 <a href="#tabContent1" id="tabHeading1" class="h3 accordion-header <#if !showFirstTab>collapsed</#if>" aria-expanded="${getterUtil.getString(showFirstTab)}" data-toggle="liferay-collapse" aria-controls="tabContent1" role="button">
237 ${languageUtil.get(request,'map')}
238 </a>
239 <div id="tabContent1" class="article-section-content article-section-info accordion-collapse collapse <#if showFirstTab>show</#if>" aria-labelledby="tabHeading">
240 <script src="/o/turismo-asturias-theme/js/leaflet/leaflet.js"></script>
241 <script type="text/javascript">
242 var albergues = [];
243 <#assign countAlbergues = 0>
244 <#list placemarksAlberguesName as nameAlbergue>
245 <#assign xpath = saxReaderUtil.createXPath("//root:LookAt/ancestor::root:Placemark[root:name='${nameAlbergue.getText()}']/root:LookAt/root:latitude", "root", "http://www.opengis.net/kml/2.2")>
246 <#assign albergueLatitude = xpath.selectSingleNode(document)!>
247 <#assign xpath = saxReaderUtil.createXPath("//root:LookAt/ancestor::root:Placemark[root:name='${nameAlbergue.getText()}']/root:LookAt/root:longitude", "root", "http://www.opengis.net/kml/2.2")>
248 <#assign albergueLongitude = xpath.selectSingleNode(document)!>
249 <#assign xpath = saxReaderUtil.createXPath("//root:LookAt/ancestor::root:Placemark[root:name='${nameAlbergue.getText()}']/root:url", "root", "http://www.opengis.net/kml/2.2")>
250 <#assign albergueUrl = xpath.selectSingleNode(document)!>
251 <#assign xpath = saxReaderUtil.createXPath("//root:LookAt/ancestor::root:Placemark[root:name='${nameAlbergue.getText()}']/root:Point/root:coordinates", "root", "http://www.opengis.net/kml/2.2")>
252 <#assign albergueCoordinates = xpath.selectSingleNode(document)!>
253
254 var albergue${countAlbergues} = {};
255
256 <#if validator.isNotNull(nameAlbergue.getText())>
257 albergue${countAlbergues}.Nombre = '${nameAlbergue.getText()}';
258 </#if>
259 <#if validator.isNotNull(albergueUrl)>
260 albergue${countAlbergues}.Url = '${baseUrl}'+'/organiza-tu-viaje/donde-dormir/alojamiento/albergues/albergues-de-peregrinos/'+'${albergueUrl.getText()}';
261 </#if>
262 <#if validator.isNotNull(albergueCoordinates)>
263 albergue${countAlbergues}.Latitud = ${albergueCoordinates.getText()?split(",")[1]};
264 albergue${countAlbergues}.Longitud = ${albergueCoordinates.getText()?split(",")[0]};
265 </#if>
266 albergues.push(albergue${countAlbergues});
267
268 <#assign countAlbergues += 1>
269 </#list>
270
271 <#assign xpath = saxReaderUtil.createXPath("//root:StyleMap", "root", "http://www.opengis.net/kml/2.2")/>
272 <#assign style_maps = xpath.selectNodes(document)/>
273
274 var style_mapsJS = {};
275 var line_stylesJS = {};
276
277 <#list style_maps as style_map>
278 <#assign style_map_styleurl_path = "${style_map.getUniquePath()}/*[name()='Pair']/*[name()='styleUrl']"/>
279 <#assign style_map_styleurl_node = style_map.selectSingleNode(style_map_styleurl_path)/>
280 <#assign nodeText = style_map_styleurl_node.getText()/>
281 style_mapsJS['${style_map.selectSingleNode("${style_map.getUniquePath()}/@id").getText()}'] = '${nodeText?substring(1)}';
282 </#list>
283 <#assign xpath = saxReaderUtil.createXPath("//root:Style", "root", "http://www.opengis.net/kml/2.2")/>
284 <#assign line_styles = xpath.selectNodes(document)/>
285
286 <#list line_styles as line_style>
287 <#assign line_style_color_path = "${line_style.getUniquePath()}/*[name()='LineStyle']/*[name()='color']"/>
288 <#assign line_style_color_node = line_style.selectSingleNode(line_style_color_path)!/>
289 <#if validator.isNotNull(line_style_color_node)>
290 line_stylesJS['${line_style.selectSingleNode("${line_style.getUniquePath()}/@id").getText()}'] = {color: '#${line_style_color_node.getText()?substring(6,8)}${line_style_color_node.getText()?substring(4,6)}${line_style_color_node.getText()?substring(2,4)}', opacity: 0x${line_style_color_node.getText()?substring(0,2)}/0xFF};
291 </#if>
292 </#list>
293 </script>
294
295
296 <script type="text/javascript">
297 var route = {};//Ruta
298 var totalDistance = 0;
299 <#list placemarksName as name>
300
301 var nombreTramo = "${name.getText()}";
302 nombreTramo = nombreTramo.replace("Tramo ","");
303 nombreTramo = nombreTramo.replace(/[–]/gi,'-');
304 nombreTramo = nombreTramo.trim();
305
306
307 var tramo = {};//Datos del tramo
308 var coordinatesJS = [];//Coordenadas del tramo
309
310 <#-- Identificador color del Tramo -->
311 <#assign xpath = saxReaderUtil.createXPath("//root:LineString/ancestor::root:Placemark[root:name='${name.getText()}']/root:styleUrl", "root", "http://www.opengis.net/kml/2.2")/>
312 <#assign styleUrl = xpath.selectSingleNode(document)!>
313
314 <#-- Obtener los puntos de ruta para dibujarlos -->
315 <#assign xpath = saxReaderUtil.createXPath("//root:LineString/ancestor::root:Placemark[root:name='${name.getText()}']/root:LineString/root:coordinates", "root", "http://www.opengis.net/kml/2.2")/>
316 <#assign coordinates = xpath.selectSingleNode(document)!>
317 <#-- Hacemos un split para separar las coordenadas -->
318 <#assign arrayCoordinates = coordinates.getText()?split(" ")/>
319
320 <#list arrayCoordinates as coordinate>
321 <#assign splitCoordinates = coordinate?split(",")/>
322
323 <#if splitCoordinates?size gte 2>
324 coordinatesJS.push(new L.LatLng(${splitCoordinates[1]}, ${splitCoordinates[0]}));
325 <#if coordinate == arrayCoordinates[0]>
326 tramo['start'] = ${splitCoordinates[1]} +',' + ${splitCoordinates[0]};
327 </#if>
328 <#if coordinate == arrayCoordinates[arrayCoordinates?size -2]>
329 tramo['end'] = ${splitCoordinates[1]} +',' + ${splitCoordinates[0]};
330 </#if>
331 </#if>
332
333 </#list>
334
335 var distance = 0;
336 var previousPoint="";
337
338 tramo['name'] = nombreTramo;
339 tramo['lineStyle'] = line_stylesJS[style_mapsJS['${styleUrl.getText()?substring(1)}']];
340 tramo['coordinates'] = coordinatesJS;
341
342 coordinatesJS.forEach(function (latLng) {
343 if (previousPoint) {
344 distance += previousPoint.distanceTo(latLng);
345 }
346 previousPoint = latLng;
347 });
348
349 tramo['distance'] = (distance/1000).toFixed(1)/1;
350 totalDistance +=(distance/1000).toFixed(1)/1;
351
352
353 route['${counter}'] = tramo;
354
355 <#assign counter = counter +1/>
356 <#assign count = count +1/>
357
358 </#list>
359 </script>
360 <div class="article-section-content">
361 <div id="article-map-wrapper-${articleId}" class="article-map-wrapper">
362 <div id="article-map-content-${articleId}" style="width: 100%; height: 400px; z-index:1"><!-- MAP --></div>
363 <div class="article-map-form">
364 <div class="name important">${title}</div>
365 <div class="gps"><span class="label">GPS:</span> <span class="value important">${startLatitude}, ${startLongitude}</span></div>
366 <form action="https://maps.google.es/maps" method="get" target="_blank">
367 <input type="hidden" name="daddr" value="${startLatitude}, ${startLongitude}">
368 <label for="saddrText"><span class="label hide-accessible">${languageUtil.get(request,'infoasturias-insert-from')}: </span></label>
369 <label for="saddr"><span class="label">${languageUtil.get(request,'infoasturias-from')}: </span></label>
370 <input class="form-control" type="text" maxlength="40" name="saddrText" id="saddrText" value="" placeholder="${languageUtil.get(request,'infoasturias-insert-from')}">
371 <input class="form-control" type="hidden" name="saddr" id="saddr" value="" placeholder="${languageUtil.get(request,'infoasturias-insert-from')}">
372 <button class="btn btn-text" type="submit">${languageUtil.get(request,'infoasturias-como-llegar')} »</button>
373 </form>
374 </div>
375 </div>
376
377 <script type="text/javascript">
378 AUI().ready('aui-base', function(A){
379 var lookAt = new L.LatLng(${lookAtLatitude}, ${lookAtLongitude});//Cámara
380
381 const mapContent = new L.Map('article-map-content-${articleId}', { center: lookAt, zoom: 10 });
382 const osm = new L.TileLayer('http://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x}');
383
384
385 mapContent.addLayer(osm);
386
387 //definir iconos inicio y fin tramo
388 //definir iconos inicio y fin tramo
389 var startMarker;
390 var middleMarker;
391 var endMarker;
392 var colorSeries = ["e9ecef","E5E1D5","C6C0AD"];
393 var colorSeriesSelector = 0;
394
395 var endIconTheme = '/o/turismo-asturias-theme/images/icons/routes/Icono_Fin_Ruta_senderismo_min.png';
396 var endIcon = L.icon({
397 iconUrl: endIconTheme,
398 iconSize: [27, 35],
399 iconAnchor: [13, 35],
400 iconShadow: [0,0],
401 popupAnchor: [0, -30]
402 });
403 var middleIconTheme = '/o/turismo-asturias-theme/images/icons/routes/gmaps-marker-icon-grey.png';
404 var middleIcon = L.icon({
405 iconUrl: middleIconTheme,
406 iconSize: [20, 28],
407 iconAnchor: [10, 28],
408 iconShadow: [0,0],
409 popupAnchor: [0, -30]
410 });
411
412 var startIconTheme = '/o/turismo-asturias-theme/images/icons/routes/Icono_Inicio_Ruta_senderismo_min.png';
413 var startIcon = L.icon({
414 iconUrl: startIconTheme,
415 iconSize: [27, 35],
416 iconAnchor: [13, 35],
417 iconShadow: [0,0],
418 popupAnchor: [0, -30]
419 });
420
421
422 for (const ruta in route) {
423 var stretch = route[ruta];
424 var name = stretch.name;
425 var nameArray = name.split("-");
426 var coordinates = stretch.coordinates;
427 var distance =''+ stretch.distance;
428 var isStrechAlternative = stretch.isAlternative;
429 var lineStyle = stretch.lineStyle || { color: '#3c3be3', opacity: 1 };
430 var startCoordinates = stretch.start.split(",");
431 var endCoordinates = stretch.end.split(",");
432
433 var track_node = A.Node.create('<div class="route-resume-track ' + (ruta==1?'route-resume-track-first':'') + '"><a class="route-resume-track-link" href="#track-'+(ruta)+'"></a></div>');
434 var track_size = ((distance/totalDistance*100) + '%');
435 track_node.setStyles({width: track_size, backgroundColor: '#' + colorSeries[colorSeriesSelector]});
436 track_node.appendTo(A.one('.route-resume-tracks'));
437
438
439 if(distance){
440 A.one('.ruta-'+ ruta + ' .ruta-distance').text(distance.replace(".",",") + ' Km');
441 A.one('.template-etapa .route-distance').text(distance.replace(".",",") + ' Km');
442 }
443
444
445 if(Object.keys(route).length == 1){
446 A.one('.route-resume-track-marker-first .route-point-text').text(nameArray[0]);
447 A.one('.route-resume-track-marker-last .route-km-text').text('Km ' + distance.replace(".",","));
448 A.one('.route-resume-track-marker-last .route-point-text').text(nameArray[nameArray.length-1]);
449 startMarker = L.marker([startCoordinates[0],startCoordinates[1]], {icon: startIcon}).bindPopup(nameArray[0]).addTo(mapContent);
450 endMarker = L.marker([endCoordinates[0],endCoordinates[1]], {icon: endIcon}).bindPopup(nameArray[nameArray.length-1]).addTo(mapContent);
451 }
452
453 else{
454 var track_point =A.Node.create('<div class="route-resume-point"></div>');
455 if(ruta==1){
456 A.one('.route-resume-track-marker-first .route-point-text').text(nameArray[0]);
457 var track_point_text = A.Node.create('<div class="route-point-text">' + nameArray[nameArray.length-1] + '</div><div class="route-km-text">Km '+distance+'</div>');
458 startMarker = L.marker([startCoordinates[0],startCoordinates[1]], {icon: startIcon}).bindPopup(nameArray[0]).addTo(mapContent);
459 middleMarker = L.marker([endCoordinates[0],endCoordinates[1]], {icon: middleIcon}).bindPopup(nameArray[nameArray.length-1]).addTo(mapContent);
460
461 track_point_text.appendTo(track_point);
462 track_point.appendTo(A.one('.route-resume-tracks'));
463 }
464 else if(ruta == Object.keys(route).length){
465 A.one('.route-resume-track-marker-last .route-km-text').text('Km ' + distance.replace(".",","));
466 A.one('.route-resume-track-marker-last .route-point-text').text(nameArray[nameArray.length-1]);
467 endMarker = L.marker([endCoordinates[0],endCoordinates[1]], {icon: endIcon}).bindPopup(nameArray[nameArray.length-1]).addTo(mapContent);
468 }
469 else{
470 var track_point_text = A.Node.create('<div class="route-point-text">' + nameArray[nameArray.length-1] + '</div><div class="route-km-text">Km '+distance+'</div>');
471 track_point_text.appendTo(track_point);
472 track_point.appendTo(A.one('.route-resume-tracks'));
473 middleMarker = L.marker([startCoordinates[0],startCoordinates[1]], {icon: middleIcon}).bindPopup(nameArray[0]).addTo(mapContent);
474 }
475 }
476
477
478 var polyline = new L.Polyline(coordinates, {
479 color: '' + lineStyle.color,
480 opacity: lineStyle.opacity
481 });
482 polyline.bindPopup(name).addTo(mapContent);
483
484
485 colorSeriesSelector++;
486 if(colorSeriesSelector == 3)
487 colorSeriesSelector = 0;
488
489 }//fin rutas
490
491 //Contributor
492 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
493 attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.'
494 }).addTo(mapContent);
495
496 }); //AUI.ready
497 </script>
498 </div>
499
500 <#assign params = {
501 "displayStyle":"ddmTemplate_435797",
502 "portletId": portletTool.getPortletId(request),
503 "articleId":"${articleId}",
504 "dlFileEntryuuId":"${dlFileEntryKML.getUuid()}",
505 "stage":"true"
506 }>
507 <#assign portletURL = portletTool.createURL(request, "as_asac_adtvisor_portlet_AdtVisorDialogPortlet", themeDisplay.getPlid(), "RENDER_PHASE", "pop_up", params) />
508 <div class="button-row button-row-center my-3">
509 <button type="button" class="btn btn-primary btn-small text-center text-uppercase" onclick="event.preventDefault(); showDialogIframe('${portletURL}','${languageUtil.get(request,'profile')}', '800px', '','formularioReserva', 'formularioReservaIframe');">
510 ${languageUtil.get(request,'infoasturias-ver-perfil-elevacion')}
511 </button>
512 </div>
513 </div>
514
515 </div>
516 <#assign showFirstTab = false>
517 </#if>
518
519 <#if hasTab2>
520
521 <div id="tab2" class="article-section accordion-item">
522 <a href="#tabContent2" id="tabHeading2" class="h3 accordion-header <#if !showFirstTab>collapsed</#if>" aria-expanded="${getterUtil.getString(showFirstTab)}" data-toggle="liferay-collapse" aria-controls="tabContent2" role="button">
523 ${languageUtil.get(request,'info')} - ${title}
524 </a>
525 <div id="tabContent2" class="article-section-content article-section-color ruta-1 article-section-background accordion-collapse collapse <#if showFirstTab>show</#if>" aria-labelledby="tabHeading2">
526 <p class="info-route-tab">${title}
527 <#if Sumario.Distancia.data?has_content>
528 <span class="ruta-distance btn btn-secondary btn-thin float-right">
529 <#list Sumario.Distancia.getSiblings() as Item>
530 ${Item.data} Kms<#if Item_has_next>,</#if>
531 </#list>
532 </span>
533 </#if>
534 </p>
535 <#if Descripcion.data?has_content>
536 ${Descripcion.data}
537 </#if>
538 </div>
539 </div>
540
541 <#assign showFirstTab = false>
542 </#if>
543
544 </div>
545
546 </div>
547
548 <#-- Related -->
549 <#assign relatedJournalArticles = assetTool.getRelatedJournalArticlesApproved(assetEntry)/>
550 <#if validator.isNotNull(relatedJournalArticles) && relatedJournalArticles?size gt 0>
551 <div class="article-related portlet-background-grey-container">
552 <div class="container">
553 <h3 class="title-section">${languageUtil.get(request,'related-assets')}</h3>
554 <div class="slick article-related-slick">
555 <#list relatedJournalArticles as currentJournalArticle>
556 <#assign viewURL = journalTool.getDisplayPage(currentJournalArticle, themeDisplay, true)/>
557 <div class="slide">
558 <a class="card background card-background-9-14" href="${viewURL}" title="${languageUtil.format(request, 'go-to-x', currentJournalArticle.getTitle(locale))}">
559 <span class="d-block image-wrapper aspect-ratio-bg-cover" style="background-image: url('${currentJournalArticle.getSmallImageURL()}');">
560 <img class="hide-accessible" src="${currentJournalArticle.getSmallImageURL()}" alt="${currentJournalArticle.getTitle(locale)}">
561 <span class="card-body">
562 <span class="card-title">${currentJournalArticle.getTitle(locale)}</span>
563 </span>
564 </span>
565 </a>
566 </div>
567 </#list>
568 </div>
569 </div>
570 </div>
571 </#if>
572
573 <#-- Nearby -->
574 <#assign classTypeIds = []>
575 <#assign assetsNearJournalArticles = assetNearTool.getNearJournalArticles(themeDisplay.getScopeGroupId(), assetEntry.getEntryId(), 50.0, classTypeIds, 10)! />
576 <#if validator.isNotNull(assetsNearJournalArticles) && assetsNearJournalArticles?size gt 0>
577 <div class="article-nearby portlet-container-margin">
578 <div class="container">
579 <div class="article-nearby-container">
580 <h3 class="title-section">${languageUtil.get(request,'infoasturias-near-here')}</h3>
581 <div class="slick article-nearby-slick">
582 <#list assetsNearJournalArticles as currentJournalArticle>
583 <#assign viewURL = journalTool.getDisplayPage(currentJournalArticle, themeDisplay, true)/>
584 <div class="slide">
585 <a class="card" href="${viewURL}" title="${languageUtil.format(request, 'go-to-x', currentJournalArticle.getTitle(locale))}">
586 <span class="d-block image-wrapper aspect-ratio-bg-cover aspect-ratio-4-to-3" style="background-image: url('${currentJournalArticle.getSmallImageURL()}');">
587 <img class="hide-accessible" src="${currentJournalArticle.getSmallImageURL()}" alt="${currentJournalArticle.getTitle(locale)}">
588 <span class="card-hover">
589 <span class="card-text">${currentJournalArticle.getDescription(locale)}</span>
590 </span>
591 </span>
592 <span class="card-body">
593 <span class="card-title">${currentJournalArticle.getTitle(locale)}</span>
594 <span class="card-subtitle">
595 <span class="d-block">${currentJournalArticle.getVersion()} Kms</span>
596 <span class="d-block">${journalTool.getCategoriesNames(groupId, currentJournalArticle.getArticleId(), locale, ["Concejos"])}</span>
597 </span>
598 </span>
599 </a>
600 </div>
601 </#list>
602 </div>
603 </div>
604 </div>
605 </div>
606 </#if>
607</article>