Skip to content

Commit

Permalink
feat(thick-ray): change curve to an option of type
Browse files Browse the repository at this point in the history
  • Loading branch information
Junior2Ran committed Oct 12, 2019
1 parent f04625b commit 1c40407
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/dist/react-bmap.min.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion docs/examples/build/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36706,6 +36706,8 @@ var ThickRay = function (_Component) {
var lineData = [];
var pointData = [];

var isCurve = Boolean(this.props.type === 'curve');

if (this.props.data) {
var points = [];
var projection = map.getMapType().getProjection();
Expand Down Expand Up @@ -36735,7 +36737,7 @@ var ThickRay = function (_Component) {
strokeStyle: item.color,
geometry: {
type: 'LineString',
coordinates: curve
coordinates: isCurve ? curve : [[fromCenter.lng, fromCenter.lat], [toCenter.lng, toCenter.lat]]
},
count: item.count,
lineWidth: lineWidth
Expand Down Expand Up @@ -38159,6 +38161,7 @@ var App = function (_Component) {
_react2.default.createElement(_src.ThickRay, {
showFromPoint: false,
showToPoint: true,
type: 'curve',
data: [{
color: 'red',
from: {
Expand Down
1 change: 1 addition & 0 deletions docs/examples/components/thick-ray.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default class App extends Component {
<ThickRay
showFromPoint={false}
showToPoint={true}
type="curve"
data={[
{
color: 'red',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-bmap",
"version": "1.0.105",
"version": "1.0.106",
"description": "react-bmap",
"main": "lib/index.js",
"contributors": [
Expand Down
3 changes: 2 additions & 1 deletion src/components/thick-ray.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export default class ThickRay extends Component {
var lineData = [];
var pointData = [];

let isCurve = Boolean(this.props.type === 'curve');

if (this.props.data) {
var points = [];
Expand Down Expand Up @@ -102,7 +103,7 @@ export default class ThickRay extends Component {
strokeStyle: item.color,
geometry: {
type: 'LineString',
coordinates: curve
coordinates: isCurve ? curve : [[fromCenter.lng,fromCenter.lat],[toCenter.lng, toCenter.lat]]
},
count: item.count,
lineWidth: lineWidth
Expand Down

0 comments on commit 1c40407

Please sign in to comment.