【发布时间】:2012-09-22 12:16:09
【问题描述】:
尝试使用 jquery-ui-map 插件按地址执行搜索。
Firefox 报告:TypeError: h[b] is undefined /js/ui-map/jquery.ui.map.full.min.js 行:2
$(document).ready(function() {
$('#map_canvas').gmap('search', { 'address': 'Stockholm' }, function(isFound,results) {
if (isFound) {
$('#map_canvas').gmap('getMap').panTo(results[0].geometry.location);
}
});
});
请帮忙。
编辑:向开发者报告http://code.google.com/p/jquery-ui-map/issues/detail?id=64
【问题讨论】:
-
将我的错误也添加到了跟踪器中。我对 findMarker 有同样的问题。想知道它是否不是 jQuery。你的 jQuery 是什么版本的?
-
在阅读@johansalllarsson 评论后,我终于解决了我的问题:
findMarker is mainly for 'search', you should use $('#m').gmap('get', 'markers')['m_1'], $('#m').gmap('get', 'markers').m_1 or $('#m').gmap('get', 'markers > m_1') that would be faster. So, $('#m').gmap('get', 'markers > m_1').tags = 'something'; would be better than using findMarker.这里:groups.google.com/forum/?fromgroups=#!topic/…
标签: jquery google-maps-api-3 jquery-ui-map