File tree Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Expand file tree Collapse file tree 5 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ class BufferControl extends Control {
9393 * @inheritdoc
9494 */
9595 activate ( ) {
96- this . map . addInteraction ( this . selectInteraction ) ;
96+ this . map ? .addInteraction ( this . selectInteraction ) ;
9797 super . activate ( ) ;
9898
9999 document . getElementById ( 'buffer-width' ) ?. addEventListener ( 'change' , ( e ) => {
@@ -114,7 +114,7 @@ class BufferControl extends Control {
114114 * @inheritdoc
115115 */
116116 deactivate ( ) {
117- this . map . removeInteraction ( this . selectInteraction ) ;
117+ this . map ? .removeInteraction ( this . selectInteraction ) ;
118118 super . deactivate ( ) ;
119119 }
120120}
Original file line number Diff line number Diff line change @@ -790,8 +790,8 @@ class CadControl extends Control {
790790 super . activate ( silent ) ;
791791 this . snapLayer . setMap ( this . map ) ;
792792 this . linesLayer . setMap ( this . map ) ;
793- this . map . addInteraction ( this . pointerInteraction ) ;
794- this . map . addInteraction ( this . snapInteraction ) ;
793+ this . map ? .addInteraction ( this . pointerInteraction ) ;
794+ this . map ? .addInteraction ( this . snapInteraction ) ;
795795
796796 document . getElementById ( 'aux-cb' ) ?. addEventListener ( 'change' , ( evt ) => {
797797 this . setProperties ( {
@@ -822,8 +822,8 @@ class CadControl extends Control {
822822 super . deactivate ( silent ) ;
823823 this . snapLayer . setMap ( null ) ;
824824 this . linesLayer . setMap ( null ) ;
825- this . map . removeInteraction ( this . pointerInteraction ) ;
826- this . map . removeInteraction ( this . snapInteraction ) ;
825+ this . map ? .removeInteraction ( this . pointerInteraction ) ;
826+ this . map ? .removeInteraction ( this . snapInteraction ) ;
827827 }
828828}
829829
Original file line number Diff line number Diff line change @@ -64,15 +64,15 @@ class DrawControl extends Control {
6464 * @inheritdoc
6565 */
6666 activate ( ) {
67- this . map . addInteraction ( this . drawInteraction ) ;
67+ this . map ? .addInteraction ( this . drawInteraction ) ;
6868 super . activate ( ) ;
6969 }
7070
7171 /**
7272 * @inheritdoc
7373 */
7474 deactivate ( silent ) {
75- this . map . removeInteraction ( this . drawInteraction ) ;
75+ this . map ? .removeInteraction ( this . drawInteraction ) ;
7676 super . deactivate ( silent ) ;
7777 }
7878}
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ class RotateControl extends Control {
152152 * @inheritdoc
153153 */
154154 activate ( ) {
155- this . map . addInteraction ( this . pointerInteraction ) ;
155+ this . map ? .addInteraction ( this . pointerInteraction ) ;
156156 this . rotateLayer . setMap ( this . map ) ;
157157 super . activate ( ) ;
158158 }
@@ -163,7 +163,7 @@ class RotateControl extends Control {
163163 deactivate ( silent ) {
164164 this . rotateLayer . getSource ( ) . clear ( ) ;
165165 this . rotateLayer . setMap ( null ) ;
166- this . map . removeInteraction ( this . pointerInteraction ) ;
166+ this . map ? .removeInteraction ( this . pointerInteraction ) ;
167167 super . deactivate ( silent ) ;
168168 }
169169}
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ class TopologyControl extends Control {
6161 * @inheritdoc
6262 */
6363 activate ( ) {
64- this . map . addInteraction ( this . selectInteraction ) ;
64+ this . map ? .addInteraction ( this . selectInteraction ) ;
6565 this . addedFeatures = [ ] ;
6666 super . activate ( ) ;
6767 }
@@ -71,7 +71,7 @@ class TopologyControl extends Control {
7171 */
7272 deactivate ( silent ) {
7373 this . addedFeatures = [ ] ;
74- this . map . removeInteraction ( this . selectInteraction ) ;
74+ this . map ? .removeInteraction ( this . selectInteraction ) ;
7575 super . deactivate ( silent ) ;
7676 }
7777}
You can’t perform that action at this time.
0 commit comments