Home > geoserver > Geoserver WFS get feature doesn't work - "SyntaxError: missing ; before statement"

Geoserver WFS get feature doesn't work - "SyntaxError: missing ; before statement"

December 3Hits:2
Advertisement

I'm trying to use geoserver WFS json for creating vector layer (instead of using WMS) because this is a layer I redraw every 20 seconds.

This is the code I use :

function getJSON() {      var geoJsonUrl = "http://localhost:8080/geoserver/test/ows?service=WFS&version=1.1.0&request=GetFeature&typeName=test:Coords&srsName=EPSG:4326&format=text/javascript&outputFormat=json&format_options=callback:loadGeoJson";      $j.ajax({         url: geoJsonUrl,         dataType: 'jsonp'     });      }  function loadGeoJson(data) {     console.log('success'); } 

The JSON from the request is :

{     "type": "FeatureCollection",     "features": [         {             "type": "Feature",             "id": "DIView.fid-25487b92_142a9c99a7e_-5722",             "geometry": {                 "type": "Point",                 "coordinates": [                     34.8923,                     32.1893                 ]             },             "geometry_name": "DeviceLocation",             "properties": {                 "Id": 1,                 "DeviceSerial": "046009117212",                 "DateTime": "2013-12-03T12:20:48.080Z",                 "Spd": "4.72175   ",                 "Brn": "143.3     ",                 "Alt": "91.6      ",                 "DeviceName": "12",                 "DeviceReversedName": "21",                 "DeviceBattery": 3.71             }         },         {             "type": "Feature",             "id": "DIView.fid-25487b92_142a9c99a7e_-5721",             "geometry": {                 "type": "Point",                 "coordinates": [                     34.8025,                     31.2813                 ]             },             "geometry_name": "DeviceLocation",             "properties": {                 "Id": 2,                 "DeviceSerial": "046009117224",                 "DateTime": "2013-12-03T12:41:12.313Z",                 "Spd": "0         ",                 "Brn": "136       ",                 "Alt": "349       ",                 "DeviceName": "24",                 "DeviceReversedName": "42",                 "DeviceBattery": 0.29             }         },         {             "type": "Feature",             "id": "DIView.fid-25487b92_142a9c99a7e_-5720",             "geometry": {                 "type": "Point",                 "coordinates": [                     34.8026,                     31.2812                 ]             },             "geometry_name": "DeviceLocation",             "properties": {                 "Id": 3,                 "DeviceSerial": "047180050069",                 "DateTime": "2013-12-03T12:41:14.140Z",                 "Spd": "0.690988  ",                 "Brn": "161.8     ",                 "Alt": "340.2     ",                 "DeviceName": "4",                 "DeviceReversedName": "4",                 "DeviceBattery": 3.65             }         }     ],     "crs": {         "type": "EPSG",         "properties": {             "code": "4326"         }     } } 

and I get error in firebug :

Geoserver WFS get feature doesn't work - "SyntaxError: missing ; before statement"

Any idea ?!

