Skip to content

Instantly share code, notes, and snippets.

@nickpeihl
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nickpeihl/10190102 to your computer and use it in GitHub Desktop.
Save nickpeihl/10190102 to your computer and use it in GitHub Desktop.
Error using simplest example from geoservices-js docs.
O:\Workspace\Nick\Public Works\Citizen Engagement\nodejs>node server.js
O:\Workspace\Nick\Public Works\Citizen Engagement\nodejs\node_modules\geoservice
s\lib\featureservice.js:61
this.get();
^
TypeError: Object #<Geoservices> has no method 'get'
at Geoservices.FeatureService (O:\Workspace\Nick\Public Works\Citizen Engage
ment\nodejs\node_modules\geoservices\lib\featureservice.js:61:8)
at Object.<anonymous> (O:\Workspace\Nick\Public Works\Citizen Engagement\nod
ejs\server.js:6:8)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
var Geoservices = require('geoservices');
var client = new Geoservices();
// make a request to a feature service
client.featureservice({
url: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3'
}, function ( err, result ) {
if (err) {
console.error("ERROR: " + err);
} else {
console.log("Got the FeatureService Metadata: ", result );
}
});
@JerrySievert
Copy link

@chelm can you take a look at this?

@chelm
Copy link

chelm commented Apr 9, 2014

Well, this is odd. Looks like a scoping bug that needs to be fixed. A work around i just found fixing the scope issue:

var Geoservices = require('geoservices');

var client = new Geoservices();

// make a request to a feature service
var service = new client.featureservice({
url: 'http://sampleserver6.arcgisonline.com/arcgis/rest/services/Census/MapServer/3'
}, function ( err, result ) {
console.log("Got the FeatureService Metadata: ", result );
});

@nickpeihl
Copy link
Author

Thanks Chris and Jerry. I'll check it out.

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