Merge pull request #341 from orangemug/fix/normalizeSourceURL-import-error

Fixed normalizeSourceURL import issue
This commit is contained in:
Orange Mug 2018-07-12 14:23:16 +01:00 committed by GitHub
commit 870d4349f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,7 +35,7 @@ import Debug from '../libs/debug'
import queryUtil from '../libs/query-util' import queryUtil from '../libs/query-util'
import MapboxGl from 'mapbox-gl' import MapboxGl from 'mapbox-gl'
import mapboxUtil from 'mapbox-gl/src/util/mapbox' import { normalizeSourceURL } from 'mapbox-gl/src/util/mapbox'
function updateRootSpec(spec, fieldName, newValues) { function updateRootSpec(spec, fieldName, newValues) {
@ -365,7 +365,7 @@ export default class App extends React.Component {
if(!this.state.sources.hasOwnProperty(key) && val.type === "vector" && val.hasOwnProperty("url")) { if(!this.state.sources.hasOwnProperty(key) && val.type === "vector" && val.hasOwnProperty("url")) {
let url = val.url; let url = val.url;
try { try {
url = mapboxUtil.normalizeSourceURL(url, MapboxGl.accessToken); url = normalizeSourceURL(url, MapboxGl.accessToken);
} catch(err) { } catch(err) {
console.warn("Failed to normalizeSourceURL: ", err); console.warn("Failed to normalizeSourceURL: ", err);
} }