Skip to content

Instantly share code, notes, and snippets.

@apfister
Created February 11, 2015 16:30
Show Gist options
  • Save apfister/e0ca0ffd634b732f0189 to your computer and use it in GitHub Desktop.
Save apfister/e0ca0ffd634b732f0189 to your computer and use it in GitHub Desktop.
geoservices - featureservice error
var Geoservices = require('geoservices');
var client = new Geoservices();
// console.log(client);
var query_params = {
f: 'json',
returnGeometry: true,
where: '1=1',
outSR: '4326'
};
var params = {
catalog: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services',
service: 'Census',
type: 'MapServer',
layer: 3
};
var fs = client.FeatureService( params , function(err, data){
fs.query( query_params, function( err, result ){
if (err) {
console.error("ERROR: " + err);
} else {
console.log("Features: ", result );
}
});
});
// client.geocode({ text: "920 SW 3rd Ave, Portland, OR 97201" }, function (err, result) {
// if (err) {
// console.error("ERROR: " + err);
// } else {
// console.log("Found it at " + result.locations[0].feature.geometry.y + ", " + result.locations[0].feature.geometry.x);
// }
// })
@JerrySievert
Copy link

var Geoservices = require('geoservices');

var client = new Geoservices();
// console.log(client);

var query_params = {
  f: 'json',
  returnGeometry: true,
  where: '1=1',
  outSR: '4326'
};

var params = {
  catalog: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services',
  service: 'Census',
  type: 'MapServer',
  layer: 3
};


var fs = new client.featureservice( params , function(err, data){
  fs.query( query_params, function( err, result ){
    if (err) {
      console.error("ERROR: " + err);
    } else {
      console.log("Features: ", result );
    }
  });
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment