Using leaflet on custon app plugin


#1

hi,

im creating a custom app plugin on kibana

the idea is to add a map using leaflet

this the content of my controller :

//leaflet
angular.extend($scope, {
    london: {
        lat: 51.505,
        lng: -0.09,
        zoom: 8
    },
    defaults: {
        tileLayer: "http://{s}.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png",
        tileLayerOptions: {
            opacity: 0.9,
            detectRetina: true,
            reuseTiles: true,
        },
        scrollWheelZoom: false
    }
});    

in my template :

<leaflet center="london" defaults="defaults" width=400 height=400></leaflet>

i have no error and i don't have the map too.

any idea?


#2

after installing

npm install ui-leaflet
npm install angular-simple-logger
import nemLogging from 'angular-simple-logger';
import leaflet from 'ui-leaflet';
var app = uiModules.get('app/appname', ['nemLogging', 'ui-leaflet'])

i get

Uncaught TypeError: angular.module is not a function (https://localhost:5601/ngb/bundles/..

so if i replace

import nemLogging 'angular-simple-logger';

with

import './lib/angular-simple-logger/dist/index.js';

i get the same error

or if test light one

import ‘./lib/angular-simple-logger/dist/index.light.js’;

i get this error

 ReferenceError: L is not defined

any idea?


#3

use 5.0 branch

full sample from the gist of Reefstah


#4

yeah

full discuss


(system) #5