Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/kongulov/font-awesome-icons-for-google-maps

Font Awesome icons for google maps markers
https://github.com/kongulov/font-awesome-icons-for-google-maps

List: font-awesome-icons-for-google-maps

font-awesome google-maps svg-markers

Last synced: 3 months ago
JSON representation

Font Awesome icons for google maps markers

Awesome Lists containing this project

README

        

Font Awesome icons for google maps markers
=========

This code for use Font Awesome with Google Maps API and Google Places API using SVG markers and icon labels

![Screenshot](https://user-images.githubusercontent.com/33090344/39980359-986524fe-575c-11e8-997a-c48f41765457.png)

## Quick start

There are 2 ways to quickly download and use the code

- [Download the latest release](https://github.com/Ramiz4ik/Font-Awesome-icons-for-google-maps/archive/master.zip).
- Clone the repo: `git clone https://github.com/Ramiz4ik/Font-Awesome-icons-for-google-maps.git`.

## Usage
This code extends the [Google Maps Marker](https://developers.google.com/maps/documentation/javascript/reference#Marker) Object to enable either an image or SVG marker to be used with the icon placed on top as a label.

### Include

First, install the Font Awesome CDN and Google maps Api and map-font-icons.js
```html

```

### Classes

All classes you can find on the site [Font Awesome](https://fontawesome.com/icons?d=gallery)

```html

```
### Styling the Icon

Explict styles to icons being used on a Google Map should be applied with `.map-icon-label i` CSS selector.

```css
.map-icon-label i {
font-size: 24px;
color: #FFFFFF;
line-height: 55px;
text-align: center;
white-space: nowrap;
}
```

### Creating a Marker

Markers are created just like a normal Google Maps Marker, however, the class is extended for the `map_icon_label` property to add in markup for marker labels.

```js
var marker = new Marker({
map: map,
position: new google.maps.LatLng(40.394508, 49.7148762),
icon: {
path: MAP_PIN,
fillColor: '#9C27B0',
fillOpacity: 1,
strokeColor: '',
strokeWeight: 0
},
map_icon_label: ''
});
```