Questions tagged [ajax]

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

Filter by
Sorted by
Tagged with
5
votes
1answer
886 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:...
4
votes
2answers
20k views

Take data (points) from MySQL to Leaflet Map using PHP and Ajax

I have records with lat and lngs in a MySQL database and I want to add them to a Leaflet map as markers. I have tried a couple of methods but none seem to work. When the webpage opens the map doesn't ...
4
votes
2answers
3k views

How to get/pass token with ajax call to secured ArcGIS REST Service

I have a web map application that was written in HTML & JavaScript (using the ArcGIS JavaScript API). It desplays a few services that reside on an ArcGIS Server (10.2). It also has a custom legend ...
4
votes
1answer
34k views

Uncaught SyntaxError: Unexpected token : when using ajax

I try to call json data from geoserver, but when i try to run it in chrome, it return this following error "Uncaught SyntaxError: Unexpected token :" This is my code, function initialize(){...
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');?>",{ ...
3
votes
2answers
618 views

GeoJSON interaction with leaflet

I want to list GeoJSON on map as well on the div element outside the map but I'm somehow stuck. Using this block of code I did manage to create some sort of interaction between map and div element ...
3
votes
1answer
877 views

How can I load GeoJSON from URL to leaflet? [closed]

I want to use leaflet's L.GeoJSON to load the GeoJSON from my URL. I have tested to use leaflet-ajax plugin and it worked. The codes as follow: <link rel="stylesheet" href="http://cdn.leafletjs....
3
votes
1answer
1k views

GeoJSON is valid according to JSONLint but jquery gives error

I have the following GeoJSON (from webservice) { "Features": [ { "Id": "1", "Geometry": { "Coordinates": [ { "Latitude": 31.2812, ...
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, ...
3
votes
1answer
3k views

Options for getting data from SQL Server into Leaflet app?

I have polygon data in SQL Server 2012 that I need to get onto a Leaflet application - we're not talking thousands of polygons, but simplified U.S. counties where only one state will be displayed at a ...
3
votes
1answer
5k views

Request WFS from GeoServer with Jquery AJAX using INTERSECT cql_filter error

I am having difficulty troubleshooting this issue and would appreciate some ideas. Thanks in advance! I am trying to make an AJAX request from a Leaflet map with Jquery to GeoServer to return a WFS ...
3
votes
0answers
73 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
4k 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
1answer
2k views

How can I load strictly tiles within the current viewport in Leaflet.js?

I have tiles that are not available for the whole map. How can I stop Leaflet.js/Mapbox.js from making requests to these tiles? There are dozens of HTTP 404's that I'd really like to get rid of.
2
votes
1answer
1k views

MarkerCluster don't work with geojson layer in leaflet

I have created gejson layers and I want to use MarkerCluster option in one of them. But I don't know what am I doing wrong and where in my code is a problem. I tried something like this: Scripts: &...
2
votes
1answer
2k views

Fetching postgis data through php json and passing to leaflet map

I am new to this and trying to explore leaflet and geojson a bit. Please help me with this. This is my php page which I am using to fetch data from PostGIS. (the data opened successfully in the ...
2
votes
1answer
3k views

Get data to display on the map legend?

I am trying to use the Legend widget from this link below to build a legend that displays our layers in the map: https://developers.arcgis.com/en/javascript/home.html I have added the legend widget ...
2
votes
1answer
112 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 ...
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 ...
2
votes
1answer
923 views

Adding a WFS with ajax from Geoserver using Openlayers3

I am trying to load vector with the following code: var sourceWFS = new ol.source.Vector({ loader: function(extent) { $.ajax('http://************/geoserver/Viva/ows', { type:...
2
votes
1answer
907 views

How to append result to Geocoder text box using ArcGIS JavaScript API?

I want to append result of a custom search in a Geocoder text box in ArcGIS JavaScript API by overriding the default result. I have written the below code for this, but I am not getting a ...
2
votes
0answers
1k views

No 'Access-Control-Allow-Origin' header is present error when requesting json response from Geoserver

I am still working to get my GeoServer WFS displayed in my Leaflet map and cannot get the Ajax response to work properly. I have already run the "getFeature" request in my browser and it returned json ...
2
votes
0answers
141 views

Geoserver wfst ajax call

I am writing a feature into postgis behind geoserver using wfst and using jquery ajax call. When the user is authenticated it successfully adds a feature. When user is not authenticated it still ...
1
vote
2answers
184 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 ...
1
vote
1answer
152 views

Displaying nonspatial data via spatial data in Leaflet

I have two pieces of data; one is nonSpatial Jobs data and one is a spatial grid (polygon that was turned into geoJson). They are being served through separate API's/ajax calls. A primary-foreign key ...
1
vote
3answers
888 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
1answer
330 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 ...
1
vote
2answers
261 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
742 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
637 views

Collect external geojson from user and pass to L.GeoJSON.AJAX()

I am aware that I can use leafet ajax to add an external geojson to a leaflet map like such... var geojsonLayer = new L.GeoJSON.AJAX('c:/data/map/sample.geojson'); geojsonLayer.addTo(map); ...
1
vote
1answer
310 views

Generate and add L.control.layers from GeoJson properties to Leaflet

I have a problem with L.control.layer on this code, the control is added but he put another marker on top of the correct one. Naturally, I'd like to generate the layers from the results, not adding ...
1
vote
1answer
632 views

geojson data not rendering with openlayers in geodjango

map.html javascript code var map = new ol.Map({ layers: [ new ol.layer.Tile({ source: new ol.source.OSM() }) ], target: 'map', view: ...
1
vote
1answer
172 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
2answers
208 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
2answers
251 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....
1
vote
3answers
1k 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
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 ...
1
vote
1answer
3k views

Loading GeoJSON via AJAX after adding Layer to OpenLayers 3?

I'm trying to add a new GeoJSON layer to OpenLayers 3 that I have to fetch via AJAX. I want the user to click on a list of layers, have it add an empty vector layer, and then make an AJAX call and ...
1
vote
1answer
176 views

geoserver to leaflet via jsonp

Please somebody help because I am on the edge of madness:) I have no idea what is wrong with my code... Only what I want is adding layers to my leaflet map: 1 point layer, 1 line, and one polygon. ...
1
vote
0answers
30 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, ...
1
vote
1answer
55 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
0answers
562 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
0answers
746 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 ...
1
vote
0answers
374 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: ...
1
vote
0answers
470 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 ...
1
vote
0answers
89 views

How to render data from ona.io in leaflet

I want to consume data from ona.io into a leaflet map on another server. I guess using the api with the format: jsonp, might be a way. I'm not sure how to use e.g. leaflet-ajax to parse the data into ...
1
vote
1answer
1k views

Geojson + Ajax to openlayers 3 repeated loading of data

I'm loading Geojson-data (from Postgis) to Openlayers 3 via bounding box stategy. Everything looks good. The problem ist, that the data is reloaded all the time even if no change of the boundig box ...
1
vote
0answers
90 views

coords of the previous drawned polylines are sent to PostGIS with a form when sending coords of a new drawned polyline

I have a leaflet map in which I can draw some polylines and send their data and coordinates in a PostGIS database with Ajax and Php. When I've created a polyline and send their information in my ...
1
vote
0answers
209 views

Reload after modification a WFS layer from Geoserver with AJAX

In a Leaflet map, I’m calling a WFS layer from Geoserver containing multiple polylines whith data associated stored in a PostGIS table (geometry, ...) with AJAX. Everything works fine to dispaly the ...
1
vote
0answers
275 views

How to style GeoJSON features with attributes from MySQL in Openlayers 3

I got some GeoJSON-features from a file. The attributes of the features are stored in a database (MySQL), because I need them there for some interactions with users. On the other hand some of these ...