@@ -161,71 +161,79 @@ export default function ProjectionMapShape() {
161161 < Typography gutterBottom >
162162 Rotation: { autoRotation ? 'auto' : `(${ rotation [ 0 ] } °, ${ rotation [ 1 ] } °)` }
163163 </ Typography >
164- < FormControlLabel
165- control = {
166- < Checkbox
167- size = "small"
168- checked = { autoRotation }
169- onChange = { ( event ) => setAutoRotation ( event . target . checked ) }
170- />
171- }
172- label = { `auto rotation` }
173- />
174- { autoRotation ? null : (
175- < div >
176- < ButtonGroup
177- variant = "outlined"
178- aria-label = "outlined button group"
179- fullWidth
180- >
181- { cities . map ( ( { name, coordinates } ) => (
182- < Button
164+ { usaProjection ? (
165+ < Typography variant = "caption" >
166+ Rotation is not available for the Albers USA projection.
167+ </ Typography >
168+ ) : (
169+ < React . Fragment >
170+ < FormControlLabel
171+ control = {
172+ < Checkbox
183173 size = "small"
184- key = { name }
185- onClick = { ( ) => {
186- if ( 'transverseMercator' === projection ) {
187- return setRotation ( [ 0 , - coordinates [ 1 ] ] ) ;
188- }
189- if ( isCylindrical ( projection ) ) {
190- return setRotation ( [ - coordinates [ 0 ] , 0 ] ) ;
191- }
192- return setRotation ( [ - coordinates [ 0 ] , - coordinates [ 1 ] ] ) ;
193- } }
194- disabled = { usaProjection }
195- >
196- { name }
197- </ Button >
198- ) ) }
199- </ ButtonGroup >
200- < Slider
201- value = { rotation [ 0 ] }
202- min = { - 180 }
203- max = { 180 }
204- step = { 10 }
205- marks = { [ { value : 0 , label : '' } ] }
206- aria-label = "longitude"
207- size = "small"
208- onChange = { ( _ , value : number ) =>
209- setRotation ( ( prev ) => [ value , prev [ 1 ] ] )
174+ checked = { autoRotation }
175+ onChange = { ( event ) => setAutoRotation ( event . target . checked ) }
176+ />
210177 }
211- valueLabelDisplay = "auto"
212- disabled = { usaProjection }
213- />
214- < Slider
215- value = { rotation [ 1 ] }
216- min = { - 180 }
217- max = { 180 }
218- step = { 10 }
219- marks = { [ { value : 0 , label : '' } ] }
220- aria-label = "latitude"
221- size = "small"
222- onChange = { ( _ , value : number ) =>
223- setRotation ( ( prev ) => [ prev [ 0 ] , value ] )
224- }
225- valueLabelDisplay = "auto"
226- disabled = { usaProjection }
178+ label = { `auto rotation` }
227179 />
228- </ div >
180+ { autoRotation ? null : (
181+ < div >
182+ < ButtonGroup
183+ variant = "outlined"
184+ aria-label = "outlined button group"
185+ fullWidth
186+ >
187+ { cities . map ( ( { name, coordinates } ) => (
188+ < Button
189+ size = "small"
190+ key = { name }
191+ onClick = { ( ) => {
192+ if ( 'transverseMercator' === projection ) {
193+ return setRotation ( [ 0 , - coordinates [ 1 ] ] ) ;
194+ }
195+ if ( isCylindrical ( projection ) ) {
196+ return setRotation ( [ - coordinates [ 0 ] , 0 ] ) ;
197+ }
198+ return setRotation ( [ - coordinates [ 0 ] , - coordinates [ 1 ] ] ) ;
199+ } }
200+ disabled = { usaProjection }
201+ >
202+ { name }
203+ </ Button >
204+ ) ) }
205+ </ ButtonGroup >
206+ < Slider
207+ value = { rotation [ 0 ] }
208+ min = { - 180 }
209+ max = { 180 }
210+ step = { 10 }
211+ marks = { [ { value : 0 , label : '' } ] }
212+ aria-label = "longitude"
213+ size = "small"
214+ onChange = { ( _ , value : number ) =>
215+ setRotation ( ( prev ) => [ value , prev [ 1 ] ] )
216+ }
217+ valueLabelDisplay = "auto"
218+ disabled = { usaProjection }
219+ />
220+ < Slider
221+ value = { rotation [ 1 ] }
222+ min = { - 180 }
223+ max = { 180 }
224+ step = { 10 }
225+ marks = { [ { value : 0 , label : '' } ] }
226+ aria-label = "latitude"
227+ size = "small"
228+ onChange = { ( _ , value : number ) =>
229+ setRotation ( ( prev ) => [ prev [ 0 ] , value ] )
230+ }
231+ valueLabelDisplay = "auto"
232+ disabled = { usaProjection }
233+ />
234+ </ div >
235+ ) }
236+ </ React . Fragment >
229237 ) }
230238 </ div >
231239 < div >
@@ -256,7 +264,6 @@ export default function ProjectionMapShape() {
256264 setTranslation ( ( prev ) => [ value , prev [ 1 ] ] )
257265 }
258266 valueLabelDisplay = "auto"
259- disabled = { usaProjection }
260267 />
261268 < Slider
262269 value = { translation [ 1 ] }
@@ -269,7 +276,6 @@ export default function ProjectionMapShape() {
269276 setTranslation ( ( prev ) => [ prev [ 0 ] , value ] )
270277 }
271278 valueLabelDisplay = "auto"
272- disabled = { usaProjection }
273279 />
274280 </ div >
275281 ) }
@@ -288,9 +294,9 @@ export default function ProjectionMapShape() {
288294 />
289295 < Slider
290296 value = { scale }
291- min = { 10 }
292- max = { 500 }
293- step = { 10 }
297+ min = { 100 }
298+ max = { 1500 }
299+ step = { 100 }
294300 size = "small"
295301 disabled = { autoScale }
296302 onChange = { ( _ , value ) => setScale ( value as number ) }
0 commit comments