1.0.1 • Published 7 years ago

ngx-leaflet-fa-markers v1.0.1

Weekly downloads
8
License
Apache-2.0
Repository
github
Last release
7 years ago

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);