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

222
Vistas
How can I improve performance of my OpenLayers map?

I have a world map and when you zoom in you can see provinces of cities. Some cities and/or provinces, based on a criteria, are colored different.

I found two geojson maps, one includes countries and the other includes provinces. Currently, I have the following code to create my maps:

  this.WorldMapSource = new VectorSource({
    format: new GeoJSON(),
    url: this.WorldMapData
  });

  this.ProvinceMapSource = new VectorSource({
    format: new GeoJSON(),
    url: this.ProvinceMapData
  })

  this.WorldMapView = new View({
    center: [0, 0],
    zoom: 2,
    minZoom: 1,
    maxZoom: 10
  });

  this.WorldMap = new Map({
    renderer: 'webgl',
    target: 'world-map',
    layers: [
      new VectorImageLayer({
        source: this.WorldMapSource,
        style: this.fillWorldMap,
        minZoom: 1,
        maxZoom: 7
      }),
      new VectorImageLayer({
        source: this.ProvinceMapSource,
        style: this.fillCountryMap,
        minZoom: 6,
        maxZoom: 999
      })
    ],
    view: this.WorldMapView
  });

Btw, I am using Vue, if that helps somehow.

But when I zoom in/out or simply drag the map, it freezes for a moment and I see some blank areas. Is there a workaround for this?

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