我正在使用Angular / Ionic开展项目, 我在文档中搜索过,并开始使用预定义的
<iframe src="https://www.google.com/maps/embed/v1/undefined?origin=...&q=...&destination=...¢er=...&zoom=...&key=..." allowfullscreen></iframe>
现在我有了地图,我想在这张地图上画圆圈,但我尝试了很多东西并且失败了。
这是我的代码:
location: any;
cityCircle: any;
map: any;
marker: any;
ngOnInit() {
this.map = new google.maps.Map(document.getElementById('map'));
this.location = "https://www.google.com/maps/embed/v1/place?q=" + this.navParams.get('Loca') + "&zoom=12&key=KEYCODE";
console.log(this.navParams.get('Lat'), this.navParams.get('Long'), this.navParams.get('Radius'));
var cityCircle = new google.maps.Circle({
strokeColor: '#FF0000',
strokeOpacity: 0.8,
strokeWeight: 2,
fillColor: '#FF0000',
fillOpacity: 0.35,
map: this.map,
center: {
lat: this.navParams.get('Lat'),
lng: this.navParams.get('Long')
},
radius: this.navParams.get('Radius') * 10000
});