Fixed normalizeSourceURL import issue.

This commit is contained in:
orangemug 2018-07-12 12:33:40 +01:00
parent 7c00775515
commit d88bc59720

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);
} }