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

226
Vistas
How to add Markes to a Leaflet-map with coordinates from Supabase database?

I want to add some Markers from coordinates stored in a supabase database colomn.

Here is my vue code:

<l-marker v-for="(marker, index) in markers" :key="index" ref="markersRef" :lat-lng="marker.position"></l-marker>

I'm script:

  export default {
   async created() {
    const { data: events, error } = await this.$supabase
     .from('events')
     .select('coordinates')
    this.markers = events
    this.loaded = true
    console.log(this.markers)
    
   },
  data: () => ({
   markers: [],
  }),
 }

If I output markes, the result is:

[
   { "coordinates": "lat: 59.339025, lng: 18.065818" },
   { "coordinates": "lat: 59.923043, lng: 10.752839" }
] 

the error is: "latlng is Null"

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Your problem is the Vue reactivity system itself.

Vue can't recognize your new markers after fetching them. You can read about it here in the Vue documentation.

Just use Vue.set or .splice

// Vue.set
Vue.set(this.markes, indexOfItem, newValue)

// Array.prototype.splice
this.markes.splice(indexOfItem, 1, newValue)
about 4 years ago · Juan Pablo Isaza Denunciar
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