mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-25 16:02:50 +00:00
API audit round 2 (#652)
This commit is contained in:
parent
0bbff933fc
commit
f036614fb9
@ -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,
|
||||
|
||||
@ -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'
|
||||
}
|
||||
};
|
||||
@ -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';
|
||||
|
||||
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user