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
3 votes
2 answers
98 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 ...
user avatar
0 votes
1 answer
80 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 ...
user avatar
  • 69
1 vote
1 answer
156 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 = &...
user avatar
0 votes
0 answers
91 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 ...
user avatar
  • 1
0 votes
0 answers
41 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=&...
user avatar
0 votes
1 answer
74 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 =...
user avatar
  • 1,127
1 vote
1 answer
57 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://...
user avatar
  • 91
1 vote
0 answers
106 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 ...
user avatar
  • 111
2 votes
1 answer
221 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....
user avatar
1 vote
2 answers
360 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 ...
user avatar
-1 votes
1 answer
86 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 ...
user avatar
0 votes
0 answers
193 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....
user avatar
1 vote
1 answer
113 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 ...
user avatar
  • 20.5k
0 votes
2 answers
1k 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:""}, ...
user avatar
1 vote
1 answer
214 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 ...
user avatar
  • 580
3 votes
1 answer
1k 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 ...
user avatar
  • 361
1 vote
0 answers
168 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 ...
user avatar
1 vote
2 answers
825 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 ...
user avatar
2 votes
1 answer
3k 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 ...
user avatar
1 vote
0 answers
45 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, ...
user avatar
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" --...
user avatar
3 votes
0 answers
221 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 ...
user avatar
2 votes
1 answer
1k 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 ...
user avatar
0 votes
1 answer
551 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 ...
user avatar
  • 21
1 vote
1 answer
359 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)...
user avatar
0 votes
0 answers
706 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 ...
user avatar
0 votes
1 answer
124 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....
user avatar
1 vote
1 answer
1k 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 ...
user avatar
  • 63
0 votes
0 answers
451 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); //...
user avatar
0 votes
1 answer
356 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=...
user avatar
0 votes
0 answers
280 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 ...
user avatar
1 vote
2 answers
607 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 ...
user avatar
0 votes
2 answers
3k 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 ...
user avatar
  • 1
0 votes
1 answer
47 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 ...
user avatar
0 votes
2 answers
4k 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( ...
user avatar
1 vote
2 answers
796 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 ...
user avatar
1 vote
1 answer
1k 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 ...
user avatar
  • 123
2 votes
0 answers
1k 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). ...
user avatar
1 vote
2 answers
485 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, ...
user avatar
  • 143
1 vote
1 answer
2k 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....
user avatar
  • 11
2 votes
1 answer
2k 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 ...
user avatar
1 vote
2 answers
511 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....
user avatar
0 votes
1 answer
1k 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 ...
user avatar
1 vote
0 answers
1k 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 ...
user avatar
0 votes
1 answer
4k 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(";"); ...
user avatar
2 votes
3 answers
5k 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 ...
user avatar
2 votes
1 answer
3k 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 ...
user avatar
  • 73
0 votes
0 answers
144 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 ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
  • 43
0 votes
1 answer
6k 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)....
user avatar