Kshatriyaprithviraj / Angular-Mapit

Googlemap using angular.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mapit 🌎

A simple Angular framework based Google Maps with place search feature. πŸ—ΊοΈπŸ§­

Description πŸŽ€

A google map based on angular with draggable marker and place search bar to get address and laitude, longitude coordinates.

You've to use your own google API key and enable restrictions. In order to do, kindly, follow up this link. πŸ›ŽοΈ

Make sure to enable the Maps Javascript API (Show Map), Places API (Places search results) & Geocoding API (Convert Lat, Long to address). ⏰

Tools used 🧰

To run πŸƒ

  1. git clone https://github.com/Kshatriyaprithviraj/Angular-Mapit.git
  2. navigate to folder and run npm install
  3. open http://localhost:4200

Disclaimer ⚑

Depending upon the AGM version, you may get an error for Mouseevent on map when in use of markerDragEnd() method. For @agm/core version < 3.0, MouseEvent doesn't come anymore from @agm/core i.e., Usage will depend on the version of AGM. πŸ˜€

For the version that I've implemented i.e., @agm/core@3.0.0.beta, you've to use MouseEvent as follow :

mapClicked($event: google.maps.MouseEvent): void {
    this.markers.push({
      lat: $event.latLng.lat(),
      lng: $event.latLng.lng(),
      draggable: true
    });
  }

Cheers!! πŸ₯‚

About

Googlemap using angular.


Languages

Language:TypeScript 66.9%Language:JavaScript 14.5%Language:HTML 12.2%Language:SCSS 6.3%