ahmed elbarbary

ahmed elbarbary

  • NA
  • 1.6k
  • 278.3k

How to replace red shap on google map with circle googlemap

Dec 29 2019 8:55 PM
How to use circle on googlemap to location have latitude and longtude ?
I work on angular 7 
I use red shap on googlemap have latitude and longtude on component 
 i need only to make circle on map to the point have latitude and longtude
but i dont need to use red mark on map as following :
 
i need to replace it with circle 
so how to do that please ?
  1. import { Component, AfterViewInit, ViewChild, ElementRef } from '@angular/core';  
  2.   
  3. @Component({  
  4.   selector: 'app-root',  
  5.   templateUrl: './app.component.html',  
  6.   styleUrls: ['./app.component.css']  
  7. })  
  8. export class AppComponent implements AfterViewInit {  
  9.   title = 'angular-gmap';  
  10.   @ViewChild('mapContainer', { staticfalse }) gmap: ElementRef;  
  11.   map: google.maps.Map;  
  12.   
  13.  lat = 40.73061;  
  14.  lng = -73.935242;  
  15.   
  16.   coordinates = new google.maps.LatLng(this.lat, this.lng);  
  17.   
  18.   mapOptions: google.maps.MapOptions = {  
  19.     center: this.coordinates,  
  20.     zoom: 8  
  21.   };  
  22.   
  23.   marker = new google.maps.Marker({  
  24.     position: this.coordinates,  
  25.     map: this.map,  
  26.     title: 'Hello World!'  
  27.   });  
  28.   ngOnInit() {  
  29.      
  30.     console.log("Hi man");  
  31.    // this.mapInitializer();  
  32.   }  
  33.   ngAfterViewInit() {  
  34.     console.log("Hi women");  
  35.     this.mapInitializer();  
  36.   }  
  37.   
  38.   mapInitializer() {  
  39.     this.map = new google.maps.Map(this.gmap.nativeElement, this.mapOptions);  
  40.     this.marker.setMap(this.map);  
  41.   }  
  42. }  
as sample above i need to use circle on  point
 
lat = 40.73061;
lng = -73.935242;
 
without using marker 
so what i change on code to do that? 

Answers (1)