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

191
Visualizações
Leaflet : how can I set negative lat and lon?

I made a map for my Minetest Game I play.

The project is here : https://github.com/amelaye/aiwMapping I created the map with the Python script gdal2tiles, like this : ./gdal2tiles.py -l -p raster -z 0-10 -w none ../map.png ../tiles

Here is the interesting part of code :

        var minZoom = 0
        var maxZoom = 9
        var img = [
            20000, // original width of image
            20000  // original height of image
        ]

        // create the map
        var map = L.map(mapid, {
            minZoom: minZoom,
            maxZoom: maxZoom
        })

        var rc = new L.RasterCoords(map, img)
        map.setView(rc.unproject([9000, 10554]), 7)
        L.control.layers({
            'Spawn': layerGeoGlobal(window.geoInfoSpawn, map, rc, 'red', 'star', 'fa'),
        }, {
            'Bounds': layerBounds(map, rc, img),
        }).addTo(map)

        L.tileLayer('./tiles/{z}/{x}/{y}.png', {
            noWrap: true,
            attribution: ''
        }).addTo(map)

It works like a charm, but there is a problem : in Minetest, the coords (lat and lon) go to -10000 to 10000. In my Leaflet map, the coords still positive, then they go from 0 to 20000.

How can I solve this problem ?

CRS SIMPLE does not work.

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