ng2-ui / map

Angular Google Maps Directives
https://ng2-ui.github.io/map
260 stars 98 forks source link

error TS2345 #275

Open j-Cis opened 6 years ago

j-Cis commented 6 years ago

I found an example of how to use a cluster that I really like(https://stackblitz.com/edit/angular-jbp2yc), but it only working in Stackblitz, when I tried to implement it, pop up ugly errors the author of this example is: @aitboudad;

Steps to reproduce on new project in Angular 6, I copied this example and just started it (after having installed the necessary items)

My Errors

Date: 2018-07-01T21:32:22.946Z - Hash: a87281cf4effd67eacc9 - Time: 3655ms
4 unchanged chunks
chunk {main} main.js, main.js.map (main) 239 kB [initial] [rendered]
i 「wdm」: Compiled successfully.
ERROR in src/app/core/markerclusterer.ts(362,19): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
src/app/core/markerclusterer.ts(1108,23): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
src/app/core/markerclusterer.ts(1109,23): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.

I do not understand what this compiler is clinging to something, when on Stackblitz this example works

andreipaz commented 6 years ago

Maybe the stackblitz compiler is not so strict as in ng cli. Did you try to just ".toString()" the value?