Skip to content

Commit

Permalink
add required border{Square,Circle}Radius property
Browse files Browse the repository at this point in the history
  • Loading branch information
Gjum committed Jan 1, 2017
1 parent cc984ae commit 5cb79a9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
16 changes: 12 additions & 4 deletions js/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,7 @@ export default class Main extends Component {
}

render() {
var tileBounds = Util.radiusToBounds(5120);
var borderBounds = Util.radiusToBounds(5000);
var tileBounds = Util.radiusToBounds(this.props.borderCircleRadius || this.props.borderSquareRadius);
var minZoom = -6;

return <MuiThemeProvider muiTheme={muiTheme} className='fullHeight'>
Expand Down Expand Up @@ -312,12 +311,21 @@ export default class Main extends Component {
// updated directly through ref for performance reasons
ref={r => {if (r) this.coordsDisplay = r}} />

{ !this.state.showBorder ? null :
{ !this.state.showBorder ? null
: this.props.borderSquareRadius ?
<RL.Rectangle
bounds={borderBounds}
bounds={Util.radiusToBounds(this.props.borderSquareRadius)}
color='#ff8888'
fill={false}
/>
: this.props.borderCircleRadius ?
<RL.Circle
radius={this.props.borderCircleRadius}
center={[0, 0]}
color='#ff8888'
fill={false}
/>
: null // no border
}

{ this.state.claimOpacity > 0 && this.state.claims.map((claim, claimId) =>
Expand Down
1 change: 1 addition & 0 deletions web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
claimsPublishHelpUrl: 'https://github.com/dev3map/dev3map.github.io/wiki/Adding-and-editing-claims',
tilesUrl: 'https://raw.githubusercontent.com/dev3map/tiles/master/',
claimsUrl: 'https://raw.githubusercontent.com/dev3map/data/master/claims.json',
borderSquareRadius: 5000,
basemaps: [
'terrain',
'night',
Expand Down

0 comments on commit 5cb79a9

Please sign in to comment.