-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Feature Description
Add exportAs
directive meta-data to the map-polygon
, map-polyline
, map-circle
and map-rectangle
directives. That would allow to template reference the directives' class's instance in order to pass it as an argument into a function call, to access its properties from within the DOM and everything else that template referencing features.
Use Case
You could create a template reference inside a map-polygon
directive tag and pass the reference as an argument into a function call like so :
This allows the function onPolygonClick
to receive the MapPolygon
instance, as an argument, of the polygon that has been clicked. With that you could change the properties of the MapPolygon
instance like editable
, draggable
, visible
to dynamically modify the appearance and the behavior of the polygon.
Current Use Case
Correct me if I am wrong, but at the moment, I don't think this is possible. The MapPolygon
directive doesn't have the exportAs
meta-data, so it's not possible to template reference a MapPolygon
instance.
Of course, you can pass the google.map.Polygon
object declared in an *ngFor
in a function call like so :
But then, doing something like that :
Do not hide the polygon.
Scope
This issue applies to the following directives : map-polygon
, map-polyline
, map-circle
and map-rectangle
.