Marker Labels
Hi Nicolas
Would like to know if it is possible to add into the directive the ability to only show labels when a certain zoom level has been reached. I tried using a class, but the marker style is breaking this functionality. Would appreciate any feedback/help in this matter...
Can you use an ng-if on the marker directive so that it only appears when the map's zoom level reaches your desired threshold level?
Good day Rick
Tried using the ng-if as suggested, but for some reason the all my markers stayed on the map even it I filtered them - going from 233 markers down to 2, my code looked like this after editing: <google-map center="mapObjects.center" zoom="mapObjects.zoom" draggable="true" options="mapObjects.options" control="mapObjects.control"> <markers ng-if="mapObjects.zoom < 12" models="mapObjects.markers" coords="'self'" icon="'icon'" click="'onClicked'" fit="true"></markers> <markers ng-if="mapObjects.zoom > 11" models="mapObjects.markers" coords="'self'" icon="'icon'" click="'onClicked'" labelContent="'title'" labelAnchor="22 0" labelClass="marker-labels" fit="true"></markers> <window coords="window.coordinates" show="window.show" options="window.options" templateUrl="window.templateUrl" templateParameter="window.templateParameter"></window> </google-map>
On markers, ng-if would cause the entire element to not be included in the document. I was thinking you were using marker.
For markers, use the model's option field to conditionally set the the visible field conditionally based on the zoom. See the options field documentation: https://developers.google.com/maps/documentation/javascript/reference#MarkerOptions
Can this be closed?