-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add components for floating map logo and scale combo #15
Conversation
src/Map/ScaleCombo/ScaleCombo.jsx
Outdated
* @param {type} resolution Description | ||
* @param {type} mv Description | ||
* | ||
* @return {type} Description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong JSDoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in bef0bbd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in bef0bbd
src/Map/ScaleCombo/ScaleCombo.jsx
Outdated
* @param {type} resolution Description | ||
* @param {type} mv Description | ||
* | ||
* @return {type} Description |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong JSDoc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in bef0bbd
import FloatingMapLogo from './FloatingMapLogo.jsx'; //@react-geo@ | ||
|
||
render( | ||
<FloatingMapLogo imageSrc="logo.png"/>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make use of a image-loader here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, use image loader in 0607940
src/Map/ScaleCombo/ScaleCombo.jsx
Outdated
let scale = MapUtils.getScaleForResolution(resolution, mv.getProjection().getUnits()); | ||
let roundScale = Math.round(scale); | ||
let option = <Option key={roundScale.toString()} value={roundScale.toString()}>1:{roundScale.toLocaleString()}</Option>; | ||
this.props.scales.push(option); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Props are immutable inside the component. Please make use of the state instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in bef0bbd
src/Map/ScaleCombo/ScaleCombo.jsx
Outdated
* | ||
* @return {Element} Option element for provided zoom level | ||
*/ | ||
getVal (zoom) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this to something more meaningful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed to determineOptionKeyForZoomLevel
in bef0bbd
Top! Great addition! |
25428dc
to
315d2ae
Compare
Thx for review @dnlkoch . Will merge as soon as all checks are green. |
Introduces
FloatingMapLogo
andScaleCombo
components.In addition,
MapUtil
is included here as well beside methodbuildLayersFromInitialState
(see #12)