Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

252
Views
Error: no se encontró el 'control' de exportación (importado como 'L') en '@raruto/leaflet-elevation' (el módulo no tiene exportaciones)

Tengo una aplicación angular y necesito usar el paquete de folleto personalizado: https://github.com/Raruto/leaflet-elevation

Estoy tratando de usar esto en mi aplicación. Lo instalo así:

npm i @raruto/prospecto-elevación

y luego en la parte superior de mi página lo importé así: import * as L from '@raruto/leaflet-elevation';

 this.map = L.map("map").setView([0.0, 0.0], 1); let googleRoadMap = L.gridLayer.googleMutant({ type: 'roadmap' }); googleRoadMap.addTo(this.map); L.control.elevation(elevation_options).addTo(this.map);

Sin embargo me sale el siguiente error:

 Error: export 'control' (imported as 'L') was not found in '@raruto/leaflet-elevation' (module has no exports) Error: export 'map' (imported as 'L') was not found in '@raruto/leaflet-elevation' (module has no exports) Error: export 'gridLayer' (imported as 'L') was not found in '@raruto/leaflet-elevation' (module has no exports) Error: export 'control' (imported as 'L') was not found in '@raruto/leaflet-elevation' (module has no exports)

Soy nuevo en JS y Angular, etc. Vengo de PHP :) Me pregunto cómo resolver esto.

Gracias

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

La parte de import * as L es para la biblioteca base del folleto.

Luego, dependiendo del complemento, generalmente solo tiene que importarlo para efectos secundarios, o puede que también tenga que importar un objeto explícito.

En el caso del @raruto/leaflet-elevation , parece que es el caso anterior, así que solo tienes que hacer:

 import * as L from "leaflet"; import "@raruto/leaflet-elevation"; this.map = L.map("map").setView([0.0, 0.0], 1); L.control.elevation(elevation_options).addTo(this.map); // TS will warn here

Desafortunadamente, parece que no hay una definición de TypeScript disponible para este @raruto/leaflet-elevation . Entonces TS no sabrá qué es L.control.elevation . Puede usar una solución rápida y sucia:

 (L.control as any).elevation(/* etc. */);

Consulte https://github.com/ghybs/Leaflet.TileLayer.Fallback/issues/11 para obtener más detalles y opciones.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!