Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

Getting error while implemented with React Native on Android #84

Open
donnes opened this issue Oct 11, 2018 · 0 comments
Open

Getting error while implemented with React Native on Android #84

donnes opened this issue Oct 11, 2018 · 0 comments

Comments

@donnes
Copy link

donnes commented Oct 11, 2018

I'm trying to use this library with React Native on Android, but I'm getting the error bellow.
On iOS its works fine.

I not sure but the math.gl has support for Browsers and NodeJS so I don't know if it can work with React Native.

My code:

// src\utils\index.js
export function geo2Points(centerLat, centerLon, lat, lon, size) {
  const viewport = new MercatorViewport({
    width: size,
    height: size,
    latitude: centerLat,
    longitude: centerLon,
    zoom: 10,
  });
  const result = viewport.project([lon, lat]);
  return { x: result[0], y: result[1] };
}

Error:

Can't find variable: Reflect

Stack trace:
  node_modules\math.gl\dist\es5\lib\math-array.js:24:27 in ExtendableBuiltin
  node_modules\math.gl\dist\es5\lib\math-array.js:52:105 in MathArray
  node_modules\math.gl\dist\es5\lib\vector.js:35:102 in Vector
  node_modules\math.gl\dist\es5\vector3.js:46:103 in Vector3
  node_modules\viewport-mercator-project\dist\es5\web-mercator-utils.js:130:33 in getWorldPosition
  node_modules\viewport-mercator-project\dist\es5\web-mercator-viewport.js:61:57 in WebMercatorViewport
  src\utils\index.js:51:42 in geo2Points
@donnes donnes changed the title Getting error while try to implement this library with React Native on Android Getting error while implemented with React Native on Android Feb 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant