Skip to content

alexandre-melard/ngx-leaflet-fa-markers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leaflet-fa-markers npm-url

Very simple markers with FontAwesome icons, compatible with Leaflet v1.

Screenshot

Use:

import the css file for exemple in .angular-cli.json

      "styles": [
        "../node_modules/ngx-leaflet-fa-markers/fontAwesomeIcon.css"
      ],
import { FontAwesomeOptions, FontAwesomeIcon } from 'leaflet-fa-markers/index';
// ...
const lat = map.getBounds().getCenter().lat;
const lng = map.getBounds().getCenter().lng;
const iconOption: FontAwesomeOptions = {
  iconClasses: 'fa fa-info-circle', // you _could_ add other icon classes, not tested.
  // iconColor: '#F00',
  iconUrl: '../assets/marker-icon.png',
  shadowUrl: '../assets/marker-shadow.png'
};

const icon = new FontAwesomeIcon(iconOption);
const marker = new L.Marker([ lat, lng], {
  icon: icon,
  draggable: true});
marker.addTo(map);
import { FontAwesomeOptions, FontAwesomeIcon } from 'leaflet-fa-markers/index';
// ...
const lat = map.getBounds().getCenter().lat;
const lng = map.getBounds().getCenter().lng;
const iconOption: FontAwesomeOptions = {
  iconClasses: 'fa fa-circle-o-notch fa-spin', // you _could_ add other icon classes, not tested.
  // iconColor: '#F00',
  iconUrl: '../assets/marker-icon.png',
  shadowUrl: '../assets/marker-shadow.png'
};

const icon = new FontAwesomeIcon(iconOption);
const marker = new L.Marker([ lat, lng], {
  icon: icon,
  draggable: true});
marker.addTo(map);

About

typescript leaflet font awesome markers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published