Last active
August 29, 2015 13:58
-
-
Save nickpeihl/10190102 to your computer and use it in GitHub Desktop.
Error using simplest example from geoservices-js docs.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ); | |
} | |
}); |
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 );
});
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
@chelm can you take a look at this?