Feature to update current map view in OSM

This commit is contained in:
orangemug
2020-01-19 13:37:56 +00:00
parent 6c240d53e4
commit 79fa2b3508
4 changed files with 87 additions and 6 deletions

View File

@@ -13,9 +13,12 @@ class DebugModal extends React.Component {
onOpenToggle: PropTypes.func.isRequired,
mapboxGlDebugOptions: PropTypes.object,
openlayersDebugOptions: PropTypes.object,
mapView: PropTypes.object,
}
render() {
const {mapView} = this.props;
return <Modal
data-wd-key="debug-modal"
isOpen={this.props.isOpen}
@@ -23,6 +26,7 @@ class DebugModal extends React.Component {
title={'Debug'}
>
<div className="maputnik-modal-section maputnik-modal-shortcuts">
<h4>Options</h4>
{this.props.renderer === 'mbgljs' &&
<ul>
{Object.entries(this.props.mapboxGlDebugOptions).map(([key, val]) => {
@@ -46,6 +50,18 @@ class DebugModal extends React.Component {
</ul>
}
</div>
<div className="maputnik-modal-section">
<h4>Links</h4>
<p>
<a
target="_blank"
rel="noopener" or rel="noreferrer"
href={`https://www.openstreetmap.org/#map=${Math.round(mapView.zoom)+1}/${mapView.center.lat}/${mapView.center.lng}`}
>
Open in OSM
</a> &mdash; Opens the current view on openstreetmap.org
</p>
</div>
</Modal>
}
}