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.
119
questions
1
vote
1
answer
25k
views
Waiting on AJAX result in main JS function
So .... my main init()Javascript function has these 3 lines:
sarea = GetArea(Uname,UIDfield,Table, document.getElementById("Source").value);
darea = GetArea(Uname,UIDfield,Table, document....
-2
votes
1
answer
113
views
How to use AJAX request to filter WFS data?
I want to create a mash-up that shows sites in Italy on a basemap. With the AJAX call I want to include the number of earthquakes within a certain distance to each site. I want to use the AJAX call ...
3
votes
1
answer
122
views
AJAX calls for leaflet
I want to create a mash-up showing sites on a basemap as I did in the first part of my code. With the AJAX call I want to include earthquakes so that the pop-up of each site shows its name However, I ...
1
vote
1
answer
352
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 ...
0
votes
0
answers
29
views
Posting id to layer's SQL using laravel (ajax)
I have done the following step to post my id
function sendRequestToGeoServerWithId(numericId) {
var cqlFilter = "id=" + numericId; // Replace 'id' with the actual attribute name
var ...
0
votes
0
answers
140
views
map.getView().fit(vectorLayer.getSource().getExtent(), map.getSize()); is not working
I would like to know how to get all multipolygon features i.e all districts features display on my web map when I select state from dropdown list.
This is the query i wrote to get all districts ...
0
votes
1
answer
91
views
Leaflet.markercluster with GeoJSON via AJAX [closed]
I am pretty new to this. Have found a similar question here but I have been unable to implement it in my own case. The markers show up just fine but no clustering happens.
function onEachFeature(...
2
votes
1
answer
6k
views
Request WFS from GeoServer with Jquery AJAX using INTERSECT cql_filter error
I am trying to make an AJAX request from a Leaflet map with Jquery to GeoServer to return a WFS selection using the INTERSECT sql_filter param. I have it working fine using the BBOX sql_filter.
...
1
vote
0
answers
134
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, ...
2
votes
1
answer
293
views
Creating Proportional Symbols with Leaflet
After converting the data in this table to geojson, I want to present it on the map by sizing it according to the "y_2021" values, but I get many errors like in the picture. Can you help me ...
0
votes
0
answers
138
views
Problems with connection GeoServer - AJAX in web map code
I'm trying to create a WFS connection to show a layer in a Leaflet map, but the layer isn't uploading. I supposedly have correctly employed the code (I've been testing the code with another GeoServer ...
0
votes
1
answer
180
views
Can't get OpenLayers vector layer to display (loaded by AJAX)
I can't get the vector layer (loaded by AJAX to display). Spot my error?
I confirmed the GeoJSON returned by the server is correct.
var vectorLayer;
function showMap() {
var fill = new ol.style....
2
votes
1
answer
486
views
Multiple WFS layers in Leaflet, loaded with Ajax with bounding box, do not display correctly
The following example is a code for three WFS layers on Leaflet, loading only inside a Bounding box in order to save resources.
Layers can be turned on in the Layer Control as featurelayer1, ...
0
votes
1
answer
941
views
Converting from esoteric coordinate systems to EPSG:4326 WGS 84
I have a shapefile with coordinates in the "EPSG:3081 NAD83 / Texas State Mapping System" coordinate system. I'd like to be able to convert these to EPSG:4326 WGS 84 and it's not clear how.
...
3
votes
2
answers
355
views
"Unsupported GeoJSON type" from AJAX request to PostGIS database
I'm trying to use a GeoJSON to build a layer on an OpenLayers map of MultiPolygons from my PostGIS database.
However the following error is thrown:
Uncaught Error: Unsupported GeoJSON type: undefined
...
1
vote
1
answer
446
views
Problem with put sld in geoserver
I want to send SLD to GeoServer via AJAX:
this is my SLD as XML format:
<?xml version='1.0' encoding='UTF-8'?>
<StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://...
0
votes
1
answer
378
views
Dynamically adding lat, lon filter to WFS request in Leaflet
I want to run my wfs_url for all the points/cities returned by:-https://demo.pygeoapi.io/master/collections/ogr_gpkg_poi/items?f=json request? such that my result will show the no of earthquake data ...
0
votes
2
answers
5k
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(
...
0
votes
1
answer
60
views
Changing title of app [closed]
We have a map with streets as basemap.
We have been trying unsuccessfully, for the last two days to change the basemap to tiled layer with no success at all.
I am posting a snippet because script is ...
0
votes
0
answers
328
views
AJAX Request (Point Feature, Format GML) with fetch API from WFS failed
I work with OpenLayers 6.9.0. Individual polygon and point features are displayed on the map with a GetFeature request via WFS. The WFS delivers GML, no GeoJSON. Points and polygons come from the same ...
1
vote
1
answer
1k
views
Uncaught Error: Unsupported GeoJSON type: undefined - Openlayers
I get a valid geojson from the database using a query. Below one is the php script used to read the data.
<?php
include "../includes/init.php"; // including data base connection
$sql = &...
0
votes
0
answers
44
views
Resolve CORS policy error while fetching layer name from GeoServer using AJAX [duplicate]
I want to fetch all the layer names from GeoServer using AJAX and append the data in the HTML dropdown. I used xampp server and file in .php extension, Here is my code :
HTML code :
<label for=&...
0
votes
1
answer
168
views
General JavaScript function handling popups of various JSON layers in a Leaflet map
I have a couple of JSON layers added to my Leaflet map via the leaflet-ajax plugin.
lyrBldgs = new L.GeoJSON.AJAX('data/bldgs.geojson', {style:stlBldgs, onEachFeature:popOSM}).addTo(mymap)
lyrLanduse =...
0
votes
2
answers
3k
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:""},
...
1
vote
0
answers
259
views
Google Reverse Geocoding API doesn't work on mobile internet
I was able to get Google Geolocations and Geocoder API to work via desktop and on my phone when its connected to wifi, but when I disconnect from the wifi, geocoder doesn't display the results.
just ...
2
votes
1
answer
743
views
BBox and GetFeature
I have connected my PostGIS data to GeoServer and I want to GetFeature with a OpenLayers user created BBox. I have implemented a BBox to my app like this:
var select = new ol.interaction.Select();
map....
2
votes
4
answers
2k
views
Leaflet is behaving unexpectedly when trying to load more than one layer
I had a hard time trying to create a good title for my issue since it is a little hard to explain. But I will do my best.
I'm trying to create a web map to show three distinct layers, each from a ...
1
vote
2
answers
1k
views
Popup for each feature when using Leaflet marker.cluster plugin
I have leaflet map to display locations of points. Firstly, I use leaflet.ajax plugin to load the points data in GeoJSON format, then I want to enable cluster view using the Leaflet.markercluster ...
-1
votes
1
answer
182
views
Bind selected (Algolia suggested) with queried wordpress search terms from db (ajax, json etc)
Since the Wordpress plugin that facilitates this functionality has been deprecated i have decided to leverage the places API https://community.algolia.com/places/examples.html#searching-in-a-country ...
0
votes
0
answers
477
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
1
answer
252
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 ...
3
votes
1
answer
3k
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
0
answers
231
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
2
answers
2k
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 ...
2
votes
1
answer
4k
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 ...
0
votes
0
answers
1k
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
0
answers
392
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
1
answer
5k
views
Adding multiple OpenLayers Vector Layer markers to map using AJAX, JSON, and jQuery?
I am attempting to parse a JSON file and place markers on an OpenLayers based map application. I am using jQuery to perform the AJAX and iteration on the JSON file.
I am having a problem with the ...
2
votes
1
answer
2k
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
1
answer
1k
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
2
answers
620
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
1
answer
878
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)...
1
vote
2
answers
1k
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 ...
0
votes
0
answers
949
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
1
answer
196
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
1
answer
2k
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 ...
2
votes
3
answers
6k
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 ...
1
vote
1
answer
123
views
I am using an example fracnsites to make a similar map but I don't under stand the ajax code?
I am using an example fracnsites to make a similar map but I don't under stand the ajax code?
The example has js code:
var map,
fields = ["gid", "createdby", "featname", "feattype", "status", "acres"...
0
votes
1
answer
509
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
0
answers
694
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);
//...