Closed kbsali closed 10 years ago
Hi Kevin, thanks for the addition.
I'm thinking this might be something obscure enough that you should maybe just sublcass lvector.GitSpatial
. For example:
MyGitSpatial = lvector.GitSpatial.extend({
setUser: function(user) {
this.options.user = user;
},
setRepo: function(repo) {
this.options.repo = repo;
},
setFeatureSet: function(featureSet) {
this.options.featureSet = featureSet;
}
});
my_layer = MyGitSpatial({
user: 'whoever',
repo: 'whatever',
featureSet: 'whatever_again'
});
// The custom methods are now available since my_layer was instantiated from MyGitSpatial, your subclass of lvector.GitSpatial
my_layer.setFeatureSet('another_feature_set');
ok that works for me, although i still think this would be a nice built-in feature! ;)
This makes it possible to "change" the layer Gitspatial layer source without having to create a new instance of lvector.GitSpatial
See http://gasolineras.saliou.name/ for a live example.