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

136
Vistas
Applying polyline GeoJSON to mapbox static image

I am trying to encode my coordinates to create a path on a static image at mapbox but not having much luck. I've come across polyline for mapbox, which encodes the string. I have the code below for that, it looks to encode it well as trying the decode provides the same data as it was prior to encoding.

I am struggling to apply this encoded value into a static image URL. My example is below that I got from using the sandbox at mapbox.

    var try_pl = polyline.fromGeoJSON({ 
    "type": "Feature",
    "geometry": {
        "type": "LineString",
        "coordinates": [[-1.344579141588271,50.96578555186369],[-1.344579141588271,50.96578555186369],[-1.3445547502500421,50.965788778896744],[-1.3436562521836555,50.96578967441579],[-1.343292475905947,50.96593329647221],[-1.344480288502918,50.96570042912521],[-1.3456999094209814,50.96563188136548],[-1.3456999094209814,50.96563188136548],[-1.3462368893716565,50.96537412247744],[-1.34585878242166,50.965208840366074],[-1.344928928122842,50.96514265049426],[-1.3451180392346376,50.9650540524098],[-1.3451180392346376,50.9650540524098],[-1.34461917570763,50.96528627800269]]
    },
    "properties": {
        "stroke": "#dc3545",
        "stroke-width": 2
    }
});
console.log(try_pl);

Provides me with: egavHrreG???E?qD[iAl@lFLrF??r@jB^kALyDPd@??o@cB

Initially tried this with mapbox but failed.

https://api.mapbox.com/styles/v1/mapbox/streets-v11/static/path(egavHrreG???E?qD[iAl@lFLrF??r@jB^kALyDPd@??o@cB)/auto/300x200?access_token=[TOKEN]

Im wondering if possibly the issue is passing high accuracy coordinates might be the issue, to much for mapbox to handle?

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