Angular 角度谷歌地图更改原点纬度和经度

Angular 角度谷歌地图更改原点纬度和经度,angular,google-maps,Angular,Google Maps,如何更改角度谷歌地图中的原点纬度和经度?另外,如何每5秒刷新一次地图?或者我应该为用户提供一个刷新按钮 ngOnInit(){ 这个.getPosition(); this.getAgentLocationNow(); map=new google.maps.map(document.getElementById('map_canvas'){ 中心:新的google.maps.LatLng(this.currentLocation.lat,this.currentLocation.lng) }

如何更改角度谷歌地图中的原点纬度和经度?另外,如何每5秒刷新一次地图?或者我应该为用户提供一个刷新按钮

ngOnInit(){
这个.getPosition();
this.getAgentLocationNow();
map=new google.maps.map(document.getElementById('map_canvas'){
中心:新的google.maps.LatLng(this.currentLocation.lat,this.currentLocation.lng)
});
}
GetAgentLocationNow(){
this.http.getAgentLocationNow()
.订阅((结果)=>{
this.agentslocations=结果;
},(错误)=>{
console.log(错误);
});
}
地理编码地址(){
var address=this.searchtext;
var geocoder=new google.maps.geocoder();
地理编码({
“地址”:地址
},功能(结果、状态){
如果(状态=='OK'){
this.currentLocation={};
this.currentLocation.lat=结果[0]。geometry.location.lat();
this.currentLocation.lng=结果[0]。geometry.location.lng();
panTo(新的google.maps.LatLng(this.currentLocation.lat,this.currentLocation.lng));
}否则{
警报('地理编码因以下原因未成功:'+状态);
}
});
}


到目前为止您做了什么?您需要共享到目前为止您基本上已经完成并坚持的代码。1)如上所述,请显示您的代码和您尝试过的内容,以及您是否正在使用库或内置的
maps
组件2)Google maps Dynamic API不再免费。我相信你一个月可以免费下载150000张地图。每5秒钟刷新一次可能会很快变得昂贵(并且让用户感到恼火)。3) 请阅读文档,像这样的信息很容易在谷歌地图上找到。到目前为止你做了什么?您需要共享到目前为止您基本上已经完成并坚持的代码。1)如上所述,请显示您的代码和您尝试过的内容,以及您是否正在使用库或内置的
maps
组件2)Google maps Dynamic API不再免费。我相信你一个月可以免费下载150000张地图。每5秒钟刷新一次可能会很快变得昂贵(并且让用户感到恼火)。3) 请阅读文档,这样的信息很容易在谷歌地图API上找到