add css class for marker
Hi! I need will add css class for marker. How do it? I mean agm-marker-cluster.
if the developers can't help me, then i offering my solution. I moved from folder "node_modules" to folder "app" in my project "/@agm/js-marker-clusterer and /js-marker-clusterer", after rewrite dependencies in head module
import { AgmJsMarkerClustererModule } from './_modules/@agm/js-marker-clusterer';
next in file 'js-marker-clustere/src/markerclusterer.js' changed method ClusterIcon.prototype.onAdd `ClusterIcon.prototype.onAdd = function() { this.div_ = document.createElement('DIV'); this.div_.className='cluster' if (this.visible_) { var pos = this.getPosFromLatLng_(this.center_); this.div_.style.cssText = this.createCss(pos); this.div_.innerHTML = this.sums_.text; this.div_.className='cluster-visible'; }
var panes = this.getPanes(); panes.overlayMouseTarget.appendChild(this.div_);
var that = this; google.maps.event.addDomListener(this.div_, 'click', function() { that.triggerClusterClick(); }); };`
Yeah, I think there is no simply way to select the marker of the map in CSS. I've tried with this selector
.gm-style img {} but this applies the CSS rules to all the images that appear in the map (so also the map itself!). Maybe use this CSS selector .gm-style > div > div > div > div > img {} can be a simple (but unsafe) workaround.
However I think this is a big lack in an awesome repository, and should be fixed even only adding some CSS classes to the main elements of the map component.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
why would you want to style markers? Google Maps doesn't usually expect you to mess with their styles directly.
Well just some simple coloring and minor styles should be easily possible through a class.
Don't know if it would because I am not sure they are added as html, but if they are, you can look for the markers and try to see their class. Why involve AGM into it?
by [iconUrl] you can add a image but it is not responsive is there a way to make it responsive as this ".gm-style img{} "is not directly accessible