在我们所有的 Umbraco 网站中,Google map 数据类型不再起作用。直到昨天为止,这一切都很完美,但今天只有输入字段和位置字段,而没有 Google map ...
Firebug 报告以下错误
在队列中
context._maps[id] = new UmbracoGoogleMap.map(id, this);
在下面的函数中
guiMap: function () {
var context = this;
this._apiLoaded = true;
jQuery('div.gmapContainer').each(function () {
var id = jQuery('div.map', this).attr('id');
context._maps[id] = new UmbracoGoogleMap.map(id, this);
context._maps[id].render();
});
},
还有很多人也报告了同样的问题,但尚未找到解决方案! http://our.umbraco.org/projects/backoffice-extensions/google-maps-datatype/bug-reports/33390-No-map-in-Backend
最佳答案
看起来问题与上下文有关。它被设置为窗口而不是 UmbracoGoogleMapMapDataType,因为“this”指向错误的位置。所以我尝试了:
var context = UmbracoGoogleMapMapDataType;
this._apiLoaded = true;
jQuery('div.gmapContainer').each(function () {
var id = jQuery('div.map', this).attr('id');
context._maps[id] = new UmbracoGoogleMap.map(id, this);
context._maps[id].render();
});
现在这似乎只是一个临时补丁。如果需要,可以从https://www.dropbox.com/s/3aj91cuzxn3rcbu/Our.Umbraco.GoogleMaps.zip下载dll。
关于javascript - Google map 数据类型抛出类型错误 : can't convert undefined to object,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11633938/