ui.leaflet.layers.webpack

1.0.5 • Public • Published

ui.leaflet.layers.webpack

UI Leaflet Layers (https://github.com/elesdoar/ui-leaflet-layers) structured with webpack.

Install

Install with npm: npm install --save ui.leaflet.layers.webpack

Usage

require('ui.leaflet.layers.webpack');

angular.module('YourModule', ['ui-leaflet']);

Notes

This module already requires Leaflet, Ui-Leaflet and Leaflet MarkerCluster plugin, so don't require them again.

Also, the Leaflet global object 'L' is exposed through an angular value 'L':

angular.module('example', ['ui-leaflet'])
        .service('MyService', function(L){
            // L is the Leaflet global object. (Not global anymore :)
        });

Build Notes

This module was written with ES6, so you need a babel loader to build.

Install the babel-loader

npm install babel-loader babel-core babel-preset-es2015 webpack --save-dev

Add this loader into your webpack.config file

{
    test: /\.js$/,
    exclude: /(node_modules(?!\/(ui.leaflet.layers.webpack|ui.leaflet.webpack))|bower_components)/,
    loader: 'babel-loader?presets[]=es2015'
},

As this module requires some css files, you have to install a css loader.

Installing:

npm install --save-dev css-loader style-loader  

And configure the loader in webpack.config:

{ 
    test: /\.css$/, loader: "style-loader!css-loader" 
}

Package Sidebar

Install

npm i ui.leaflet.layers.webpack

Weekly Downloads

0

Version

1.0.5

License

MIT

Last publish

Collaborators

  • vmvini