diff --git a/src/components/App.jsx b/src/components/App.jsx index df8983c..7e9a986 100644 --- a/src/components/App.jsx +++ b/src/components/App.jsx @@ -23,7 +23,7 @@ import SurveyModal from './modals/SurveyModal' import { downloadGlyphsMetadata, downloadSpriteMetadata } from '../libs/metadata' import {latest, validate} from '@mapbox/mapbox-gl-style-spec' import style from '../libs/style' -import { initialStyleUrl, loadStyleUrl } from '../libs/urlopen' +import { initialStyleUrl, loadStyleUrl, removeStyleQuerystring } from '../libs/urlopen' import { undoMessages, redoMessages } from '../libs/diffmessage' import { StyleStore } from '../libs/stylestore' import { ApiStyleStore } from '../libs/apistore' @@ -148,8 +148,11 @@ export default class App extends React.Component { const styleUrl = initialStyleUrl() if(styleUrl) { - this.styleStore = new StyleStore() - loadStyleUrl(styleUrl, mapStyle => this.onStyleChanged(mapStyle)) + if(window.confirm("Load style from URL and discard current changes?")) { + this.styleStore = new StyleStore() + loadStyleUrl(styleUrl, mapStyle => this.onStyleChanged(mapStyle)) + } + removeStyleQuerystring() } else { this.styleStore.init(err => { if(err) {