I am trying to modify this example
http://storelocator.googlecode.com/git/examples/panel.html
javascript code is here:
https://gist.github.com/2725336
The aspect I come across changes this:
MedicareDataSource.prototype.FEATURES_ = new storeLocator.FeatureSet(
new storeLocator.Feature('Wheelchair-YES', 'Wheelchair access'),
new storeLocator.Feature('Audio-YES', 'Audio')
);
to create a FeatureSet from a function, so for example, I have this function that parses a JSON object
WPmmDataSource.prototype.setFeatures_ = function(json) {
var features = [];
var rows = jQuery.parseJSON(json);
jQuery.each(rows, function(i, row){
var feature = new storeLocator.Feature(row.slug + '-YES', row.name)
features.push(feature);
});
return new storeLocator.FeatureSet(features);
};
then change the first code snippet to something like
WPmmDataSource.prototype.FEATURES_ = this.setFeatures_(wpmm_features);
which returns an error:
Uncaught TypeError: Object [object Window] has no method 'setFeatures_'
source
share