-
Notifications
You must be signed in to change notification settings - Fork 821
google.maps.MouseEvent returns "r" #2047
Description
Issue description
google.maps.MouseEvent does not return appropriate object, instead returns "r"
Steps to reproduce and a minimal demo of the problem
-
create a new angular project
-
npm install @agm/core (installs 3.0.0-beta.0)
-
create a component that uses
<agm-map [latitude]="latitude" [longitude]="longitude" [zoom]="zoom"(mapRightClick)="onMapRightClick($event)"></agm-map>
-
create a function mapped to the
mapRightClick
output
public onMapRightClick(event: google.maps.MouseEvent): void {
console.log("event: ", event); // <-- returns "r" ??
const lat = event.latLng.lat(); // latLng results in undefined (should be defined)
}
_Use stackblitz.com or similar -- try this template as a starting point: https://stackblitz.com/edit/angular-google-maps-demo
^ this stackblitz.com template uses an OLD VERSION OF THE AGM/CORE DEPENDENCIES "@agm/core": "1.0.0",
and is not useful for troubleshooting.
What steps should we try in your demo to see the problem?
Current behavior
google.maps.MouseEvent returns "r" resulting in event.latLng
to be undefined
Expected/desired behavior
google.maps.MouseEvent should return appropriate event information so that I may collect latLng data , latLng should not be undefined.
angular-google-maps, Angular, & any other relevant dependency versions
"dependencies": {
"@agm/core": "^3.0.0-beta.0",
"@angular/animations": "^10.0.0",
"@angular/cdk": "^9.2.4",
"@angular/common": "^10.0.0",
"@angular/compiler": "^10.0.0",
"@angular/core": "^10.0.0",
"@angular/forms": "^10.0.0",
"@angular/localize": "^10.0.0",
"@angular/platform-browser": "^10.0.0",
"@angular/platform-browser-dynamic": "^10.0.0",
"@angular/router": "^10.0.0",
"@ng-bootstrap/ng-bootstrap": "^7.0.0",
"@types/googlemaps": "3.39.12",
"bootstrap": "^4.5.3",
"ngx-quill": "^12.0.0",
"quill": "^1.3.7",
"rxjs": "^6.5.5",
"tslib": "^1.14.1",
"zone.js": "^0.10.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.1002.0",
"@angular/cli": "^10.0.0",
"@angular/compiler-cli": "^10.0.0",
"@angular/language-service": "^9.0.7",
"@types/jasmine": "^3.5.14",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.19.3",
"codelyzer": "^6.0.2",
"jasmine-core": "^3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "5.2.3",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.5.4",
"protractor": "7.0.0",
"ts-node": "~8.3.0",
"tslint": "~5.18.0",
"typescript": "~4.0.0"
}
Other information