angular-ui / ui-leaflet

AngularJS directive to embed an interact with maps managed by Leaflet library
http://angular-ui.github.io/ui-leaflet
Other
315 stars 137 forks source link

require.js and commonjs issue & couch potato lazy loading not working #121

Open nmccready opened 8 years ago

nmccready commented 8 years ago

From @cscrum on September 29, 2015 21:58

I have a project using require.js and couch potato to perform lazy loading for the modules. For some reason, when using the latest version of angular-leaflet with the simple-logging, the entire application will fail to load when I try to include the leaflet-directive in the controller for the map. Using a version prior to the simple-logging requirement works except I'm having the old resizing issue so I want to try the new version. Here are some code snippets...

This is setting up the module:

define(['angular',
    'angular-couch-potato',
    'angular-ui-router',
    'ng-table',
    'ngStorage',
    'nemLogging',
    'treeControl',
    'ng-file-upload',
    'leaflet',
    'vincenty',
    'leaflet-directive',
    'd3',
    'line-chart',
    'angular-bootstrap',
    'Bing'
    ], function (ng, couchPotato) {

    "use strict";

    var module = ng.module('app.network', ['ui.router', 'ngTable','ngStorage','treeControl','ngFileUpload','n3-charts.linechart','ui.bootstrap.modal','leaflet-directive']);

    couchPotato.configureApp(module);

    module.config(function ($stateProvider, $couchPotatoProvider) {....

If I remove 'leaflet-directive' from the var module = ng.module('app.network', ['ui.router', 'ngTable','ngStorage','treeControl','ngFileUpload','n3-charts.linechart','ui.bootstrap.modal','leaflet-directive']);

then the application loads, but of course mapping doesn't work. If I simply replace the new angular-leaflet.js with an older version of the file and include the 'leaflet-directive', the the mapping works, however I have resizing issues. Any ideas out there?

Copied from original issue: tombatossals/angular-leaflet-directive#965

nmccready commented 8 years ago

Try the latest angular-simple-logger as it is now wrapped in a function.

nmccready commented 8 years ago

Actually the problem is probably related to this; https://github.com/nmccready/angular-simple-logger/issues/7 .

nmccready commented 8 years ago

Please see the work arounds and I will try to get to fixing it better.

nmccready commented 8 years ago

This is a valid dependency bug please see the issue stated above as it states the workarounds and the situation.

nmccready commented 8 years ago

@tombatossals can we add a new label for dependency bug?

nmccready commented 8 years ago

There are updates to this on angular-simple-logger using the PR'd branch as a test bed for you would help me out.

nmccready commented 8 years ago

From @cscrum on September 30, 2015 23:58

I loaded an older version of logger and it all works. I don't really need the logging anyway, so that works out for now. I'd love to try to help but have a really tight deadline for this. In a couple weeks I'll revisit and let you know.