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

160
Views
React-Leaflet agregando un letrero en el centro del mapa

Agrego un letrero en el mapa que muestra el centro.

 <MapContainer fullscreenControl={true} center={center} zoom={18} maxNativeZoom = {22} maxZoom={22} className={"sign-of-center-of-map"}>
 .sign-of-center-of-map:before { position: absolute; content: "\271B"; z-index: 800; display: flex; justify-content: center; align-items: center; width: 100%; height: 100%; font-size: 3rem; opacity: 0.7; }

Pero cuando hago eso, no se puede hacer clic en las capas del mapa. Cambié el índice z de las capas, pero esto no resolvió el problema. ¿Debo agregar algo a CSS o usar un método diferente?

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

0

Debería usar un método mejor para llegar a esta función, React-leaflet tiene una función Control que puede agregar lo que quiera a su mapa

Por ejemplo:

 import L from "leaflet"; createDivControl() { const MapHelp = L.Control.extend({ onAdd: (map) => { const signOfCenterOfMap = L.DomUtil.create("div", ""); this.signOfCenterOfMap = signOfCenterOfMap; // set the inner content from the props signOfCenterOfMap.innerHTML = this.props.title; // it can be your icon // return the div return signOfCenterOfMap; } }); return new MapHelp({ position: "bottomright" })} // 'bottomleft','bottomright', ...

En este ejemplo, debe establecer la posición de su div

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!