Google Maps is now an Angular component #219
Replies: 15 comments 1 reply
-
Hello, I have the following error message: Error: src/app/app.component.html:4:56 - error TS2345: Argument of type 'HTMLElement' cannot be assigned to parameter of type 'MapMarker'. 4 [options]="markerOptions" (mapClick)="openInfoWindow(marker)"> src/app/app.component.ts:6:16 |
Beta Was this translation helpful? Give feedback.
-
@LluizSouza This blog post was written on a previous version of the Angular Google Maps component. I hope this helps. |
Beta Was this translation helpful? Give feedback.
-
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY"></script> <<<<<
How to secure the key ? YOUR_API_KEY <<< since this goes to client browser, and can be inspected. |
Beta Was this translation helpful? Give feedback.
-
@vanderson22 the key is always visible, but you can restrict its usage. |
Beta Was this translation helpful? Give feedback.
-
Hi Tim, how are you? Am I missing something? <google-map Best regards. |
Beta Was this translation helpful? Give feedback.
-
It's sad that the Thank you for this article :) |
Beta Was this translation helpful? Give feedback.
-
Is this component obsolete for Angular 15? A small app stopped working in the past week or so. I am assuming something changed with the Google API as I did not change the app. I have now updated the app to angular 15 and cannot get it working. This was my code for adding a number of markers that worked up to recently: for each ... This line throws an error on myMapMarker:
Error: Argument of type '{ Type '{ MapMarker appears to be:
and not
as defined above on this page. What am I missing? Pardon my ignorance, I am relatively new to this ;) Any suggestions appreciated. |
Beta Was this translation helpful? Give feedback.
-
Environment relating to my post above: Angular CLI: 15.2.0 Angular: 15.2.0 Package Version@angular-devkit/architect 0.1502.0 and: "@angular/google-maps": "^15.2.0", |
Beta Was this translation helpful? Give feedback.
-
Hi Tim, thanks, this is great stuff, very useful. As well as working with I am using which works great for displaying the polygons from my database, but there seems to be no equivalent mapClick event. I have tried setting[clickable] to true and adding [click] and [onClick] properties. I have tried the listener events approach but cannot make it work. Do you know if there is a property of that would work when clicked? |
Beta Was this translation helpful? Give feedback.
-
I'm trying to show MapInfoWindow for every marker but stucked with the first info in every single mark. Need help to overcome the problem. <google-map Shop Name: {{ markerPosition.label }}Contact No: {{ markerPosition.title }} Shop Address: {{ markerPosition.address }} |
Beta Was this translation helpful? Give feedback.
-
Hey, I have implemented google-maps in my angular app, but I am not able to change the orientation(heading) manually by dragging using two fingers when I am using it in my mobile browser. Is there any way I can achieve that? |
Beta Was this translation helpful? Give feedback.
-
Beautiful post, Thanks! |
Beta Was this translation helpful? Give feedback.
-
Following your instructions to a T and nothing is showing on the page. Went through all versions from 16 cagegory. No exceptions thrown, nothing in the debug console.
|
Beta Was this translation helpful? Give feedback.
-
This article has been very useful for me. Wanted to let others know, instead of adding the key to the index file in a standalone angular build you can inject the key within the AppComponent (example below) imports:[GoogleMapsModule...] ngOnInit() { loadGoogleMapsApi(): void { isGoogleMapsLoaded(): boolean { |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm getting this error while trying to open Map Info Window is there anything you have regrading this.. 36 ERROR TypeError: anchor.getAnchor is not a function |
Beta Was this translation helpful? Give feedback.
-
Google Maps is now an Angular component - Tim Deschryver
The Angular Component pearl-lullaby (v9.0.0-rc.0) release introduces the second official @angular/component component, a Google Maps component. In this post, we take a look at getting started with the Google Maps component.
https://timdeschryver.dev/blog/google-maps-as-an-angular-component
Beta Was this translation helpful? Give feedback.
All reactions