Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

250
Views
Cómo obtener datos del geoservidor WFS en capas abiertas

Tengo algunos puntos con sus datos provenientes de postgis a geoserver, luego agregué estos puntos a mi mapa pero necesito mostrar su información cuando hago clic en ellos.

 const approvedUsers = new ol.layer.Vector({ title: 'Usuarios encuestados', source: new ol.source.Vector({ format: new ol.format.GeoJSON(), url: function (extent) { return ( 'https://know.ncn.pe/geoserver/wfs?service=WFS&' + 'version=1.1.0&request=GetFeature&typename=approvedUser&' + 'outputFormat=application/json&srsname=EPSG:3857&' + 'bbox=' + extent.join(',') + ',EPSG:3857' ); }, strategy: ol.loadingstrategy.bbox, }), style: new ol.style.Style({ image: new ol.style.Icon({ anchor: [0.5, 0.5], size: [28, 19], offset: [1, 1], scale: 1, src: 'assets/img/approvedUser.png', }), }), });

trató de obtener datos como este:

 let clickeado = new ol.interaction.Select(); map.addInteraction(clickeado); map.on('singleclick',function(e){ approvedUsers.once('precompose',function(e){ let seleccionado = clickeado.getFeatures(); readFeatures(seleccionado); }); function readFeatures(features){ let dataFromWMS = features.item(0); console.log(dataFromWMS.get('construido')); } });

Estos son los datos que tengo en geoserver pointa_in_geoserver

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Creo que esto podría ser útil para usted!

 0 fetch('yourUrl', { method: 'POST', body: new XMLSerializer().serializeToString(featureRequest), }).then(response => response.json())

fetch('yourUrl', { método: 'POST', cuerpo: nuevo XMLSerializer().serializeToString(featureRequest),

 }).then(response => response.json())
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!