infusion-code / angular-maps

Angular Maps (X-Map) is a set of components and services to provide map functionality in angular 2+ apps. X-Maps architecture is provider independent and can be used with Bing, Google, ESRI or any other service enabled mapping provider. X-Map contains a default implementation for Bing Maps.
MIT License
41 stars 34 forks source link

Infobox click event error #107

Closed Arxk closed 4 years ago

Arxk commented 5 years ago

Hi, I've followed the instructions to add the library to my angular project.

There is only one problem so far and it's that I'm getting an error when I try to click a Marker. It happens both on Bing and Google. There must an incompatibility or something, but I'm lost.

When I test another sample (without markers) like the edit polygon one, the Click and DoubleClick events work as expected. It's only on the Marker Infobox.

My code is word for word as the one on the example: https://stackblitz.com/edit/bing-basic-map-with-single-marker

Below are the error details and the package.json of my project. Hope I can get some help.

Uncaught TypeError: Object(...) is not a function
    at SafeSubscriber.eval [as _next] (angular-maps.js:9229)
    at SafeSubscriber.__tryOrUnsub (Subscriber.js:238)
    at SafeSubscriber.next (Subscriber.js:185)
    at Subscriber._next (Subscriber.js:125)
    at Subscriber.next (Subscriber.js:89)
    at eval (angular-maps.js:18471)
    at ZoneDelegate.invoke (zone.js:392)
    at Object.onInvoke (core.js:4753)
    at ZoneDelegate.invoke (zone.js:391)
    at Zone.run (zone.js:142)
  _
(anonymous) @ angular-maps.js:9229
SafeSubscriber.__tryOrUnsub @ Subscriber.js:238
SafeSubscriber.next @ Subscriber.js:185
Subscriber._next @ Subscriber.js:125
Subscriber.next @ Subscriber.js:89
(anonymous) @ angular-maps.js:18471
ZoneDelegate.invoke @ zone.js:392
onInvoke @ core.js:4753
ZoneDelegate.invoke @ zone.js:391
Zone.run @ zone.js:142
NgZone.run @ core.js:4570
(anonymous) @ angular-maps.js:18471
Qd.A @ js?callback=Create&k…RCk63K9CAj72-m8:173
_.R.trigger @ js?callback=Create&k…RCk63K9CAj72-m8:170
(anonymous) @ marker.js:28
Qd.A @ js?callback=Create&k…RCk63K9CAj72-m8:173
_.R.trigger @ js?callback=Create&k…RCk63K9CAj72-m8:170
onClick @ marker.js:22
_.p.onClick @ common.js:135
J._.Sm.Qa @ common.js:63
ZoneDelegate.invokeTask @ zone.js:425
Zone.runTask @ zone.js:192
ZoneTask.invokeTask @ zone.js:499
invokeTask @ zone.js:1540
globalZoneAwareCallback @ zone.js:1566
{
  "name": "ng2project",
  "version": "1.9.3",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "start-en": "ng serve --sourcemap=false --aot --locale en",
    "start-es": "ng serve --sourcemap=false --aot --locale es-us --i18n-format xlf --i18n-file src/i18n/messages.es.xlf",
    "build": "ng build",
    "test-models": "mocha tests -r ts-node/register tests/models/*.spec.ts --reporter mochawesome",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "i18n": "ng xi18n --output-path src/i18n --i18nFormat=xlf -p ./tsconfig.json --locale en && xliffmerge --profile xliffmerge.json en es",
    "build-i18n:en": "ng build --no-extract-licenses --output-path dist/en --prod --aot --bh /en/ --locale en",
    "build-i18n:es": "ng build --no-extract-licenses --output-path dist/es --prod --aot --bh /es/ --locale es-us --i18n-format xlf --i18n-file src/i18n/messages.es.xlf",
    "build-i18n": "npm run build-i18n:en && npm run build-i18n:es && cp landing.html dist/index.html && cp -r src/assets dist/assets",
    "copy-index": "cp landing.html dist/index.html"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~5.1.0",
    "@angular/cdk": "~5.2.4",
    "@angular/common": "~5.1.0",
    "@angular/compiler": "~5.1.0",
    "@angular/core": "~5.1.0",
    "@angular/forms": "~5.1.0",
    "@angular/http": "~5.1.0",
    "@angular/material": "~5.2.4",
    "@angular/platform-browser": "~5.1.0",
    "@angular/platform-browser-dynamic": "~5.1.0",
    "@angular/platform-server": "~5.1.0",
    "@angular/router": "~5.1.0",
    "@swimlane/dragula": "^3.7.3",
    "@swimlane/ngx-charts": "^7.0.1",
    "@swimlane/ngx-dnd": "~5.0.6",
    "angular-maps": "^6.0.1",
    "angular-material": "^1.1.10",
    "angular-timezone-selector": "^1.2.1",
    "angular2-jwt": "^0.2.3",
    "angulartics2": "^4.6.3",
    "core-js": "^2.4.1",
    "d3": "^4.10.0",
    "hammerjs": "^2.0.8",
    "jquery": "^3.2.1",
    "material-design-lite": "^1.3.0",
    "moment": "^2.20.1",
    "moment-timezone": "^0.5.14",
    "ng-drag-drop": "^4.0.1",
    "ng2-timezone-selector": "^0.1.4",
    "ngx-color-picker": "^5.3.8",
    "ngx-openlayers": "^0.8.22",
    "ngx-tooltip": "0.0.9",
    "ngx-tooltip-selectable": "^0.1.22",
    "rxjs": "5.5.2",
    "sass-loader": "^6.0.6",
    "select2": "^4.0.6-rc.1",
    "time-ago-pipe": "^1.3.2",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "^1.7.4",
    "@angular/compiler-cli": "~5.1.0",
    "@types/chai": "^4.1.7",
    "@types/googlemaps": "^3.30.19",
    "@types/mocha": "^5.2.6",
    "@types/node": "~6.0.60",
    "bingmaps": "^2.0.3",
    "chai": "^4.2.0",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "^1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^0.2.3",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-mocha": "^1.3.0",
    "mocha": "^6.1.4",
    "mochawesome": "^3.1.2",
    "ngx-i18nsupport": "^0.9.0",
    "protractor": "^5.4.1",
    "sinon-chai": "^3.3.0",
    "ts-node": "^8.1.0",
    "tslint": "~4.5.0",
    "typescript": "^3.4.5",
    "webpack-dev-server": "^2.5.1"
  }
}
thor-schueler commented 4 years ago

Hard to tell without seeing your code. Can you post it? If you copied from the stackblitz example, is it possible that a funky character got introduced in the process? Make sure that the click method specified in the component.html matches the one in the component.ts.

thor-schueler commented 4 years ago

@Arxk : did you resolve your issue? As I said, without some code it is hard to provide input. Please advise so that we can resolve this issue.

Arxk commented 4 years ago

@thor-schueler Hello. I copied the code verbatim from the example on to an empty component in my project. I'm not sure what other code I could provide besides my dependencies; the other examples are working. If you have no clue about it, is probably something weird on my environment but I couldn't figure out what. Regardless, thank you for trying to help.