my own attemp on creating an Angular io leaflet v1.x component
Live examples
all examples sources code can be found here
Bare in mind that I just started developing this and I don't have much time to plan things ahead
mainly due to not enough free time, so I am making changes as I go
Install
npm install ngx.leaflet.components
in SystemJs use the following configuration
transpiler: 'typescript',
map: {
'ngx.leaflet.components': 'npm:ngx.leaflet.components',
},
packages: {
'ngx.leaflet.components': {
main: './index',
defaultExtension: 'js',
meta: {
"format": "register"
}
}
},
"ts": {
"main": "plugin.js"
},
"typescript": {
"main": "typescript.js",
"meta": {
"lib/typescript.js": {
"exports": "ts"
}
}
}
I haven't tested it with other transpilers save for typescript, thats why I am including it on the SystemJs config
then on you app module include this
import { CandTLeafletComponent } from 'ngx.leaflet.components';
import { CandTLeafletService } from 'ngx.leaflet.components';
import { AppComponent } from './components/app.component';
@NgModule({
imports: [... ],
declarations: [..., CandTLeafletComponent],
providers: [CandTLeafletService],
bootstrap: [AppComponent]
})
Leaflet stylesheet is not included, so you need to add it yourself
for usage check the wiki
https://github.com/elasticrash/ngx.leaflet.component/wiki
If anyone wants to help in any way feel free to do a fork and a pull request