An open API service indexing awesome lists of open source software.

https://github.com/its-prithvi-raj/angular-mapit

Googlemap using angular.
https://github.com/its-prithvi-raj/angular-mapit

agm angular angular-framework javascript mapit mouseevent scss typescript

Last synced: 6 months ago
JSON representation

Googlemap using angular.

Awesome Lists containing this project

README

          

# 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](https://developers.google.com/maps/documentation/javascript/get-api-key). πŸ›ŽοΈ

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

# Tools used 🧰

* [Angular framework, CLI ver 11.0.4](https://angular.io/)
* [Bootstrap cdn](https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css)
* [Angular Google Maps (AGM)](https://angular-maps.com/)
* [@types/googlemaps](https://www.npmjs.com/package/@types/googlemaps)

# 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 :

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

Cheers!! πŸ₯‚