POST
|
I followed this sample implementing GeoJSON import "Create a FeatureLayer with client side graphics | ArcGIS API for JavaScript 4.3" but I am stucked on the following error that appears when creating the FeatureLayer : "TypeError: Cannot read property 'path' of null". The GeoJSON data seem to be correctly retrieved however, here is my code : var adsbRenderer = new SimpleRenderer({
symbol: new SimpleMarkerSymbol({
size: 10,
color: "#FF4000",
outline: {
color: [255, 64, 0, 0.4],
width: 7
}
})
});
// Tentative with GeoJSON
// Raise error when creating the FeatureLayer object : "TypeError: Cannot read property 'path' of null"
esriRequest({
url: this.config.adsb.adsbBaseUrl,
content: {
service: 'WFS',
version: '1.0.0',
request: 'GetFeature',
typeName: 'adsb-docker:aircrafts',
outputFormat: 'application/json',
CQL_FILTER: 'opicao=\'EZY\''
},
handleAs: 'json'
}).then(function(geoJson) {
// Create an array of Graphics from each GeoJSON feature
return arrayUtils.map(geoJson.features, function(feature, i) {
return {
geometry: new Point({
x: feature.geometry.coordinates[0],
y: feature.geometry.coordinates[1]
}),
// select only the attributes you care about
attributes: {
id: feature.id,
icao: feature.properties.icao,
op: feature.properties.op,
opicao: feature.properties.opicao,
time: feature.properties.time,
man: feature.properties.man,
mdl: feature.properties.mdl
}
};
});
}).then(function(graphics) {
// Define the specification for each field to create
var fields = [
{
name: "id",
alias: "id",
type: "oid"
}, {
name: "icao",
alias: "icao",
type: "string"
}, {
name: "op",
alias: "op",
type: "string"
}, {
name: "opicao",
alias: "opicao",
type: "string"
}, {
name: "man",
alias: "man",
type: "string"
}, {
name: "time",
alias: "time",
type: "date"
}, {
name: "mdl",
alias: "mdl",
type: "string"
}];
// Set up popup template for the layer
var pTemplate = {
title: "{icao}",
content: [{
type: "fields",
fieldInfos: [{
fieldName: "op",
label: "Op",
visible: true
}, {
fieldName: "opicao",
label: "Op Icao",
visible: true
}, {
fieldName: "time",
label: "Date and time",
visible: true
}, {
fieldName: "man",
label: "Manufacturer",
visible: true
}, {
fieldName: "mdl",
label: "Model",
visible: true
}]
}],
fieldInfos: [{
fieldName: "time",
format: {
dateFormat: "short-date-short-time"
}
}]
};
this.adsbLayer = new FeatureLayer({
source: graphics, // autocast as an array of esri/Graphic
// create an instance of esri/layers/support/Field for each field object
fields: fields, // This is required when creating a layer from Graphics
objectIdField: "id", // This must be defined when creating a layer from Graphics
renderer: adsbRenderer, // set the visualization on the layer
spatialReference: {
wkid: 4326
},
geometryType: "point", // Must be set when creating a layer from Graphics
popupTemplate: pTemplate
});
this.map.addLayer(this.adsbLayer);
}).otherwise(function(error) {
console.error("Creating ADSB layer failed. ", error);
});
... View more
03-27-2017
08:20 AM
|
0
|
2
|
4864
|
POST
|
I am trying to display a WFS layer in a web app built with Web AppBuilder Developer Edition, this layer is hosted on a GeoServer and uses a PostGIS data store. When I perform the POST request to get the features using a tool like POST Man on my server URL http://127.0.0.1:32771/adsb-docker/wfs everything is fine. When the request is made by the web app the URL become proxied to https://laptop-lc:3344/proxy.js?http://127.0.0.1:32771/adsb-docker/wfs and the GeoServer return an error like this one : How to correctly request a geoserver WFS via POST? - Stack Overflow. I suspect that some headers are not properly forwarded to it but any support on this is welcomed. The request body is the following: <?xml version='1.0' encoding='utf-8'?> <GetFeature xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:gml='http://www.opengis.net/gml' xmlns:ogc='http://www.opengis.net/ogc' xmlns:wfs='http://www.opengis.net/wfs' xmlns='http://www.opengis.net/wfs' xmlns:adsb-docker='http://www.airbus.com/adsb-docker' version='1.1.0' service='WFS' maxFeatures='100'> <wfs:Query typeName='adsb-docker:aircrafts' srsName='EPSG:4326'> </wfs:Query> </GetFeature>
... View more
03-27-2017
08:05 AM
|
0
|
0
|
793
|
POST
|
I am trying to add a new custom widget in the builder (under client\stemapp\widgets). However when I update the code of my widget it does not seem to be reflected in the App Builder. For instance I had in my app a syntax error due to my bad widget code, then I changed the code and I can still see that the old widget code in use. Restart the App Builder does not seem to have an effect neither building a new app with the widget. Tried to remove server/db files without success, can someone explain how to make custom widget code updates reflect in the App Builder ? Thanks
... View more
03-17-2017
09:20 AM
|
0
|
1
|
1168
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|