首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Meteor/Autoform-map/Google-maps包错误?

Meteor/Autoform-map/Google-maps包错误?
EN

Stack Overflow用户
提问于 2015-04-27 10:44:15
回答 1查看 314关注 0票数 0

我在应用程序中同时使用了yogiben:autoform-map和dburles:google-map包。它们似乎不能很好地协同工作。使用dburles的代码:google- map运行良好,但是autoform map抛出了这个错误:

代码语言:javascript
复制
Exception from Tracker afterFlush function:
TypeError: undefined is not a function
at t.afMap.rendered (d56467d85b9f586916cc49f2dba3c180bfed1ddc.js:210)
at p (d56467d85b9f586916cc49f2dba3c180bfed1ddc.js:154)
at a (d56467d85b9f586916cc49f2dba3c180bfed1ddc.js:154)
at d56467d85b9f586916cc49f2dba3c180bfed1ddc.js:66
at Function.e._withTemplateInstanceFunc (d56467d85b9f586916cc49f2dba3c180bfed1ddc.js:66)
at n (d56467d85b9f586916cc49f2dba3c180bfed1ddc.js:66)
at null.<anonymous> (d56467d85b9f586916cc49f2dba3c180bfed1ddc.js:66)
at d56467d85b9f586916cc49f2dba3c180bfed1ddc.js:65
at Object.c._withCurrentView (d56467d85b9f586916cc49f2dba3c180bfed1ddc.js:65)
at d56467d85b9f586916cc49f2dba3c180bfed1ddc.js:65

我的html:

代码语言:javascript
复制
    {{#autoForm class="add" id="add" collection="ServiceProviders" type="insert"}} 
    {{> afQuickField name="businessname"}} 
    {{> afQuickField name="officelocation"}}
    <button type="submit" class="btn">Create!</button>
    {{/autoForm}}

我的收藏:

代码语言:javascript
复制
officelocation: {
type: String,
label: 'Location of Office',
autoform: {
  type: 'map',
  afFieldInput: {
    type: 'map',
    geolocation: true,
    searchBox: true,
    autolocate: true
  }
} }

此外,在我添加dburles:google-map包之前,这个自动表单运行得很好。在autoform-map.cafee中调用此代码时,"GoogleMaps“似乎还没有准备好。

代码语言:javascript
复制
    GoogleMaps.init { libraries: 'places' }, () =>
    mapOptions =
        zoom: 0
        mapTypeId: google.maps.MapTypeId[@data.options.mapType]
        streetViewControl: false

这看起来很奇怪,因为我已经在meteor startup上做了:

代码语言:javascript
复制
Meteor.startup(function() {
    if (GoogleMaps.loaded()?false:true) {
        GoogleMaps.load();
    }

});

EN

回答 1

Stack Overflow用户

发布于 2015-04-27 20:39:22

正如yogiben在这里指出的那样,这两个包之间存在冲突:https://github.com/yogiben/meteor-autoform-map/issues/9

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29886354

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档