Skip to content

Commit 548129e

Browse files
committed
Draw Manager observing. Allows you to bind to the options and change drawing modes. For instance I only want one polygon to be drawn. This allows me to splice out the polygon control and sets the drawing mode to null so it cannot be selected again.
1 parent 83d4faa commit 548129e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

directives/drawing-manager.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@
5656
rectangleOptions:options.rectangleoptions
5757
});
5858

59+
//Observers
60+
attrs.$observe('drawingControlOptions', function (newValue) {
61+
drawingManager.drawingControlOptions = parser.getControlOptions({drawingControlOptions: newValue}).drawingControlOptions;
62+
drawingManager.setDrawingMode(null);
63+
drawingManager.setMap(mapController.map);
64+
});
65+
5966

6067
/**
6168
* set events

0 commit comments

Comments
 (0)