Related Articles

  • Geoserver WFS get feature doesn't work - "SyntaxError: missing ; before statement"

    Geoserver WFS get feature doesn't work - "SyntaxError: missing ; before statement"December 3

    I'm trying to use geoserver WFS json for creating vector layer (instead of using WMS) because this is a layer I redraw every 20 seconds. This is the code I use : function getJSON() { var geoJsonUrl = "http://localhost:8080/geoserver/test/ows?service=

  • Geoserver WFS-T "Feature type 'Workspace:Layer' is not available" Error on update / deleteDecember 1

    I am using the following code for insert / update (changed from this source: http://wordpress-dbauszus.rhcloud.com/?p=71): var formatWFS = new ol.format.WFS(); // GML Format zur Interaktion mit WFS var formatGML = new ol.format.GML({ featureNS: 'http

  • Releasing GeoServer WFS-T Feature LockMay 24

    For some reason I'm having trouble finding any documentation about releasing feature locks in a GeoServer WFS (or any WFS for that matter). I can easily request a FeatureLock with a request like this http://localhost:8080/geoserver/wfs?service=WFS&ve

  • Dynamically adding WFS layer features with GeoserverMarch 15

    I am investigating using Geoserver to output new WFS layer features dynamically. We have a backend process that will be generating new WFS features periodically that will be placed in a datastore (most likely PostGIS). I plan on creating a WFS layer

  • Geoserver WFS features query inaccurate using SQL Server Backend with spatial indexOctober 1

    I´m using Geoserver to query features through WFS in an Web Application with Openlayers as client. The queried layer is using SQL Server as backend storage. When applying a spatial index to the queried layer in SQL Server, the response of an identify

  • Geoserver WFS 2.0 CSV Output Multiple Features/typeNamesJanuary 27

    I'm setting up an export function so that users may download data from a Geoserver WFS 2.0 service in a variety of the supported formats. The service has multiple FeatureTypes which should be available for export in a single query (along with BBOX an

  • Oracle / GeoServer / WFS-T / Openlayers many polygons as one featureFebruary 26

    Newbie question regarding Oracle / GeoServer / WFS-T / Openlayers. I am creating a table that will hold geometry features a user creates/updates. My question is, I would like to have just one record in the table per customer (customerId). Can I creat

  • GeoServer polygon intersecting features of WFS November 12

    How to get all the features intersecting a polygon using wfs.I am able to get all the features from WFS geoserver but dont know how to pass a polygon to get only specific features which are intersecting with the polygon.Please provide few lines of co

  • geoserver wfs insert errorApril 27

    I keep getting an insert error from geoserver when trying to save a point, poly etc etc to my postgis table. any ideas, my code is below var Projection = new OpenLayers.Projection("EPSG:4326"); var map = new OpenLayers.Map("Map", { //p

  • GeoExt printPage cannot handle WFS vector featuresOctober 20

    I recently added the print function to my GeoExt web application, using <script type="text/javascript"src="http://localhost:8080/geoserver/pdf/info.json?var=printCapabilities"></script> to define the printCapabilities varia

  • OpenLayers call ArcGIS WFS: no feature returnedJanuary 24

    I spent a long time looking for an example using OpenLayers to call ArcGIS WFS, however, almost none is found... currently the code I wrote is based on the example of GeoServer, however, no feature is returned... new OpenLayers.Layer.Vector("ArcGIS W

  • Allow GeoServer WFS request by featureIDApril 6

    I'm not able to use the featureID parameter in a WFS URL request for my dataset on GeoServer. Example: http://demo.opengeo.org/geoserver/wfs?version=1.1.0&service=wfs&request=GetFeature&typeName=topp:tasmania_roads&maxFeatures=10&featu

  • GeoServer WFS OpenLayers EditingPanel ProblemJune 13

    I'm trying to use OpenLayers to edit features of vector data served from a local geoserver. So far, I'm able to pull WMS and WFS layers using OpenLayers from the same geoserver. But now, I'd like enable editing of features of the vector layers. The r

  • Can I prevent OpenLayers from losing my WFS-T feature edits?March 21

    Using openlayers (2.12) and drawing some vector features against a WFS-T interface (offered by geoserver). Problem is, when I draw some geometries and pan a little bit too much, openlayers sends "wfs:GetFeature" message to WFS-T interface, and w

  • What's the correct link for adding GeoServer WFS to ArcMap?

    What's the correct link for adding GeoServer WFS to ArcMap?January 27

    What is the correct URL to enter in ArcCatalog WFS Parameters when adding a WFS layer from GeoServer into ArcMap? Here's a link to our Get Capabilities document: https://weaveprod.ucdp.utah.edu/geoserver/ows?service=wfs&version=1.0.0&request=GetCa

  • GeoTools WFS Query sortBy not working for GeoServer WFSFebruary 17

    I am using GeoTools to query a GeoServer WFS using the following code: Map connectionParameters = new HashMap(); connectionParameters.put("WFSDataStoreFactory:GET_CAPABILITIES_URL", String.format("%s&request=GetCapabilities", wfsUr

  • Accessing GeoServer WFS services in ArcGIS Online map viewer?September 9

    Has anyone was able to add GeoServer WFS service into ArcGIS Online map viewer? By this I mean having an ArcGIS Online account (either free or for Organizations), logging in and adding layers from the web. I have no problems adding a WMS service such

  • What causes these geometry differences between original PostGIS data and Geoserver WFS?

    What causes these geometry differences between original PostGIS data and Geoserver WFS?January 4

    Why does GeoServer (v2.5.1) WFS layer (see red line/layer below) not overlay features of source PostGIS table or related WMS layer in QGIS (tested in v2.6 and 2.12)? All layers are defined in the same GCS (EPSG: 4326) (interstate Tiger shp data origi

  • Drupal-Geoserver WFS error September 24

    I am having trouble getting a WFS layer working using Geoserver, OpenLayers and GeoExt. I get the following error: XMLHttpRequest cannot load http://10.0.0.155/geoserver/wfs. Origin http://10.0.0.155:8080 is not allowed by Access-Control-Allow-Origin

  • How to add GeoServer wfs layer on OpenLayers?

    How to add GeoServer wfs layer on OpenLayers?March 4

    I can't seem to add a WFS layer like this. It works when i copy all this code locally but as soon as i change the values to point to my own layer within my own GeoServer this is the response viewed in firebug: Could not locate {http://www.mydomain.co

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.309 s.