Once you have your KEY, go to the
index.html file and at the end you will see the following script. You need to replace YOUR_GOOGLE_MAPS_KEY with your own KEY.
npm install @types/googlemaps
We created a
GoogleMapComponent that you can find in
src/app/components/google-map/google-map.component.ts that will do the magic for you.
This component has the map and the logic to init the map. So, from the page you want to show you map you will add a reference to it:
@ViewChild(GoogleMapComponent) _GoogleMap: GoogleMapComponent;
For this feature we use the Capacitor Geolocation plugin to get the current position of the device and then we show a marker in the map.