TransWikia.com

Popup filling with AJAX?

Geographic Information Systems Asked by Suka on May 13, 2021

Is there a solution to fill a popup with content getting from a AJAX call, without JQuery in OpenLayers 5?

The content is in *.txt files, or I can handle it to send the content as a JSON or HTML via PHP script. I searched for a solution to send all the data for all the popups not by the first web page call, but only when a popup is opened.

My code:

var feature = new ol.Feature({
    type: 'click',
    desc: popupcontentstring,
    geometry: new ol.geom.Point(ol.proj.fromLonLat(coordarray_coord))
});
feature.setStyle(style);
sourceVector.addFeature(feature);
}

popupcontentstring is the variable with the content for the popup. That I will replace with a AJAX request.

One Answer

Answered by Suka on May 13, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP