react-map-gl
Advanced tools
Comparing version 5.2.9 to 5.2.10
@@ -5,2 +5,9 @@ # CHANGELOG | ||
## 5.2.10 (Nov 5, 2020) | ||
- Use valid fill-extrusion value for layer type (#1199) | ||
- Add capturePointerMove to NavigationControl (#1215) | ||
- Fix user location dot offset (#1220) | ||
- Safety check before calling cloneElement (#1219) | ||
## 5.2.9 (Oct 7, 2020) | ||
@@ -7,0 +14,0 @@ |
@@ -40,3 +40,4 @@ "use strict"; | ||
captureClick: _propTypes["default"].bool, | ||
captureDoubleClick: _propTypes["default"].bool | ||
captureDoubleClick: _propTypes["default"].bool, | ||
capturePointerMove: _propTypes["default"].bool | ||
}; | ||
@@ -47,3 +48,4 @@ var defaultProps = { | ||
captureClick: true, | ||
captureDoubleClick: true | ||
captureDoubleClick: true, | ||
capturePointerMove: false | ||
}; | ||
@@ -89,2 +91,7 @@ | ||
}); | ||
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_onPointerMove", function (evt) { | ||
if (_this.props.capturePointerMove) { | ||
evt.stopPropagation(); | ||
} | ||
}); | ||
return _this; | ||
@@ -110,3 +117,4 @@ } | ||
click: this._onClick, | ||
dblclick: this._onDblClick | ||
dblclick: this._onDblClick, | ||
pointermove: this._onPointerMove | ||
}; | ||
@@ -113,0 +121,0 @@ eventManager.watch(this._events, ref); |
@@ -213,11 +213,12 @@ "use strict"; | ||
key: "location-maker", | ||
className: "mapboxgl-user-location-dot", | ||
longitude: markerPosition.longitude, | ||
latitude: markerPosition.latitude, | ||
onContextMenu: function onContextMenu(e) { | ||
return e.preventDefault(); | ||
}, | ||
captureDrag: false, | ||
captureDoubleClick: false | ||
}); | ||
}, React.createElement("div", { | ||
className: "mapboxgl-user-location-dot", | ||
style: { | ||
transform: 'translate(-50%, -50%)' | ||
} | ||
})); | ||
}); | ||
@@ -278,6 +279,3 @@ return _this; | ||
ref: this._containerRef, | ||
style: style, | ||
onContextMenu: function onContextMenu(e) { | ||
return e.preventDefault(); | ||
} | ||
style: style | ||
}, this._renderButton('geolocate', label, this._triggerGeolocate))); | ||
@@ -284,0 +282,0 @@ } |
@@ -47,3 +47,3 @@ "use strict"; | ||
circle: 'circle', | ||
fillExtrusion: 'fill-extrusion', | ||
'fill-extrusion': 'fill-extrusion', | ||
raster: 'raster', | ||
@@ -50,0 +50,0 @@ background: 'background', |
@@ -173,3 +173,3 @@ "use strict"; | ||
return React.Children.map(this.props.children, function (child) { | ||
return (0, React.cloneElement)(child, { | ||
return child && (0, React.cloneElement)(child, { | ||
source: _this3.id | ||
@@ -176,0 +176,0 @@ }); |
@@ -45,3 +45,4 @@ "use strict"; | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -48,0 +49,0 @@ |
@@ -42,3 +42,4 @@ "use strict"; | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -45,0 +46,0 @@ |
@@ -42,3 +42,4 @@ "use strict"; | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -45,0 +46,0 @@ |
@@ -10,3 +10,4 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
captureClick: PropTypes.bool, | ||
captureDoubleClick: PropTypes.bool | ||
captureDoubleClick: PropTypes.bool, | ||
capturePointerMove: PropTypes.bool | ||
}; | ||
@@ -17,3 +18,4 @@ const defaultProps = { | ||
captureClick: true, | ||
captureDoubleClick: true | ||
captureDoubleClick: true, | ||
capturePointerMove: false | ||
}; | ||
@@ -53,2 +55,8 @@ export default class BaseControl extends PureComponent { | ||
}); | ||
_defineProperty(this, "_onPointerMove", evt => { | ||
if (this.props.capturePointerMove) { | ||
evt.stopPropagation(); | ||
} | ||
}); | ||
} | ||
@@ -73,3 +81,4 @@ | ||
click: this._onClick, | ||
dblclick: this._onDblClick | ||
dblclick: this._onDblClick, | ||
pointermove: this._onPointerMove | ||
}; | ||
@@ -76,0 +85,0 @@ eventManager.watch(this._events, ref); |
@@ -182,9 +182,12 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
key: "location-maker", | ||
className: "mapboxgl-user-location-dot", | ||
longitude: markerPosition.longitude, | ||
latitude: markerPosition.latitude, | ||
onContextMenu: e => e.preventDefault(), | ||
captureDrag: false, | ||
captureDoubleClick: false | ||
}); | ||
}, React.createElement("div", { | ||
className: "mapboxgl-user-location-dot", | ||
style: { | ||
transform: 'translate(-50%, -50%)' | ||
} | ||
})); | ||
}); | ||
@@ -238,4 +241,3 @@ } | ||
ref: this._containerRef, | ||
style: style, | ||
onContextMenu: e => e.preventDefault() | ||
style: style | ||
}, this._renderButton('geolocate', label, this._triggerGeolocate))); | ||
@@ -242,0 +244,0 @@ } |
@@ -14,3 +14,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
circle: 'circle', | ||
fillExtrusion: 'fill-extrusion', | ||
'fill-extrusion': 'fill-extrusion', | ||
raster: 'raster', | ||
@@ -17,0 +17,0 @@ background: 'background', |
@@ -129,3 +129,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
return React.Children.map(this.props.children, child => cloneElement(child, { | ||
return React.Children.map(this.props.children, child => child && cloneElement(child, { | ||
source: this.id | ||
@@ -132,0 +132,0 @@ })); |
@@ -13,3 +13,4 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -16,0 +17,0 @@ export default class CanvasOverlay extends BaseControl { |
@@ -13,3 +13,4 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -16,0 +17,0 @@ export default class HTMLOverlay extends BaseControl { |
@@ -13,3 +13,4 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -16,0 +17,0 @@ export default class SVGOverlay extends BaseControl { |
@@ -21,3 +21,4 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
captureClick: PropTypes.bool, | ||
captureDoubleClick: PropTypes.bool | ||
captureDoubleClick: PropTypes.bool, | ||
capturePointerMove: PropTypes.bool | ||
}; | ||
@@ -28,3 +29,4 @@ var defaultProps = { | ||
captureClick: true, | ||
captureDoubleClick: true | ||
captureDoubleClick: true, | ||
capturePointerMove: false | ||
}; | ||
@@ -78,2 +80,8 @@ | ||
_defineProperty(_assertThisInitialized(_this), "_onPointerMove", function (evt) { | ||
if (_this.props.capturePointerMove) { | ||
evt.stopPropagation(); | ||
} | ||
}); | ||
return _this; | ||
@@ -99,3 +107,4 @@ } | ||
click: this._onClick, | ||
dblclick: this._onDblClick | ||
dblclick: this._onDblClick, | ||
pointermove: this._onPointerMove | ||
}; | ||
@@ -102,0 +111,0 @@ eventManager.watch(this._events, ref); |
@@ -198,11 +198,12 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
key: "location-maker", | ||
className: "mapboxgl-user-location-dot", | ||
longitude: markerPosition.longitude, | ||
latitude: markerPosition.latitude, | ||
onContextMenu: function onContextMenu(e) { | ||
return e.preventDefault(); | ||
}, | ||
captureDrag: false, | ||
captureDoubleClick: false | ||
}); | ||
}, React.createElement("div", { | ||
className: "mapboxgl-user-location-dot", | ||
style: { | ||
transform: 'translate(-50%, -50%)' | ||
} | ||
})); | ||
}); | ||
@@ -264,6 +265,3 @@ | ||
ref: this._containerRef, | ||
style: style, | ||
onContextMenu: function onContextMenu(e) { | ||
return e.preventDefault(); | ||
} | ||
style: style | ||
}, this._renderButton('geolocate', label, this._triggerGeolocate))); | ||
@@ -270,0 +268,0 @@ } |
@@ -25,3 +25,3 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
circle: 'circle', | ||
fillExtrusion: 'fill-extrusion', | ||
'fill-extrusion': 'fill-extrusion', | ||
raster: 'raster', | ||
@@ -28,0 +28,0 @@ background: 'background', |
@@ -159,3 +159,3 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
return React.Children.map(this.props.children, function (child) { | ||
return cloneElement(child, { | ||
return child && cloneElement(child, { | ||
source: _this3.id | ||
@@ -162,0 +162,0 @@ }); |
@@ -24,3 +24,4 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -27,0 +28,0 @@ |
@@ -23,3 +23,4 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -26,0 +27,0 @@ |
@@ -23,3 +23,4 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -26,0 +27,0 @@ |
{ | ||
"name": "react-map-gl", | ||
"description": "A React wrapper for MapboxGL-js and overlay API.", | ||
"version": "5.2.9", | ||
"version": "5.2.10", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "mapbox", |
@@ -36,3 +36,5 @@ // @flow | ||
// Stop map double click | ||
captureDoubleClick: PropTypes.bool | ||
captureDoubleClick: PropTypes.bool, | ||
// Stop map pointer move | ||
capturePointerMove: PropTypes.bool | ||
}; | ||
@@ -44,3 +46,4 @@ | ||
captureClick: true, | ||
captureDoubleClick: true | ||
captureDoubleClick: true, | ||
capturePointerMove: false | ||
}; | ||
@@ -53,2 +56,3 @@ | ||
captureDoubleClick: boolean, | ||
capturePointerMove: boolean, | ||
children?: any | ||
@@ -87,3 +91,4 @@ }; | ||
click: this._onClick, | ||
dblclick: this._onDblClick | ||
dblclick: this._onDblClick, | ||
pointermove: this._onPointerMove | ||
}; | ||
@@ -129,2 +134,8 @@ eventManager.watch(this._events, ref); | ||
_onPointerMove = (evt: MjolnirEvent) => { | ||
if (this.props.capturePointerMove) { | ||
evt.stopPropagation(); | ||
} | ||
}; | ||
_render() { | ||
@@ -131,0 +142,0 @@ throw new Error('_render() not implemented'); |
@@ -277,9 +277,9 @@ // @flow | ||
key="location-maker" | ||
className="mapboxgl-user-location-dot" | ||
longitude={markerPosition.longitude} | ||
latitude={markerPosition.latitude} | ||
onContextMenu={e => e.preventDefault()} | ||
captureDrag={false} | ||
captureDoubleClick={false} | ||
/> | ||
> | ||
<div className="mapboxgl-user-location-dot" style={{transform: 'translate(-50%, -50%)'}} /> | ||
</Marker> | ||
); | ||
@@ -302,3 +302,2 @@ }; | ||
style={style} | ||
onContextMenu={e => e.preventDefault()} | ||
> | ||
@@ -305,0 +304,0 @@ {this._renderButton('geolocate', label, this._triggerGeolocate)} |
@@ -35,3 +35,3 @@ // @flow | ||
circle: 'circle', | ||
fillExtrusion: 'fill-extrusion', | ||
'fill-extrusion': 'fill-extrusion', | ||
raster: 'raster', | ||
@@ -38,0 +38,0 @@ background: 'background', |
@@ -152,6 +152,9 @@ // @flow | ||
this._updateSource(); | ||
return React.Children.map(this.props.children, child => | ||
cloneElement(child, { | ||
source: this.id | ||
}) | ||
return React.Children.map( | ||
this.props.children, | ||
child => | ||
child && | ||
cloneElement(child, { | ||
source: this.id | ||
}) | ||
); | ||
@@ -158,0 +161,0 @@ } |
@@ -37,3 +37,4 @@ // @flow | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -40,0 +41,0 @@ |
@@ -38,3 +38,4 @@ // @flow | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -41,0 +42,0 @@ |
@@ -38,3 +38,4 @@ // @flow | ||
captureClick: false, | ||
captureDoubleClick: false | ||
captureDoubleClick: false, | ||
capturePointerMove: false | ||
}; | ||
@@ -41,0 +42,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1568213
17275