我使用npm安装了agm/core,如下所示:
npm install @agm/core
显示了下列警告:
npm WARN @agm/core@3.0.0-beta.0 requires a peer of @angular/common@^9.1.0 || ^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @agm/core@3.0.0-beta.0 requires a peer of @angular/core@^9.1.0 || ^10.0.0 but none
我正在使用AgmMap的地图在角4应用程序。如何在显示信息窗口的agm标记中实现mouseover事件。我需要打开信息窗口标记鼠标悬停。如何将函数onMouseOver中的infowindow实例恢复以打开它?这是我的map.component.html文件
<agm-map [latitude]="lat" [longitude]="lng">
<agm-marker *ngFor="let m of markers; let i = index"
[latitude]="m.lat"
我有个问题。现在我用这个函数生成我的地图:
function mapStart() {
var center = new google.maps.LatLng(c1, c2);
var MapOption = {
zoom: 6,
center: center,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("mapka"), MapOption);
我的问题是-我如何能够生成这个地图没有‘中心’类型,但与边界?例如:具有边界的新
我想集成谷歌地图占位符,以便最终用户可以搜索他/她的位置,但在普通的javascript中,我已经集成了它,并按预期工作,现在我正试图将其转换为Angular 4项目,除了我的谷歌地图占位符只显示我选择的地方之外,一切都很好。您可以考虑使用此,因为我也在使用此代码。此外,我还使用了Angular Google Map模块。请建议此API的替代方案或解决方法?我嵌入了下面的代码:
TS文件
import {AfterViewInit, Component, ElementRef, NgZone, OnInit, ViewChild} from '@angular/core';
i
我工作的角度4和角谷歌地图。
我遵循中的说明,但是每次在地图视图上重新加载页面时,我都会得到错误:You have included the Google Maps API multiple times on this page. This may cause unexpected errors.
这是我的代码的实现:
map.component.html
<div class="container">
<agm-map [latitude]="lat" [longitude]="lng">
&
我想在我的Angular 5应用程序上使用谷歌地图,但我遇到了一些问题。
当视图加载时,我在js控制台中收到错误:
LoginComponent_Host.ngfactory.js? [sm]:1 ERROR ReferenceError: google is not defined
at LoginComponent.ngAfterViewInit (login.component.ts:15)
at callProviderLifecycles (core.js:12428)..
我的组件:
import {AfterViewInit, Component} from '@