I have used 'ngx-leaflet' in angular 4~7 without error. But I got errors when I adopt 'ngx-leaflet' to angular v8 template that I purchased (apex admin template). Actually I have no idea where error is happening.
I saw same issue in 'apex admin' template ( https://github.com/Asymmetrik/ngx-leaflet/issues/172 ), but that issue is closed without solution. I think problem is caused by this template than 'ngx-leaflet'.
After I installed successfully 'ngx-leaflet', I got following error messages when npm start :
_ERROR in node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(7,30): error TS2709: Cannot use namespace 'LatLng' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(10,10): error TS2314: Generic type 'Map<K, V>' requires 2 type argument(s).
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(15,14): error TS2709: Cannot use namespace 'MapOptions' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(16,28): error TS2314: Generic type 'Map<K, V>' requires 2 type argument(s).
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(19,13): error TS2709: Cannot use namespace 'LatLng' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(20,32): error TS2709: Cannot use namespace 'LatLng' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(21,16): error TS2709: Cannot use namespace 'LatLngBounds' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(22,16): error TS2709: Cannot use namespace 'LatLngBounds' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(25,27): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(26,33): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(27,31): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(28,29): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(29,31): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(30,31): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(31,30): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(32,29): error TS2709: Cannot use namespace 'LeafletEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(33,34): error TS2709: Cannot use namespace 'LeafletEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(34,32): error TS2709: Cannot use namespace 'LeafletEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(35,29): error TS2709: Cannot use namespace 'LeafletEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(36,34): error TS2709: Cannot use namespace 'LeafletEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(37,32): error TS2709: Cannot use namespace 'LeafletEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(43,15): error TS2314: Generic type 'Map<K, V>' requires 2 type argument(s).
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.wrapper.d.ts(7,15): error TS2314: Generic type 'Map<K, V>' requires 2 type argument(s).
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/base/leaflet-baselayers.directive.d.ts(19,25): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/base/leaflet-baselayers.directive.d.ts(21,46): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/base/leaflet-baselayers.directive.d.ts(23,25): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/base/leaflet-baselayers.directive.d.ts(25,35): error TS2694: Namespace '"leaflet"' has no exported member 'LayersOptions'.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/base/leaflet-baselayers.directive.d.ts(26,46): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers-config.model.d.ts(4,25): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers-config.model.d.ts(7,25): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.directive.d.ts(19,46): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.directive.d.ts(20,44): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.directive.d.ts(23,46): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(6,38): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(7,56): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(8,72): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(9,33): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(10,60): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(11,60): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(12,58): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layer.directive.d.ts(13,12): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layer.directive.d.ts(14,25): error TS2709: Cannot use namespace 'LeafletEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layer.directive.d.ts(15,28): error TS2709: Cannot use namespace 'LeafletEvent' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layers.directive.d.ts(22,18): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layers.directive.d.ts(23,34): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layers.directive.d.ts(24,13): error TS2709: Cannot use namespace 'Layer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-tile-layer-definition.model.d.ts(14,67): error TS2709: Cannot use namespace 'TileLayer' as a type.
node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-tile-layer-definition.model.d.ts(25,24): error TS2709: Cannot use namespace 'TileLayer' as a type.
nodemodules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-tile-layer-definition.model.d.ts(32,24): error TS2709: Cannot use namespace 'TileLayer' as a type.
I have used 'ngx-leaflet' in angular 4~7 without error. But I got errors when I adopt 'ngx-leaflet' to angular v8 template that I purchased (apex admin template). Actually I have no idea where error is happening. I saw same issue in 'apex admin' template ( https://github.com/Asymmetrik/ngx-leaflet/issues/172 ), but that issue is closed without solution. I think problem is caused by this template than 'ngx-leaflet'.
After I installed successfully 'ngx-leaflet', I got following error messages when npm start : _ERROR in node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(7,30): error TS2709: Cannot use namespace 'LatLng' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(10,10): error TS2314: Generic type 'Map<K, V>' requires 2 type argument(s). node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(15,14): error TS2709: Cannot use namespace 'MapOptions' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(16,28): error TS2314: Generic type 'Map<K, V>' requires 2 type argument(s). node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(19,13): error TS2709: Cannot use namespace 'LatLng' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(20,32): error TS2709: Cannot use namespace 'LatLng' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(21,16): error TS2709: Cannot use namespace 'LatLngBounds' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(22,16): error TS2709: Cannot use namespace 'LatLngBounds' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(25,27): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(26,33): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(27,31): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(28,29): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(29,31): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(30,31): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(31,30): error TS2709: Cannot use namespace 'LeafletMouseEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(32,29): error TS2709: Cannot use namespace 'LeafletEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(33,34): error TS2709: Cannot use namespace 'LeafletEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(34,32): error TS2709: Cannot use namespace 'LeafletEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(35,29): error TS2709: Cannot use namespace 'LeafletEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(36,34): error TS2709: Cannot use namespace 'LeafletEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(37,32): error TS2709: Cannot use namespace 'LeafletEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.d.ts(43,15): error TS2314: Generic type 'Map<K, V>' requires 2 type argument(s). node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/core/leaflet.directive.wrapper.d.ts(7,15): error TS2314: Generic type 'Map<K, V>' requires 2 type argument(s). node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/base/leaflet-baselayers.directive.d.ts(19,25): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/base/leaflet-baselayers.directive.d.ts(21,46): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/base/leaflet-baselayers.directive.d.ts(23,25): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/base/leaflet-baselayers.directive.d.ts(25,35): error TS2694: Namespace '"leaflet"' has no exported member 'LayersOptions'. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/base/leaflet-baselayers.directive.d.ts(26,46): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers-config.model.d.ts(4,25): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers-config.model.d.ts(7,25): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.directive.d.ts(19,46): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.directive.d.ts(20,44): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.directive.d.ts(23,46): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(6,38): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(7,56): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(8,72): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(9,33): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(10,60): error TS2694: Namespace '"leaflet"' has no exported member 'Layers'. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(11,60): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/control/leaflet-control-layers.wrapper.d.ts(12,58): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layer.directive.d.ts(13,12): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layer.directive.d.ts(14,25): error TS2709: Cannot use namespace 'LeafletEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layer.directive.d.ts(15,28): error TS2709: Cannot use namespace 'LeafletEvent' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layers.directive.d.ts(22,18): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layers.directive.d.ts(23,34): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-layers.directive.d.ts(24,13): error TS2709: Cannot use namespace 'Layer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-tile-layer-definition.model.d.ts(14,67): error TS2709: Cannot use namespace 'TileLayer' as a type. node_modules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-tile-layer-definition.model.d.ts(25,24): error TS2709: Cannot use namespace 'TileLayer' as a type. nodemodules/@asymmetrik/ngx-leaflet/dist/leaflet/layers/leaflet-tile-layer-definition.model.d.ts(32,24): error TS2709: Cannot use namespace 'TileLayer' as a type.
And please refer to 'package.json' : _"dependencies": { "@agm/core": "1.0.0-beta.5", "@angular/animations": "8.0.0", "@angular/common": "8.0.0", "@angular/compiler": "8.0.0", "@angular/core": "8.0.0", "@angular/forms": "8.0.0", "@angular/platform-browser": "8.0.0", "@angular/platform-browser-dynamic": "8.0.0", "@angular/platform-server": "8.0.0", "@angular/router": "8.0.0", "@asymmetrik/ngx-leaflet": "^6.0.1", "@ng-bootstrap/ng-bootstrap": "4.1.3", "@ng-select/ng-select": "2.20.0", "@ngrx/store": "7.4.0", "@ngx-translate/core": "11.0.1", "@ngx-translate/http-loader": "4.0.0", "@swimlane/ngx-charts": "11.1.0", "@swimlane/ngx-datatable": "15.0.2", "@types/chartist": "0.9.46", "@types/d3-shape": "1.3.1", "@types/dragula": "2.1.34", "angular-archwizard": "4.0.0", "angular-calendar": "0.27.8", "bootstrap": "4.3.1", "chart.js": "2.8.0", "chartist": "0.11.2", "classlist.js": "1.1.20150312", "core-js": "3.1.3", "d3": "5.9.2", "datatables.net": "1.10.19", "date-fns": "1.30.1", "gulp": "4.0.2", "hopscotch": "0.3.1", "intl": "1.2.5", "leaflet": "^1.5.1", "moment": "2.24.0", "ng-chartist": "3.1.0", "ng2-charts": "2.2.3", "ng2-completer": "2.0.8", "ng2-dragula": "2.1.1", "ng2-file-upload": "1.3.0", "ng2-img-cropper": "0.9.0", "ng2-nouislider": "1.8.2", "ng2-smart-table": "1.4.0", "ng2-validation": "4.2.0", "ngx-chips": "2.0.0-beta.0", "ngx-perfect-scrollbar": "7.2.1", "ngx-quill": "5.1.0", "ngx-toastr": "10.0.4", "ngx-ui-switch": "8.0.1", "node-sass": "4.12.0", "nouislider": "13.1.5", "prismjs": "1.16.0", "quill": "1.3.6", "resize-observer-polyfill": "1.5.1", "rxjs": "6.5.2", "screenfull": "4.2.0", "sweetalert2": "8.11.6", "tslib": "1.9.3", "videogular2": "6.4.0", "web-animations-js": "github:angular/web-animations-js#releasepr208", "zone.js": "~0.9.1" }, "devDependencies": { "@angular-devkit/build-angular": "~0.800.0", "@angular/cli": "8.0.0", "@angular/compiler-cli": "8.0.0", "@angular/language-service": "8.0.0", "@types/core-js": "2.5.0", "@types/jasmine": "3.3.13", "@types/leaflet": "^1.5.1", "@types/node": "12.0.3", "codelyzer": "5.0.1", "jasmine-core": "3.4.0", "jasmine-spec-reporter": "4.2.1", "karma": "4.1.0", "karma-chrome-launcher": "2.2.0", "karma-cli": "~2.0.0", "karma-coverage-istanbul-reporter": "2.0.5", "karma-jasmine": "2.0.1", "karma-jasmine-html-reporter": "1.4.2", "protractor": "5.4.2", "rxjs-compat": "6.5.2", "ts-node": "8.2.0", "tslint": "5.16.0", "typescript": "3.4.5" }
Please give me a clue for solving issue.
Thanks,