Closed gregnalor closed 4 years ago
OK - So, I figured it out a solution - not necessarily the best or correct. I'll leave it here for anyone interested. Would still be good to have a formal version in the NPM readme :-).
React/Typescript/ESLint environment...
import L from 'leaflet'
// eslint-disable-next-line (needed as we don't reference ExtraMarkers after the next line so ESLint complains)
import * as ExtraMarkers from 'leaflet-extra-markers'; // or else TS complains about the L extension
import '@fortawesome/fontawesome-free/css/all.css'; //e.g. using FA icons
import 'leaflet-extra-markers/dist/css/leaflet.extra-markers.min.css'; //import the LEM css
require( 'leaflet-extra-markers'); //Do the L extension.
Hi There,
Looks great - however I can't for the life of me work out how to get it working in an NPM environment. No matter what I do, I keep getting 'L.ExtraMarkers undefined' errors.
I'm not a newb but also not experienced in how to do NPM includes that override one another like leaflet and extra-markers.
Would it be possible to include a minimal NPM example in the readme?
Many thanks,
Greg.