I am currently unable to integrate the BeautifyMarker plugin with the ngx-leaflet
Angular 2 package.
I have followed the install instructions for BeautifyMarker alongside the ngx-leaflet plugin instructions with no luck.
I used npm install
to grab BeautifyMarker, Font Awesome, and already had Bootstrap installed. Leaflet is also already added and configured properly per the ngx-leaflet
official tutorial.
I edited my angular-cli.json
file to include the BeautyMarker .css and .js files, like so:
"styles": [
"styles.css",
"../node_modules/leaflet/dist/leaflet.css",
"../node_modules/font-awesome/css/font-awesome.css",
"../node_modules/bootstrap/dist/css/bootstrap.css",
"../node_modules/beautifymarker/leaflet-beautify-marker-icon.css"
],
"scripts": [
"../node_modules/leaflet/dist/leaflet.js",
"../node_modules/beautifymarker/leaflet-beautify-marker-icon.js",
], ...
I also imported the package entirely, as it extends L
, like so:
import * as L from 'leaflet';
import 'beautifymarker';
That didn't work, so I also tried:
import * as L from 'leaflet';
import '../../node_modules/beautifymarker/leaflet-beautify-marker-icon.js';
Also tried omitting the import altogether, a la the heatmap.js
plugin. None of these allow me to access L.BeautifyIcon
.
Any tips?