nativescript-google-maps-utils icon indicating copy to clipboard operation
nativescript-google-maps-utils copied to clipboard

app crashed when setupMarkerCluster in Angular

Open sedrak1987 opened this issue 6 years ago • 3 comments

app crashed when setupMarkerCluster in NS Angular app

sedrak1987 avatar Sep 29 '18 07:09 sedrak1987

@sedrak1987 remove this mapView._markers.push(marker); statement form this method setupMarkerCluster() in index.android.ts

fawadmukhtar avatar Oct 09 '18 06:10 fawadmukhtar

dear where is index.android.ts file?(maybe in node_modules, if yes, then why I must change core files)

sedrak1987 avatar Oct 17 '18 07:10 sedrak1987

I have the same issue , the app is crashing in setupMarkerCluster method call.

The crash seems to happen in this line of index.android.js:

clusterManager.addItem(markerItem);

If I comment that line, the app won´t crash but obviously no marks are displayed.

Note: occasionally I have seen the app working fine in the emulator (no crash, cluster displayed) by removing the comment to the line that was crashing (hot reload). However, stopping and deploying again the app in the emulator or building the apk and testing in a real device will make it crash again.

Testing on NativeScript 5, Angular project that just has a home component with the map and a function to add markers on map ready event (similar to the demo project). More info from package.json:

    "nativescript": {
        "id": "org.nativescript.testmaps",
        "tns-android": {
            "version": "5.4.0"
        },
        "tns-ios": {
            "version": "5.4.2"
        }
    },
    "description": "NativeScript Application",
    "license": "SEE LICENSE IN <your-license-filename>",
    "repository": "<fill-your-repository-here>",
    "dependencies": {
        "@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/http": "~8.0.0-beta.10",
        "@angular/platform-browser": "~8.0.0",
        "@angular/platform-browser-dynamic": "~8.0.0",
        "@angular/router": "~8.0.0",
        "nativescript-angular": "~8.0.0",
        "nativescript-geolocation": "^5.1.0",
        "nativescript-google-maps-sdk": "2.6.1",
        "nativescript-google-maps-utils": "^0.1.3",
        "nativescript-theme-core": "~1.0.4",
        "reflect-metadata": "~0.1.12",
        "rxjs": "~6.5.0",
        "tns-core-modules": "~5.4.0",
        "zone.js": "~0.9.1"
    },
    "devDependencies": {
        "@angular/compiler-cli": "~8.0.0",
        "@ngtools/webpack": "~8.0.0",
        "nativescript-dev-typescript": "~0.10.0",
        "nativescript-dev-webpack": "~0.24.0"
    },

It would be very good to have this working since this is a useful feature and no other NativeScript plugin seems to exist that provides clustering and heatmaps functionality.

kandangit avatar Apr 26 '20 22:04 kandangit