我想在左侧面板中为商店添加新字段。我发现我需要扩展这个原型方法,但我不知道如何去做。
storeLocator.Store.prototype.getInfoWindowContent = function() {
if (!this.content_) {
// TODO(cbro): make this a setting?
var fields = ['title', 'address', 'phone', 'misc', 'web'];
var html = ['<div class="store">'];
html.push(this.generateFieldsHTML_(fields));
html.push(this.generateFeaturesHTML_());
html.push('</div>');
this.content_ = html.join('');
}
return this.content_;
};
我需要在上面的“字段”列表中添加字段。请帮助。
答案 0 :(得分:0)
根据您提供的代码,我认为有一个fields
变量,您可以在其中包含其他字段。您是否尝试向该阵列添加String
值?试一试。
我认为html
变量是针对商店定位器的界面。请注意,fields
被推送(html.push()
)到html。
发现此链接显示Simple Customized Store Locator。此外,此Github Store Locator Reference也可能对您有用。
希望这会有所帮助。祝你好运。