@@ -81,6 +81,7 @@ const styles = (theme) => ({
8181 marginRight : 5 ,
8282 } ,
8383 '& .mapboxgl-popup' : {
84+ maxWidth : '474px!important' ,
8485 '&-anchor-bottom .mapboxgl-popup-tip' : {
8586 borderTopColor : theme . palette . primary . main ,
8687 } ,
@@ -95,6 +96,11 @@ const styles = (theme) => ({
9596 } ,
9697 } ,
9798 } ,
99+ loadedModal : {
100+ '& .mapboxgl-popup-content' : {
101+ borderRadius : 30 ,
102+ } ,
103+ } ,
98104 menuWrapper : {
99105 position : 'absolute' ,
100106 left : '20px' ,
@@ -415,7 +421,7 @@ class Map extends React.Component {
415421
416422 addPopup = ( coordinates , requestId ) => {
417423 this . setState ( { selectedRequestId : requestId } ) ;
418- this . popup = new mapboxgl . Popup ( )
424+ this . popup = new mapboxgl . Popup ( { closeButton : false , anchor : 'left' } )
419425 . setLngLat ( coordinates )
420426 . setDOMContent ( this . requestDetail )
421427 . addTo ( this . map ) ;
@@ -430,7 +436,7 @@ class Map extends React.Component {
430436 } ;
431437
432438 reset = ( ) => {
433- const { dispatchUpdateNcId } = this . props ;
439+ const { dispatchUpdateNcId, dispatchUpdateSelectedCouncils } = this . props ;
434440
435441 this . zoomOut ( ) ;
436442 this . addressLayer . clearMarker ( ) ;
@@ -456,23 +462,18 @@ class Map extends React.Component {
456462 } ) ;
457463
458464 // Reset MinZoom to original value after deselecting NC
465+ this . resetBoundaries ( ) ;
466+ dispatchUpdateSelectedCouncils ( [ ] )
459467 this . map . setMinZoom ( DEFAULT_MIN_ZOOM ) ;
460468 } ;
461469
462470 resetBoundaries = ( ) => {
463471 const {
464472 dispatchUpdateNcId,
465- dispatchUpdateSelectedCouncils,
466- dispatchUpdateUnselectedCouncils,
467- councils,
468473 } = this . props ;
469474
470475 // Reset the selected NcId back to null.
471476 dispatchUpdateNcId ( null ) ;
472-
473- // Reset councilSelector.
474- dispatchUpdateSelectedCouncils ( [ ] ) ;
475- dispatchUpdateUnselectedCouncils ( councils ) ;
476477 } ;
477478
478479 addressSearchIsEmpty = ( ) => {
@@ -765,6 +766,13 @@ class Map extends React.Component {
765766 }
766767 }
767768 }
769+ setRequestDetailLoading = ( isLoading ) => {
770+ if ( ! isLoading && this . popup ) {
771+ this . popup . addClassName ( this . props . classes . loadedModal ) ;
772+ }
773+ } ;
774+
775+ //// RENDER ////
768776
769777 render ( ) {
770778 const {
@@ -815,7 +823,10 @@ class Map extends React.Component {
815823 boundaryStyle = { mapStyle === 'dark' ? 'light' : 'dark' }
816824 />
817825 < div ref = { ( el ) => ( this . requestDetail = el ) } >
818- < RequestDetail requestId = { selectedRequestId } />
826+ < RequestDetail
827+ requestId = { selectedRequestId }
828+ loadingCallback = { this . setRequestDetailLoading }
829+ />
819830 </ div >
820831 { this . state . mapReady && requestTypes && (
821832 < >
0 commit comments