angular-material-extensions / google-maps-autocomplete

Autocomplete input component and directive for google-maps built with angular and material design |
https://angular-material-extensions.github.io/google-maps-autocomplete
MIT License
169 stars 60 forks source link

Generic Type 'MapHandlerMap<T> requires 1 type argument #304

Closed sky-future closed 5 months ago

sky-future commented 3 years ago

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

OS and Version?

Versions

Repro steps

The log given by the failure

ERROR in node_modules/@agm/core/lib/services/google-maps-api-wrapper.d.ts:51:41 - error TS2314: Generic type 'MapHandlerMap<T>' requires 1 type argument(s).

51     subscribeToMapEvent<N extends keyof google.maps.MapHandlerMap>(eventName: N): Observable<google.maps.MapHandlerMap[N]>;
                                           ~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@agm/core/lib/services/google-maps-api-wrapper.d.ts:51:94 - error TS2314: Generic type 'MapHandlerMap<T>' requires 1 type argument(s).

51     subscribeToMapEvent<N extends keyof google.maps.MapHandlerMap>(eventName: N): Observable<google.maps.MapHandlerMap[N]>;
                                                                                                ~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@agm/core/lib/services/managers/marker-manager.d.ts:26:93 - error TS2694: Namespace 'google.maps' has no exported member 'MarkerMouseEventNames'.

26     createEventObservable<T extends (google.maps.MouseEvent | void)>(eventName: google.maps.MarkerMouseEventNames | google.maps.MarkerChangeOptionEventNames, marker: AgmMarker): Observable<T>;
                                                                                               ~~~~~~~~~~~~~~~~~~~~~
node_modules/@agm/core/lib/services/managers/marker-manager.d.ts:26:129 - error TS2694: Namespace 'google.maps' has no exported member 'MarkerChangeOptionEventNames'.

26     createEventObservable<T extends (google.maps.MouseEvent | void)>(eventName: google.maps.MarkerMouseEventNames | google.maps.MarkerChangeOptionEventNames, marker: AgmMarker): Observable<T>;
                                                                                                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ADarkDividedGem commented 3 years ago

I had the same issue and I think this helped: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/48574#issuecomment-711411465

sky-future commented 3 years ago

I had the same issue and I think this helped: DefinitelyTyped/DefinitelyTyped#48574 (comment)

It is already like this ! I have Core : 3.0.0-beta.0 and googlemaps 3.39.12

AnthonyNahas commented 3 years ago

May you post your package.json file ?

sky-future commented 3 years ago

{ "name": "p-gestion-helha-web-client", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@agm/core": "^3.0.0-beta.0", "@angular-material-extensions/google-maps-autocomplete": "^6.0.0", "@angular/animations": "^10.2.2", "@angular/cdk": "^10.2.7", "@angular/common": "^10.2.2", "@angular/compiler": "^10.2.2", "@angular/core": "^10.2.2", "@angular/flex-layout": "^10.0.0-beta.32", "@angular/forms": "^10.2.2", "@angular/google-maps": "^11.0.1", "@angular/localize": "^10.2.2", "@angular/material": "^10.2.7", "@angular/platform-browser": "^10.2.2", "@angular/platform-browser-dynamic": "^10.2.2", "@angular/router": "^10.2.2", "@auth0/angular-jwt": "^5.0.1", "@ng-bootstrap/ng-bootstrap": "^8.0.0", "@types/jquery": "^3.5.4", "angular-bootstrap-md": "^10.0.0", "bootstrap": "^4.5.0", "jquery": "^3.5.1", "js-sha256": "^0.9.0", "rxjs": "~6.6.0", "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-devkit/build-angular": "~0.1002.0", "@angular/cli": "~10.2.0", "@angular/compiler-cli": "^10.2.2", "@types/googlemaps": "^3.39.12", "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.19.3", "codelyzer": "^6.0.0", "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "karma": "~5.0.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "protractor": "~7.0.0", "ts-node": "~8.3.0", "tslint": "~6.1.0", "typescript": "^4.0.5" } }

HernanVilar commented 3 years ago

Pudiste agregarlo? tengo el mismo problema.

Martin-Eckleben commented 3 years ago

Same. Fresh Project. Can I provide anything to help?

"dependencies": {
  "@agm/core": "^3.0.0-beta.0",
  "@angular-material-extensions/google-maps-autocomplete": "^6.2.1",
  "@angular/animations": "^12.0.5",
  "@angular/cdk": "^12.1.3",
  "@angular/common": "~12.0.5",
  "@angular/compiler": "~12.0.5",
  "@angular/core": "~12.0.5",
  "@angular/flex-layout": "^12.0.0-beta.34",
  "@angular/forms": "^12.0.5",
  "@angular/material": "^12.1.3",
  "@angular/platform-browser": "~12.0.5",
  "@angular/platform-browser-dynamic": "~12.0.5",
  "@angular/router": "~12.0.5",
  "rxjs": "~6.6.0",
  "tslib": "^2.1.0",
  "zone.js": "~0.11.4"
},
"devDependencies": {
  "@angular-devkit/build-angular": "~12.0.5",
  "@angular/cli": "~12.0.5",
  "@angular/compiler-cli": "~12.0.5",
  "@types/googlemaps": "^3.43.3",
  "@types/jasmine": "~3.6.0",
  "@types/node": "^12.11.1",
  "jasmine-core": "~3.7.0",
  "karma": "~6.3.0",
  "karma-chrome-launcher": "~3.1.0",
  "karma-coverage": "~2.0.3",
  "karma-jasmine": "~4.0.0",
  "karma-jasmine-html-reporter": "^1.5.0",
  "typescript": "~4.2.3"
}
Martin-Eckleben commented 3 years ago

Seems it's a problem in the typings and its known.

https://github.com/DefinitelyTyped/DefinitelyTyped/issues/48574

Does not happen with "@types/googlemaps": "^3.39.12".