Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

143
Visualizações
API wont render?

I am using mapbox to create a style & generate a key for an air bnb clone. Top right, click share (if you follow the link) is where you can get the data such as access token and style. But the darn thing wont render. It's got me puzzled.

website

full repo - the main files of concern are pages>search.js , components>Map.js & next.config.js

The particular section of code that "should" execute the code are as followed.

//Search.js page

<section className="hidden xl:inline-flex xl:min-w-[700px]">
   <Map searchResults={searchResults}/>
</section>

//Map.js

const [viewport, setViewport] = useState({
        width: '100%',
        height: '100%',
        latitude: center.latitude,
        longitude: center.longitude,
        zoom: 8
      });

    return <ReactMapGL
        mapStyle="mapbox://styles/aman-janwani/cks0lbl27149917pd1q6fvduq"
        mapboxApiAccessToken={process.env.mapbox_key}
        {...viewport}
        onViewportChange={(nextViewport) => setViewport(nextViewport)}
    >
        {searchResults.map(result => (
            <div key={result.long}>
                <Marker
                    longitude={result.long}
                    latitude={result.lat}
                    offsetLeft={-20}
                    offsetTop={-10}
                >
                    <p 
                        role="img" 
                        onClick={() => setSelectedLocation(result)} 
                        className='cursor-pointer text-2xl animate-bounce'
                        aria-label="push-pin"
                        >
                        📌
                    </p>

                </Marker>
             </div>

//next.config.js

module.exports = {
images: {
    domains: ['links.papareact.com'],
},
env: {
    mapbox_key:
      "pk.eyJ1IjoiYW1hbi1qYW53YW5pIiwiYSI6ImNrczBpM2gxbTFrcm8ydXFqamtybzJtYW8ifQ.EcMfJu_XkFN2RMfGUvX8zw"
  }
};
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda