- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试从主网站实例化一个 angular-google-maps 示例:https://angular-maps.com/guides/getting-started/为应用程序做一些测试。
我使用了他们的示例代码如下:
import { Component } from '@angular/core';
@Component({
selector: 'page-location',
templateUrl: 'location.html',
})
export class LocationPage {
title: string = 'My first AGM project';
lat: number = 51.678418;
lng: number = 7.809007;
}
page-location
{
agm-map {
height: 150px;
}
}
<h1>{{ title }}</h1>
<!-- this creates a google map on the page with the given lat/lng from -->
<!-- the component as the initial center of the map: -->
<agm-map style="height: 300px;" [latitude]="lat" [longitude]="lng">
<agm-marker [latitude]="lat" [longitude]="lng"></agm-marker>
</agm-map>
最后抛出如下错误:
core.js:1449 ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function TypeError: Object(...) is not a function at new FitBoundsService (fit-bounds.js:31) at createClass (core.js:12481) at _createProviderInstance (core.js:12458) at createProviderInstance (core.js:12299) at createViewNodes (core.js:13771) at callViewAction (core.js:14218) at execComponentViewsAction (core.js:14127) at createViewNodes (core.js:13812) at createRootView (core.js:13673) at callWithDebugContext (core.js:15098) at new FitBoundsService (fit-bounds.js:31) at createClass (core.js:12481) at _createProviderInstance (core.js:12458) at createProviderInstance (core.js:12299) at createViewNodes (core.js:13771) at callViewAction (core.js:14218) at execComponentViewsAction (core.js:14127) at createViewNodes (core.js:13812) at createRootView (core.js:13673) at callWithDebugContext (core.js:15098) at c (polyfills.js:3) at Object.reject (polyfills.js:3) at OverlayPortal.NavControllerBase._fireError (nav-controller-base.js:223) at OverlayPortal.NavControllerBase._failed (nav-controller-base.js:216) at nav-controller-base.js:263 at t.invoke (polyfills.js:3) at Object.onInvoke (core.js:4760) at t.invoke (polyfills.js:3) at r.run (polyfills.js:3) at polyfills.js:3
I would appreciate your help to look for the source of this problem.
最佳答案
我添加了以下命令 npm install rxjs@6 rxjs-compat@6 --save
并且它对我来说工作正常。
关于android - Ionic2/3 angular google maps TypeError : Object(. ..) 不是新 FitBoundsService 的函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52599926/
我正在尝试从主网站实例化一个 angular-google-maps 示例:https://angular-maps.com/guides/getting-started/为应用程序做一些测试。 我使
我是一名优秀的程序员,十分优秀!