Questions tagged [ajax]

An acronym for asynchronous JavaScript and XML. It is a group of interrelated web development techniques used on the client-side to create asynchronous web applications.

Filter by
Sorted by
Tagged with
0
votes
0answers
20 views

Leaflet only allows polygon layer from GeoJSON to be displayed one time

I have used an AJAX call to load a Black Sea GeoJSON that I want to display as a polygon on the map. var blackSea = []; var blackSeaData = new L.GeoJSON.AJAX("./blacksea.json"); blackSea....
1
vote
0answers
22 views

Leaflet, Rails 6 and Ajax. Simple marker rendering. Code review requested [migrated]

i am trying to render in a leaflet map that should render a single marker. I am building the JavaScript as follows. build the map, an even listener for when the user opens the page where the map is ...
1
vote
1answer
27 views

How to tie an ArcGIS Server QueryTask result back to the calling layer?

Using ArcGIS Server JS API 4.x I'm running a series of QueryTasks in succession, and need to tie the result of the query back to the calling layer. However, since the QueryTasks execute asynchronously ...
0
votes
1answer
32 views

Popup filling with AJAX?

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 ...
0
votes
1answer
53 views

Error adding layer to control on web map using Leaflet

I want to add GeoJSON data to my map, but get an error: Uncaught TypeError: Cannot read property 'setZIndex' of undefined $.ajax({ url:'load.php', type:'POST', data:{state:"",lga:"",raw:""}, ...
0
votes
1answer
47 views

WFS layer from GeoServer with OL4 - String index out of range error

I need to load a WFS layer from GeoServer 2.8 to a web app using OpenLayers 4.6.5 and JQuery 2.2.3 so that I can use Select to highlight a feature on click. I can preview the line layer as a WMS with ...
3
votes
1answer
102 views

Why doesn't Leaflet have cross-origin error when adding WMS layer from GeoServer, but GetFeatureInfo using ajax does

I am learning web mapping with Leaflet. I added a WMS layer and now I'm trying to get feature details using ajax to send getFeatureInfo request. I'm not finished yet, and right now I just want to log ...
1
vote
0answers
52 views

Prevent results of GetGeometry from disappearing after AJAX call

In my ongoing mission to try to find a way to zoom into a specific area of a map (in this case a DMA), I am first trying to get the coordinates of a selected point that will be accessible to me for ...
1
vote
2answers
131 views

Leaflet Feature bindpopup does not display (OnEachFeature)

I am attempting to have a click event popup with some data pulled from Wikipedia and displayed on my Leaflet map for each point that displays GeoJSON data. My data is displayed on map as you can see ...
1
vote
1answer
1k views

Heatmap with GeoJSON, Leaflet and Leaflet.heat plugin

I'm using the Leaflet.heat plugin to create an heatmap in Leaflet. I've some problem with GeoJSON data that I've loaded through a WFS service on GeoServer. I used the function geojson2heat to get the ...
1
vote
0answers
33 views

ajax don't retrieve fully php request response

I'm facing challenge with ajax response in my code: // ********* PHP code (LoadData.php) **************** <?php include 'Connexion.php'; $requete="SELECT id, pkuid, province, nom, prenom, tel, ...
0
votes
0answers
707 views

curl REST API to AJAX

I'm trying to make a web application that is able to : 1) Upload raster data to GeoServer so when I use this command on cmd it works curl -u admin:geoserver -v -XPUT -H "Content-type: image/tiff" --...
3
votes
0answers
121 views

Displaying QGIS's “Map Tips” in OpenLayers?

Still a little new to QGIS and Openlayers. How would you display QGIS's "Map Tips" into OpenLayers? I am currently using QGIS 2.18 and have the latest update in Openlayers. In QGIS, I have created a ...
2
votes
1answer
399 views

Show points (layer) from PostgreSQL database on OpenLayers map

I have this code, I want to load a collection of points stored in a table in PostgreSQL database, I retreive the GeoJSON format succesfully, but the points never show up on the map! The three files ...
0
votes
1answer
280 views

Showing GeoJSON result on Google Maps [closed]

I have some points result query in MySQL database which is GeoJSON and I want to show these points on a Google map. I need to get this result with AJAX and deliver them to Google Maps. Can anybody ...
1
vote
1answer
130 views

Leaflet put coordinates of every point in array

I get points using GeoJSON.AJAX and I want to store coordinates in array to pass it later to function that builds routes between points. Now I use this code <script> function our_layers(map)...
0
votes
0answers
433 views

Pushing features to external GeoJSON file

I am working on a project which uses Leaflet and leaflet.draw to show and draw shapes on the map. I also have a data.json file which I use to display former features generated from geojson.io. What I ...
0
votes
1answer
70 views

Searches by area names in OpenLayers with request of AJAX in the PostGIS database

We built a GeoJSON: {"type":"FeatureCollection","features":[{"type":"Feature","id":0,"geometry":{"type":"Polygon","coordinates":[[[669023.843,415221.025],[669031.588,415222.415],[669059.365,415154....
1
vote
1answer
574 views

Load data from URL to update Billboard position Cesium

I am trying to update the position of a billboard every second in Cesium. The issue is I cannot pass the updating points to the billboard coordinates. I am using jQuery to load the data. This is what ...
0
votes
0answers
240 views

View GeoJSON data after clicking on the OpenLayers map

I'm trying to make a piece of code that when I click on the map to return GeoJSON property data that I clicked on. I tried this way: map.on('click', function(e){ //console.log(evt); //...
0
votes
1answer
117 views

Request a Ajax with GET to remove one or more geometries in OpenLayers

I have a html selection of the form: <table class="table"> <tr> <td> <label>Afiseaza:</label><br /> <select id="layer" onchange=...
0
votes
0answers
175 views

Leaflet custom icons and popups showing GeoJSON properties with external data?

How can both custom icons and geojson properties be implemented with external geojson in Leaflet? Using methods described in answers to two other questions, both using inline geoJSON: Using custom ...
1
vote
2answers
314 views

Executing functions after multiple data sources have been loaded in Leaflet AJAX

I have a leaflet map that takes in data from multiple sources via the LeafLet Ajax plugin. I want to execute certain functions only after ALL the data has been loaded, not just one layer. The data ...
0
votes
2answers
886 views

Displaying GeoJSON using Ajax and Leaflet?

I have been trying for days to load a GeoJSON file using Ajax and Leaflet. I can get the map & index.html to load using an Apache server and such but the GeoJSON itself does not show up. Here is ...
0
votes
1answer
40 views

Why is this happening? I show GeoJSON some coordinates with OpenLayers by request Ajax

I want to display a GeoJSON on OpenLayers with a request from Ajax from the database: I store in the geojson variable all the information and I icercated in two ways: 1. Directly from the already ...
0
votes
2answers
2k views

Get GeoJSON from a database by the AJAX method for OpenLayers

I have this code: if (ol.proj.proj4 && ol.proj.proj4.register) { ol.proj.proj4.register(proj4); } var features = new ol.format.GeoJSON().readFeatures( $.ajax({...
1
vote
2answers
395 views

Uncaught SyntaxError: Unexpected token < (Geoserver popup in leaflet using ajax)

I am trying to show attribute information of features in a popup from my postGIS db tables via Geoserver WMS. I have successfully been able to add these layers to the map. However, when I try to grab ...
1
vote
1answer
649 views

FitBounds after L.GeoJSON.AJAX has loaded

I am making a Leaflet 1.3.4 map that will show members based on category. I have a php file "cs.php" that queries a MySQL and returns an option menu of distinct categories. When a category is selected ...
1
vote
0answers
701 views

How to update the markers in real-time using ajax

I am facing some problem where the markers is not being updated when the values in the database changes(i am using a stored procedure which get the latest location based on the timestamp). ...
1
vote
2answers
286 views

Different Icon per feature with Leaflet Ajax

How can I have a circle marker or one of a selection of icons depending on a feature's properties using LeafletAjax? https://github.com/calvinmetcalf/leaflet-ajax function pointToLayer(feature, ...
1
vote
1answer
1k views

How can I show a popup in a map, using Leaflet?

How can I show a popup in a map, using Leaflet, loading the markers from an GeoJSON external file? function onEachFeature(feature, layer) { if (feature.properties && feature.properties....
1
vote
1answer
967 views

Displaying geojson polygon in leaflet imported with ajax

I'm having difficulty displaying a simple polygon in leaflet. I'm unsure if my syntax is bad or if I'm importing the geojson incorrectly. I'm using the ajax plugin from calvinmetcalf and add the js ...
1
vote
2answers
324 views

How to import a WFS layer using leaflet.ajax and qgis server?

I try to create a story map using the application developed by Jakob Zhao https://github.com/jakobzhao/storymap. For import WFS layer, with leaflet.ajax, he write : var layers = { 'layer 2': [ L....
0
votes
1answer
817 views

input data coordinates to database from input data inside leaflet js

i have a problem with my update data coordinates form leaflet popup. i just want to make edit form inside leaflet popup. if i click marker in a map it shown coordinate with input form, if the building ...
1
vote
0answers
812 views

Response not working in AJAX/PHP

I am working on Google Maps API, where I have made a dynamic marker popup. Now I want to take the user information from the popup and save it to my MySQL database without reloading the page. So I am ...
0
votes
1answer
2k views

Leaflet create marker from ajax call data

Get all the basic works with Leaflet and want to add markers using ajax call $("button").click(function(){ $.get("GetLocationsServlet", function(data){ markers = data.split(";"); ...
1
vote
3answers
3k views

CORS error when using Google Elevation API

I'm trying to use Google elevation API with an AJAX request. It doesn't work and when I do console.log(ajax.responseText) I'm getting this error : Cross-Origin Request Blocking: The Same Origin ...
2
votes
1answer
2k views

Reading geojson into Leaflet results in error?

I'm trying to read a geojson file into leaflet. Everything works out when I copy the text from the geojson file and paste it into var data = { } So I think the file should be ok for leaflet. But I ...
0
votes
0answers
126 views

Using WMSGetFeatureInfo() of OpenLayers in Firefox?

I'm trying to read features from the response of an AJAX request using new ol.format.WMSGetFeatureInfo().readFeatures(parameter).The response format is application/vnd.ogc.gml (XML). The thing is that ...
1
vote
1answer
944 views

How to cluster external geojson (using leaflet.ajax.js)?

Understand the method of marker clustering but unable to find the right solution for external geojson. I have tried various cluster plugins but nothing seems to work. See example map here. var ...
0
votes
1answer
4k views

L.geoJson() - Error: Bounds are not valid

I am iterating through an array of zipcodes and passing each to Mapbox Geocoding API. With every iteration, on success, I pass to L.geojson(). After the last iteration I call map.fitBounds(jsonLayer)....
1
vote
1answer
1k views

Getting WFS data from Geoserver

I found an upload example to load WFS data from geoserver into a GeoJson layer in leaflet. I I adapted it to my case. I have read similar topics from this site and this other site, but I can not ...
0
votes
1answer
730 views

Ajax file url inside flask app

My ajax request for a geojson works fine as a static web app $.getJSON("myfile.geojson", function (data) { theaters.addData(data); map.addLayer(theaterLayer); }); I am trying to wrap the ...
3
votes
1answer
1k views

Geoserver Printing Module | MapFish print service won't print

I followed this documentation to use the printing service in geoserver. I want to print the map layer in pdf format. Below is my index.html for displaying the map and a button to print the map, ...
1
vote
0answers
448 views

Openlayers, add new ol.layer.Tile after AJAX 'done'

I'm trying to add an additional ol.layer.tile on my existing map view after a 'status' 'done' Ajax post call. I have tried to use "async" and "await" on initialize the ol.map. A sample code is below: ...
0
votes
1answer
715 views

Adding a drawn layer to a layer group dynamically

I am trying to save a layer drawn using OpenLayers 3.9 and add it to the map and list it using ol3-layerswitcher. The layer is being saved and can be accessed through the GeoServer using WMS. ...
0
votes
2answers
2k views

Create a table from GeoJSON Data from Ajax link - Using Leaflet Javascript

I have an ajax link getting data from GeoServer. When a user selects features on a map, a new bounding box is calculate and sent via Ajax to GeoServer and the features within that bounding box are ...
3
votes
1answer
1k views

Wait until geoJSON ajax call completed

I use the codes below to make an ajax call requesting points and show it on the map: var layer_kos = new L.GeoJSON.AJAX("<?php echo base_url('assets/GIS/layer/request_kos.php');?>",{ ...
5
votes
1answer
1k views

Add multiple WFS layers to Leaflet map from GeoServer using JQuery Ajax calls

I am attempting to add multiple WFS layers from GeoServer into a Leaflet map using JQuery ajax calls. It works if I set async: false, but this is deprecated and should not be used. If I remove async:...
1
vote
0answers
495 views

How to send data parameter on leaflet-ajax

i have a problem about sending data parameter to leaflet ajax, i'm using https://github.com/calvinmetcalf/leaflet-ajax anyone know how to send data parameter ? i have reading documentation but did't ...