I using angular 7 i work on google map
google map already display without points pushed on it .
meaning I need to display all points on google map
meaning i need to display 5 locations every location have latitude and
longtude .
step 1 : on html component
<agm-map
[latitude]="lat"
[longitude]="lng"
[zoom]="zoom"
[disableDefaultUI]="false"
[zoomControl]="false">
<agm-marker
*ngFor="let m of markers;"
[latitude]="m.lat"
[longitude]="m.long"
>
</agm-marker>
</agm-map>
step2 :service.ts
getLocationData(ids: Array<number>) {
let observableBatch = [];
ids.forEach((id) => {
observableBatch.push(
this.http.get('http://192.168.7.45:9200/location/_doc/'+id)
.map(res => res ));
});
return Observable.forkJoin(observableBatch);
}
step3 :on component.ts
export class ManagelocationsComponent implements OnInit, AfterViewInit {
markers=[];
this.partDetailsService.getLocationData(locationArr).subscribe(res => {
res.forEach((item, index) => {
let dataLocation = res[index]['_source']['GPS1'];
})
console.log("dataLocation values is" +dataLocation);
Result points for latitude and longitude from browser
marker values is
latitude longitude
5.2951916,100.28825170000005,
30.788892,120.632503,
13.658933,100.634069,
10.328074,123.983185,
31.332119,120.723465,
google map not show points above why and how to solve it .
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/angular/a378ab58-1b5d-4386-af6c-47c7fcf38c69%40googlegroups.com.