Attempting to a configurable attribute of a configurable property Issue-in turfJS?

淺唱寂寞╮ 提交于 2019-11-26 18:39:28

问题


I have an issue with @turf/turf the last version, in my react native app

"react-native": "0.58.0",

"@turf/turf": "^5.1.6"

I just followed the same example in the README.md but it's not working with me anymore.

The issue is when I import turf like this

import * as turf from '@turf/turf'; 

and write the function here is

handleNearby = () => {
        const { region, providers } = this.state;
        let currentPoint = [region.longitude, region.latitude]
        let points = _.map(providers, p => {
            console.log('@p', p);
            const to = [p.coordinates.longitude, p.coordinates.latitude];
            const distance = turf.distance(currentPoint, to, { units: 'kilometers' });
            return { coords: p.coordinates, name: p.username, id: p.id, distance }
        });
        const sortPoints = _.sortBy(points, ['distance']);
        this.setState({ sortedMarkers: sortPoints });
        console.log('@#points', sortPoints);
        return;

    }

and run the app I have this error

  attempting to a configurable attribute of a configurable property

But when I run the debugger on the browser the app is work very well I don't know why! any help?

来源:https://stackoverflow.com/questions/55974083/attempting-to-a-configurable-attribute-of-a-configurable-property-issue-in-turfj

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!