Tidy location code (#7402)

This commit is contained in:
Andy Balaam 2021-12-17 12:26:02 +00:00 committed by GitHub
parent fb494a5098
commit 670d7824ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 82 additions and 31 deletions

View file

@ -55,7 +55,8 @@ export default class MLocationBody extends React.Component<IBodyProps, IState> {
componentDidMount() {
const config = SdkConfig.get();
const coordinates = new maplibregl.LngLat(this.coords.longitude, this.coords.latitude);
const coordinates = new maplibregl.LngLat(
this.coords.longitude, this.coords.latitude);
this.map = new maplibregl.Map({
container: this.getBodyId(),
@ -74,7 +75,11 @@ export default class MLocationBody extends React.Component<IBodyProps, IState> {
.addTo(this.map);
this.map.on('error', (e)=>{
logger.error("Failed to load map: check map_style_url in config.json has a valid URL and API key", e.error);
logger.error(
"Failed to load map: check map_style_url in config.json has a "
+ "valid URL and API key",
e.error,
);
this.setState({ error: e.error });
});
}