Angular-google-maps: Cluster not working

Created on 30 Aug 2017  路  15Comments  路  Source: SebastianM/angular-google-maps

ERROR Error: Uncaught (in promise): Error: Template parse errors:
'agm-marker-cluster' is not a known element:

  1. If 'agm-marker-cluster' is an Angular component, then verify that it is part of this module.
  2. If 'agm-marker-cluster' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("le-map>-->

    [ERROR ->]
    "): ng:///MapModule/MapComponent.html@17:8
    Error: Template parse errors:
    'agm-marker-cluster' is not a known element:
discussion / question

Most helpful comment

I also had this problem in my ng-cli app (I specify this because it might be different than what systemjs requires).
I fixed it like this:

In my app.module.ts

1. import { AgmJsMarkerClustererModule, ClusterManager } from "@agm/js-marker-clusterer";
2. added ClusterManager to providers array in @NgModule decorator
3. added AgmJsMarkerClustererModule in imports array

All 15 comments

Have created sample example in plunker.
http://plnkr.co/edit/dqy8uWjRnMzDT6t0uJOK?p=preview

I also had this problem in my ng-cli app (I specify this because it might be different than what systemjs requires).
I fixed it like this:

In my app.module.ts

1. import { AgmJsMarkerClustererModule, ClusterManager } from "@agm/js-marker-clusterer";
2. added ClusterManager to providers array in @NgModule decorator
3. added AgmJsMarkerClustererModule in imports array

Just done what @cdarken has suggested also yarn add @agm/js-marker-clusterer
But now getting an error:

ERROR in ./node_modules/@agm/js-marker-clusterer/services/managers/cluster-manager.js
Module not found: Error: Can't resolve 'js-marker-clusterer' in 'c:\temp\some-app\node_modules\@agm\js-marker-clusterer\services\managers'
resolve 'js-marker-clusterer' in 'c:\temp\some-app\node_modules\@agm\js-marker-clusterer\services\managers'
Parsed request is a module using description file: c:\temp\some-app\node_modules\@agm\js-marker-clusterer\package.json (relative path: ./services/managers)
Field 'browser' doesn't contain a valid alias configuration after using description file: c:\temp\some-app\node_modules\@agm\js-marker-clusterer\package.json (relative path: ./services/managers) resolve as module

Just trying to play with this example https://github.com/SebastianM/angular-google-maps/pull/1044#issuecomment-326474498

implemented what @cdarken suggested as well and im getting

"EXCEPTION: Uncaught (in promise): Error: Error in ./MapPageComponent class MapPageComponent - inline template:29:12 caused by: No provider for GoogleMapsAPIWrapper!
Error: Error in ./MapPageComponent class MapPageComponent - inline template:29:12 caused by: No provider for GoogleMapsAPIWrapper!
at ViewWrappedError"

even after including the wrapper in my main ngModule

What i'm basically trying to do is add markers on clicking the map, and clustering them in real time, i don't even know if logically speaking, this feature is possible?

@kuncevic you have to run npm install --save js-marker-clusterer also.

@sadeajayi I think you forgot to call AgmCoreModule.forRoot() in your app module.

鉃★笍 Im closing this because I don't see any bug. Feel free to reopen if you still think there's a bug or comment below.

But cluster Breaks Info window functionality. Without Info Window cannot use cluster.
https://github.com/SebastianM/angular-google-maps/issues/1126

@sjumble we will track this in #1126 (because it's more specific)

@kuncevic I don't understand how this relates to AGM-(Cluster)

Is to possible to change the cluster image dynamically in AGM(cluster) by clicking the button?

able to change the cluster imagePath dynamically in AGM. But the image not changing. Please help me

Is there a working example?
I wasn't able to get it working after following most of the work-arounds found. I get this error even after adding GoogleMapsAPIWrapper in the module providers..
Am I missing something?

ERROR Error: StaticInjectorError(AppMModule)[ClusterManager -> GoogleMapsAPIWrapper]:
StaticInjectorError(Platform: core)[ClusterManager -> GoogleMapsAPIWrapper]:
NullInjectorError: No provider for GoogleMapsAPIWrapper!
at NullInjector.get (modules.js?hash=35566fa89c40f9086f6be723d68257c8dabf747a:12276)
at resolveToken (modules.js?hash=35566fa89c40f9086f6be723d68257c8dabf747a:12529)
at tryResolveToken (modules.js?hash=35566fa89c40f9086f6be723d68257c8dabf747a:12479)
at StaticInjector.get (modules.js?hash=35566fa89c40f9086f6be723d68257c8dabf747a:12374)
at resolveToken (modules.js?hash=35566fa89c40f9086f6be723d68257c8dabf747a:12529)
at tryResolveToken (modules.js?hash=35566fa89c40f9086f6be723d68257c8dabf747a:12479)
at StaticInjector.get (modules.js?hash=35566fa89c40f9086f6be723d68257c8dabf747a:12374)
at resolveNgModuleDep (modules.js?hash=35566fa89c40f9086f6be723d68257c8dabf747a:20514)
at NgModuleRef_.get (modules.js?hash=35566fa89c40f9086f6be723d68257c8dabf747a:21208)
at resolveDep (modules.js?hash=35566fa89c40f9086f6be723d68257c8dabf747a:21573)

thanks

This is a Meteor App

When I tried in pure Angular, it worked perfectly as expected!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PeterSisovsky picture PeterSisovsky  路  3Comments

Subhojit1992 picture Subhojit1992  路  3Comments

marcelinobadin picture marcelinobadin  路  3Comments

gnujeremie picture gnujeremie  路  3Comments

alexweber picture alexweber  路  4Comments