Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

324
Vistas
How to display a picture using Fluid (ViewHelper) from a JavaScript-file in TYPO3

I created a own extension for an interactiv map using leaflet. But I can't display my picture for a map:

enter image description here

I've already uploaded a picture in backend: enter image description here

setup.typoscript:

tt_content {
   interaktivekarte_karteuser =< lib.contentElement
   interaktivekarte_karteuser {
      templateName = Map
      dataProcessing {
         40 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
         40 {
            references.fieldName = tx_interaktiveKarte_image
            as = image
         }
      }
   }
}

Map.html:

<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
<f:layout name="Default" />
<f:section name="content">
    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin="" />
    <script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js" integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA==" crossorigin=""></script>
    
    <div class="tx-interaktive-karte">      
      <div id="map">
        
      </div>
    </div>
  
</f:section>
</html>

park.js:

var map = L.map('map', {crs: L.CRS.Simple});
var bounds = [[0,0], [750,1200]];
L.imageOverlay('../Parks/Park.png', bounds).addTo(map);
map.fitBounds(bounds); 

To check I wrote this fluid in Map.html:

<f:for each="{image}" as="fileReference">
  <f:image class="img-fluid" image="{fileReference}"/>
</f:for>

If I wrote the fluid above in Map.html, a picture is displayed. But outside of leaflet! I want to display the picture in leaflet...

How can I write in HTML- and JavaScript-file to display a picture in leaflet?

(And do I have to use fluid in any case? A picture-data is in my extension. Can I just render it in javascript-file?)

Thank you for your help.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

What about?

HTML:

<div id="map" data-image="{image.0.publicUrl}">

</div>

JS:

var map = L.map('map', {crs: L.CRS.Simple});
var bounds = [[0,0], [750,1200]];
var imageUrl = $('#map').data('image');
L.imageOverlay(imageUrl, bounds).addTo(map);
map.fitBounds(bounds); 
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda