yagajs / leaflet-ng2

Angular.io integration of Leaflet
https://leaflet-ng2.yagajs.org
ISC License
66 stars 26 forks source link

Proper way of using with angular-cli #434

Open bpatrik opened 5 years ago

bpatrik commented 5 years ago

Hi,

I'm using your nice leaflet lib for my hobby project and I found it difficult to integrate it with angular-cli.

I figured that leaflet-ng2 has a dependency on leaflet, so I do not need to include / npm install that source explicitly, but I found tricky to add the css and marker images to the project.

Based on this, I've added the css and images the following way:

"assets": [
 {
   "glob": "**/*",
   "input": "./node_modules/leaflet/dist/images",
   "output": "assets/leaflet"
 },
 ...
],
"styles": [
 "node_modules/leaflet/dist/leaflet.css",
  ...
]

but then I need to rewrite the default path for the markers for what I could not found any nice way.

I've ended up adding the css from a cdn and not through the angular-cli, but It would be nice if I could use it with the cli.

Thank you for your help!

Best, Patrik