From f036614fb925d5f0694438cc38cc85e436ac7be2 Mon Sep 17 00:00:00 2001 From: Xiaoji Chen Date: Mon, 5 Nov 2018 10:36:27 -0800 Subject: [PATCH] API audit round 2 (#652) --- src/components/interactive-map.js | 5 ++--- src/config.js | 28 ---------------------------- src/index.js | 2 +- src/mapbox/mapbox.js | 4 +--- 4 files changed, 4 insertions(+), 35 deletions(-) delete mode 100644 src/config.js diff --git a/src/components/interactive-map.js b/src/components/interactive-map.js index 5b24fa92..f2a7b8e0 100644 --- a/src/components/interactive-map.js +++ b/src/components/interactive-map.js @@ -9,7 +9,6 @@ import TransitionManager from '../utils/transition-manager'; import {EventManager} from 'mjolnir.js'; import MapController from '../utils/map-controller'; -import config from '../config'; import deprecateWarn from '../utils/deprecate-warn'; export const InteractiveContext = createContext({ @@ -104,8 +103,8 @@ const propTypes = Object.assign({}, StaticMap.propTypes, { }); const getDefaultCursor = ({isDragging, isHovering}) => isDragging ? - config.CURSOR.GRABBING : - (isHovering ? config.CURSOR.POINTER : config.CURSOR.GRAB); + 'grabbing' : + (isHovering ? 'pointer' : 'grab'); const defaultProps = Object.assign({}, StaticMap.defaultProps, MAPBOX_LIMITS, TransitionManager.defaultProps, diff --git a/src/config.js b/src/config.js deleted file mode 100644 index 47ad0967..00000000 --- a/src/config.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2015 Uber Technologies, Inc. - -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -export default { - DEFAULTS: {}, - CURSOR: { - GRABBING: 'grabbing', - GRAB: 'grab', - POINTER: 'pointer' - } -}; diff --git a/src/index.js b/src/index.js index 09001188..fe6633a0 100644 --- a/src/index.js +++ b/src/index.js @@ -44,4 +44,4 @@ export { export {default as MapController} from './utils/map-controller'; // Experimental Features (May change in minor version bumps, use at your own risk) -export {StaticContext as _StaticContext} from './components/static-map'; +export {StaticContext as _MapContext} from './components/static-map'; diff --git a/src/mapbox/mapbox.js b/src/mapbox/mapbox.js index fbd03246..677d3a25 100644 --- a/src/mapbox/mapbox.js +++ b/src/mapbox/mapbox.js @@ -33,7 +33,6 @@ const propTypes = { onLoad: PropTypes.func, /** The onLoad callback for the map */ onError: PropTypes.func, /** The onError callback for the map */ reuseMaps: PropTypes.bool, - reuseMap: PropTypes.bool, transformRequest: PropTypes.func, /** The transformRequest callback for the map */ mapStyle: PropTypes.string, /** The Mapbox style. A string url to a MapboxGL style */ @@ -65,7 +64,6 @@ const defaultProps = { onLoad: noop, onError: noop, reuseMaps: false, - reuseMap: false, transformRequest: null, mapStyle: 'mapbox://styles/mapbox/light-v8', @@ -165,7 +163,7 @@ export default class Mapbox { _create(props) { // Reuse a saved map, if available - if ((props.reuseMaps || props.reuseMap) && Mapbox.savedMap) { + if (props.reuseMaps && Mapbox.savedMap) { this._map = this.map = Mapbox.savedMap; // When reusing the saved map, we need to reparent the map(canvas) and other child nodes // intoto the new container from the props.