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

187
Vistas
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 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