Error: " No provider for GoogleMapsAPIWrapper! "
See original GitHub issueHi,
I’ve a problem since this morning: I used GoogleMapsAPIWrapper to make a test while coding. Finally I removed it because it was useless for me.
But now i’ve this error: No provider for GoogleMapsAPIWrapper! On all of my files which use it. But it was working perfectly before, and I haven’t touch to these files …
To resolve this error I put it as a provider
@Directive({ selector: 'marker-cluster-congelateurs', providers: [GoogleMapsAPIWrapper] })
But now my clusterer doesn’t work anymore … Any ideas ?
Thanks
Code of my clusterer: `this.gmapsApi.getNativeMap().then(map => {
console.log('in');
let style1 = {
url: "assets/icons/map/autre/c_commande.png",
height: 40,
width: 40,
textColor: '#000',
textSize: 14,
backgroundPosition: "center center"
};
let style2 = {
url: "assets/icons/map/autre/c_commande.png",
height: 40,
width: 40,
textColor: '#000',
textSize: 16,
backgroundPosition: "center center"
};
let style3 = {
url: "assets/icons/map/autre/c_commande.png",
height: 40,
width: 40,
textColor: '#000',
textSize: 18,
backgroundPosition: "center center"
};
// Options du clusterer
// gridSize correspond à la taille de la zone qu'englobe le cluster
// styles a 3 style: un pour chaque niveau de zoom du cluster
let options = {
gridSize: 50,
styles: [style1, style2, style3]
};
let infowindow = new google.maps.InfoWindow();
var that = this;
Observable
.interval(100)
.take(1)
.subscribe(() => {
// Clear des markers pour actualisation
if(this.markerCluster) {
this.markerCluster.clearMarkers();
this.markers = [];
}
if (this.points.length > 0) {
for (let point of this.points) {
if( point.latitude!=0 || point.longitude!=0){
// En fonction de si le mode couleur est actif ou non, le path est différent
let iconePath;
if(this.colorMod){
iconePath = point.iconeCouleur;
}
else{
iconePath = point.icone;
}
let markerIcon = {
url: "assets/icons/map/commandes/"+iconePath,
scaledSize: new google.maps.Size(25, 36)
}
let marker = new google.maps.Marker({
position: new google.maps.LatLng(point.latitude, point.longitude),
label: point.idCommande+"",
icon: markerIcon
});
// Clic event pour afficher l'infobulle
google.maps.event.addListener(marker, 'click', (function(marker: any) {
return function() {
infowindow.setContent(" "+point.infoBulle);
infowindow.open(map, marker);
that.notify.emit(point);
}
})(marker));
this.markers.push(marker);
}
}
}
// Clear des markers pour actualisation
else {
this.markers = [];
if (this.markerCluster) {
this.markerCluster.clearMarkers();
}
}
this.markerCluster = new MarkerClusterer(map, this.markers, options);
})
});
`
The console.log(‘in’) isn’t even showing something
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Error: " No provider for GoogleMapsAPIWrapper! " · Issue #1029
Hi, I've a problem since this morning: I used GoogleMapsAPIWrapper to make a test while coding. Finally I removed it because it was...
Read more >No provider for MapsAPILoader in IONIC - Stack Overflow
I've got this error in ionic/angular project. Runtime Error No provider for MapsAPILoader! Stack Error: No provider for MapsAPILoader! at ...
Read more >SebastianM/angular2-google-maps - Gitter
Hey there, I'm having an issue where one of my components fails to instantiate because of the error No provider for MapsAPILoader! in...
Read more >GoogleMapsAPIWrapper - @agm/core
Creates a google.map.Rectangle for the current map. Parameters : Name, Type, Optional. options, google.maps.RectangleOptions, No ...
Read more >No provider for HttpClient : r/angular - Reddit
No provider for HttpClient ... ERROR NullInjectorError: ... I am struck by the fact you have nothing in the "providers" section of the ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
in your main module, add this
Hope this helps
You need to do this @NgModule({ providers: [ … GoogleMapsAPIWrapper, ] })